The invention discloses an 
image enhancement method based on an adaptive 
immunity genetic algorithm. The 
image enhancement method based on the adaptive 
immunity genetic algorithm includes steps that S1, normalizing an image pixel 
gray level f(x, y) to obtain n(x, y); S2, coding parameters (alpha, beta) to be optimized, randomly generating a group of initial individuals to form an initial 
population, and inputting a control parameter 
crossover probability p<c>, a 
mutation probability p<m>, a 
population size N, a maximum running algebra G and the like; S3, judging whether an 
evolution algebra t is equal to G, if so, ending the 
algorithm, and outputting the optimal solution of (alpha, beta), otherwise, turning to the next step; S4, using a roulette strategy to select M individuals, and carrying out 
crossover and 
mutation operations on the individuals according to 
crossover and 
mutation methods in genetic operation; S5, selecting two vaccines, the individuals to be vaccinated and a 
vaccination point number to perform immunization, making a immunization choice after the 
vaccination, and using the optimal individual retention strategy for the vaccinated 
population; S6, obtaining the corresponding 
nonlinear transformation function F(u) of each group of (alpha, beta), and using the 
nonlinear transformation function to perform an image 
gray level transformation to obtain an output image g(x, y).