The antibody candidate set generated by the clonal selection algorithm has only a small number of antibodies with high antigen affinity to obtain high-frequency mutations. Among other antibodies, some low-affinity antibodies are replaced by new antibodies to participate in the next clonal selection. A large number of antibodies with high affinity make it difficult to participate in clonal selection and exist in antibody concentration for a long time. This part of inactive antibody forms a “black hole” of the antibody set, which is difficult to remove and update in a timely manner, thus affecting the speed at which the algorithm approximates the optimal solution. Inspired by the mechanism of biological forgetting, an improved clonal selection algorithm is proposed to solve this problem. It aims to use the abstract mechanism of biological forgetting to eliminate antibodies that cannot actively participate in high-frequency mutations in the antibody candidate set and to improve the problem of insufficient diversity of antibodies in the clonal selection algorithm, which is prone to fall into the local optimal. Compared with the existing clonal selection and genetic algorithms, the experiment and time complexity analysis show that the algorithm has good optimization efficiency and stability.