This paper describes an immune system model based on binary strings. The purpose of the model is to study the pattern-recognition processes and learning that take place at both the individual and species levels in the immune system. The genetic algorithm (GA) is a central component of the model. The paper reports simulation experiments on two pattern-recognition problems that are relevant to natural immune systems. Finally, it reviews the relation between the model and explicit fitness-sharing techniques for genetic algorithms, showing that the immune system model implements a form of implicit fitness sharing.