# Using an Artificial _Physarum polycephalum_ Colony for Threshold Image Segmentation
## 3 Methodology
### Artificial Physarum polycephalum Colony  
In this subsection, to overcome the shortcomings of algorithm search, a novel artificial _Physarum polycephalum_ colony is designed on the basis of natural Physarum in the literature [17; 18; 47]. Figure 1 shows an artificial _Physarum polycephalum_ colony on a 2-D segmentation image. In our artificial _Physarum polycephalum_ colony algorithm, there are three main components, i.e., an original image, an artificial _Physarum polycephalum_ colony, and a fitness function. First, the original image in Figure 1 is not only the living area of an artificial _Physarum polycephalum_ colony but also the solution space of the threshold image segmentation or other complex problems. In an original image, there are a lot of pixels with different gray levels. An artificial _Physarum polycephalum_ colony can search for feasible solutions on an original image or solution space. Each feasible solution is a segmentation model of the original image. The artificial _Physarum polycephalum_ colony should search for feasible solutions as the food sources for its living and the feasible solutions are randomly distributed in the solution space. The food sources can be absorbed by the artificial _Physarum polycephalum_ colony and changed into nutrients flowing in its body. Second, several _Physarum polycephalum_ constitute an artificial _Physarum polycephalum_ colony in Figure 1, where an artificial _Physarum polycephalum_ employs many filiform hyphae to randomly search for feasible solutions. The artificial _Physarum polycephalum_ colony algorithm counts the number of hyphae as the population size \(S\). The artificial _Physarum polycephalum_ colony employs three learning mechanisms, i.e., self-learning, social learning, and free learning. Hence, different hyphae can learn from each other and many hyphae can cross to share the environmental information. The artificial _Physarum polycephalum_ finding the food sources and obtaining more nutrients will survive; otherwise, it will be absorbed and disappear. The leaning mechanism and absorbing behavior can effectively simulate the swarm behavior of a real _Physarum polycephalum_ colony. Third, the artificial _Physarum polycephalum_ colony utilizes a fitness function to evaluate its living state, which is not shown in Figure 1. The threshold \(t\) and region threshold \(s\) segment the original image into several parts, and the fitness depends on the nutrients from the food sources. The artificial _Physarum polycephalum_ colony does not know the positions of the feasible solutions from the beginning, but it can judge the feasible solution by a fitness function. If an artificial _Physarum polycephalum_ or a hyphae finds a solution, it will obtain a high fitness value. The fitness function can be designed according to the  
Figure 1: The main architecture of an artificial _Physarum polycephalum_ colony. problems to be solved, such as threshold image segmentation. Different artificial _Physarum polycephalum_ can cross and learn the nutrient information to share the fitness information. Based on the three basic components, the artificial _Physarum polycephalum_ colony algorithm uses two main operations to search for the optimal solutions, i.e., expansion and contraction. In the expansion operation, the artificial _Physarum polycephalum_ colony employs three learning mechanisms to produce more hyphae, i.e., self-learning, social-learning, and free-learning. At the initialization, the artificial _Physarum polycephalum_ colony produces a population size \(S\) of filiform hyphae, where each filiform hyphae is a randomly generated feasible solution. In expansion, the filiform hyphae with a population size of \(S\) remain unchanged by self-learning, and all these artificial _Physarum polycephalum_ hyphae can learn from each other's experience to produce a new generation of hyphae with a population size of \(S\) by social-learning.