The colony is one of the important research objects in microbial technology, which can realize the evaluation of food safety level, environmental pollution degree, therapeutic effect of medical drugs, and characteristics of agricultural fungicides. Traditional colony image research requires human visual observation and statistics, which will result in low work efficiency and high work intensity. Colony image edge detection is an important basis for colony image research. Traditional edge detection operators cannot meet the accuracy requirements of the detection results. This paper proposes a Mediocrity Ant Colony Algorithm (MACA) to achieve edge detection of colony images. MACA combines the mediocrity rule, uses empirical functions to establish a pheromone database that can be used as a pheromone update reference table, adopts the Chebyshev distance as a weight that affects pheromone update, and combines heuristic information acquisition with maximum variance classification method and local path weights. The method that jointly affects the ant transition probability incorporates feedback rules for obtaining path weights to improve the edge detection effect. By performing edge detection simulation experiments on six colonies of three types of bacteria, and comparing with the classic edge detection operators and two classic ant colony edge detection algorithms, the detection performance, detection results and running time are proposed. The stability and accuracy of MACA algorithm is better than other methods, and the ideal results of the colony image edge detection by the ant colony algorithm are obtained.