According to 12 indicators selected from three aspects of the total red line, the efficiency of the red line, accept the red line, the regional water safety evaluation index system and grading standards were built under the most stringent water resources management constraints. Krill foraging algorithm (KH) - Maximum Entropy Projection Pursuit (MEPP) water security evaluation was proposed, and Artificial Bee Colony (ABC) algorithm, cultural algorithm (CA) were constructed to compare with the particle swarm optimization (PSO) algorithm - MEPP evaluation model. A case study on water security of 16 administrative regions in Yunnan Province was carried out. The results show that the optimization accuracy of KH algorithm is better than that of ABC, CA and PSO algorithm, and has good global extremum search ability. The KH-MEPP model evaluates the water security of Diqing, Dehong, Nujiang and Xishuangbanna as safe, and Lijiang is evaluated as “unsafe”. The rest of the administrative regions are rated as “basically safe ”. The results of the KH-MEPP model are the same as those of the PSO-MEPP model in Yunnan Province, but there are differences in the sorting. The results of CA-MEPP and ABC-MEPP are different in the evaluation results and ranking.