Abstract: Artificial immune algorithm is a kind of intelligent learning algorithm which simulates the biology immunity systems and is widely applied in anomaly detection. There are many techniques for anomaly detection. Among these approaches, Multilevel Immune Learning Algorithm (MILA) is a prominent one due to better discrimination ability and a higher detection rate. However, the limitation of MILA is the T suppressor (Ts) detector generation mechanism which fails to match the coverage of the high-dimensional self space well. In comparison with MILA, an optimized multilevel immune learning algorithm is presented. The optimized algorithm takes a novel variable-recessive threshold model into the process of detector generation and achieves a better coving effect. The experimental results indicate that the optimized algorithm is useful to the anomaly detection with very good detection rate and lower false alarm rate.