^{1}

^{1}

^{1}

^{1}

^{1}

In machine-vision-based systems for detecting foreign fibers, due to the background of the cotton layer has the absolute advantage in the whole image, while the foreign fiber only account for a very small part, and what’s more, the brightness and contrast of the image are all poor. Using the traditional image segmentation method, the segmentation results are very poor. By adopting the maximum entropy and genetic algorithm, the maximum entropy function was used as the fitness function of genetic algorithm. Through continuous optimization, the optimal segmentation threshold is determined. Experimental results prove that the image segmentation of this paper not only fast and accurate, but also has strong adaptability.

The foreign fibers in cotton refer to those non-cotton fibers and dyed fibers, such as polypropylene fiber silk, hemp, feathers, colored line, colored cloth, hairs and so on. Though very low content of foreign fibers in cotton, the presence of foreign fibers will seriously affect the quality of the final cotton textile products, as they may debase the strength of the yarn, they are not easy to be dyed, and this will lead to great economic loss for the cotton textile enterprises [

Image segmentation is one of the primary stages in image processing and machine vision system, and it is also the precondition of image analysis. The objective of image segmentation is to partition the image into meaningful connected-components to extract the features of objects [

The current threshold segmentation method, according to the threshold selection criterion function types, can be divided into maximum entropy method [

The remainder of this paper is organized as follows. Section 2 presents the maximum entropy method and the GA briefly. Section 3 provides the proposed algorithm in detail. Results and discussions are followed in Section 4. Section 5 declares the conclusion.

Maximum entropy algorithm is a segmentation method which based on the histogram of the image [

Let the segmentation threshold is t, which will divide the image into two parts: target A and background B. Assuming that the gray values which less than the threshold of the pixels belong to the target A, the gray values which greater than or equal to the threshold of the pixels belong to the background B, then the probability of pixels in the image are related to target A and background B respectively is:

Target A:

Background B:

The entropy of the target region and the background region are respectively defined as:

The entropy of the whole image is defined as:

The greater the value of function H(t), the more information of the target and background represent, the more accurate the target and the background area. The global optimal threshold (let it be t^{*}) is the value which make H(t) take the maximum value, that is, t^{*} can be expressed as:

Genetic algorithm (GA) is a parallel random search optimization method which simulates natural genetic mechanism and biological evolution theory. It is stochastic rather than exhaustive. It can obtain the global optimal solution with large probability. In addition, GA does not require the evaluation function to be monotone, so GA is very suitable for real-time processing, which is not only easy to implement, but also has strong robustness. The basic idea of the algorithm is first encoding the problem to be solved into a string (named chromosome). Each chromosome is a solution to the being solved problem. Next, GA calculates the fitness value of each individual in a group of chromosomes, then chromosomes with higher fitness are selected for crossover and mutation operation and then produce a new generation with higher fitness. At last, the relative optimal solution is obtained by continuous iteration.

Through analysis the cotton foreign fiber images, it is found that the background of the cotton layer has the absolute advantage in the whole image, while the target is very small (Figures 2(a)-5(a)). Furthermore, the brightness and contrast of the image are all poor. Using the traditional image segmentation method (e.g. Otsu), the segmentation results are very poor. Therefore, we adopt the maximum entropy threshold method in this paper. However, the essence of the maximum entropy method is to obtain the maximum value of the objective function (Equation (6)) in the gray space, the computation of the algorithm is very large, and it takes much more time. In order to reduce the complexity of the algorithm, we combine GA with the maximum entropy in the foreign fiber image segmentation. The maximum entropy function was used as the fitness function of GA. By continuous optimization, the optimal segmentation threshold is determined. The flow chart of the algorithm was shown as

Encoding a solution of a problem into a serial of genes, called chromosome, is very important when using GA. Various encoding methods have been proposed for particular problems to provide effective implementation of GA, such as binary encoding, real number encoding, integer or literal permutation encoding, or general data structure encoding [

The initial population for evolution is created randomly. Individual in the initial population is equivalent to the candidate solution in the solution space. If the population size is too large, the computational complexity is high; if the scale is too small, the search space is limited, the search may stop at the immature stage. Therefore, the population number is set to 20, the maximum number of iterations is set to 100.

The selection operation, also known as the copy operation, is to determine which individual is genetic and which individual is eliminated. The common methods include roulette wheel method, the elite preservation strategy and the order selection method. As the crossover and mutation operations are performed, the optimal solution can be easily lost in an intermediate step. So we adopted the method of 10% elite strategy and 90% roulette wheel. Individuals with the largest fitness directly into the next generation, which can guarantee that the algorithm converges to the global optimal solution; the remaining 90% of the individuals are selected according to the fitness proportionate. The larger the fitness of the individual, the greater the probability of being selected. The probability of the individual i is selected to the next generation group is:

where n is the population size, F_{i} is the fitness of the individual i.

Commonly used crossover operations include single-point crossover, double-point crossover, multi-point crossover, etc. In our research, we chose the single-point crossover operator, the crossover probability is 0.8 and 0.6 respectively.

According to the mutation probability, the individual's value is replaced by some other gene values, which can increase the diversity of the population, and can also improve the local search ability of GA. Various mutation operations have been introduced by researchers, such as inversion mutation, neighbor exchange mutation, etc. We chose inversion mutation in our research.

The probabilities of crossover and mutation, denoted by P_{c} and P_{m}, affect seriously the search ability and convergence speed of GA [_{c} and P_{m} are all fixed. But in the early stage of evolution, the individual difference is bigger, so we should increase P_{c} and reduce P_{m} in order to accelerate the evolution process and at the same time reducing the amount of calculation. In the later stage of evolution, the individual difference is small, so P_{m} should be reduced and P_{c} should be increased to avoid local optimal solution.

For the proposed algorithm, P_{c} is 0.8 during the first 50 generations of the evolution, so as to search the optimal solution as soon as possible. In the second part of the evolution, P_{c} is 0.6. The mutation probability P_{m} is calculated by:

where P_{m0} is the initial mutation probability; f is the fitness of the parent chromosome;

We set two terminate criterions in our GA: 1) maximum generation number. When the maximum number of iterations is reached, the algorithm terminates; 2) set the minimum number of iterations is 10, when the iteration number is larger than the value, check the difference between the average fitness of the current population and the average fitness of the last generation whether less than a minimum value ε (here ε = 0.0001), once the condition is satisfied, the iteration terminates.

In order to verify the effectiveness of the paper’s algorithm, we collected 60 foreign fiber images which include 5 foreign fibers such as hair, feather, hemp rope, polypropylene, cloth and so on. The image is 128 × 4096 size. The experiments are performed on over Matlab7.1 platform. We compared the results of the paper’s method with the results of the Otsu’s method. Figures 2-5 show a part of the experimental results.

It can be seen from Figures 2(a)-5(a), for the original image, the cotton layer background occupies the absolute advantage in the whole image, while the foreign fiber only accounts for a very small part, and the contrast of the image is very low. Therefore, in many cases, the target cannot be separated from the background by using the Otsu method (e.g. Figures 2-4). For

Image name | Image number | Segmentation accuracy | |
---|---|---|---|

The proposed method | Otsu | ||

Hair | 10 | 90% | 20% |

Feather | 15 | 100% | 100% |

Polypropylene | 10 | 100% | 50% |

Cloth | 15 | 100% | 60% |

Hemp rope | 10 | 100% | 20% |

The results shown in

Due to the low brightness, low contrast and small proportion of the target of the foreign fiber images, we adopted the image segmentation based on maximum entropy and genetic algorithm. Experimental results show that the adopted algorithm is more accurate than the traditional Otsu method, and the speed is fast and adaptable, which meets the real-time requirements of the foreign fiber detection system.

Next work: for the detection of white foreign fibers (such as plastic sheeting, plastic film, etc.), the accuracy of the segmentation algorithm is poor, there is still to be further improved.

The authors thank Hebei Natural Science Foundation (F2015201033), the Ministry of Science and Technology of the People’s Republic of China (2013DFA11320), for their financial support.

Liping Chen,Xiangyang Chen,Sile Wang,Wenzhu Yang,Sukui Lu, (2015) Foreign Fiber Image Segmentation Based on Maximum Entropy and Genetic Algorithm. Journal of Computer and Communications,03,1-7. doi: 10.4236/jcc.2015.311001