Abstract
Image segmentation technology is a basic technology for image processing and analysis. As a typical interactive color image segmentation algorithm, grabbing segmentation has high precision, interactive operation and better segmentation effect in processing complex background segmentation, and has broad prospects in the field of agriculture. In this paper, the image segmentation algorithm of maize smut, Maize Head Smut and maize rust, which are three main diseases and insect pests, is studied by taking the high-yield crop Maize in Northeast China as an example. The image background in the static image editing is replaced by an improved one-time cutting algorithm. Through the adaptive combination of weights, the depth information and saliency information are combined into the grabbing color model. The improved image segmentation algorithm greatly improves the efficiency and accuracy of image segmentation, and achieves a good spot segmentation effect in the static image of corn pests and diseases, and has a high recognition. Do not rate. And it plays a predictive research effect in practical verification.
Introduction
Image segmentation technology has enjoyed many years of development, and scholars have provided different interpretations and expressions to define it. In general sense, image segmentation is the first step of image processing, which separates useful contents from useless contents, leaving useful image information called foreground; abandoning the part named as background. Only after this operation can subsequent higher level image processing operations be carried out. In the process of image recognition, image segmentation of damaged leaves is a very important step. The segmentation of pest and disease images mainly focuses on the identification and segmentation of the damaged and non-damaged areas. The accuracy and quality of image segmentation have a direct impact on the recognition and classification of pests and diseases. Nowadays, there are many remarkable achievements in the research of image segmentation techniques and algorithms for crop leaf diseases and insects. The main technologies are edge segmentation, threshold segmentation and region segmentation [1].
As an effective interactive image segmentation algorithm to extract foreground objects from complex background, with high segmentation accuracy and efficiency and less interactive operation, Grab Cut algorithm obtains a basic “hard segmentation” by interactive segmentation, and then calculates the continuous value on the strip around the hard segmentation boundary by Border Matting method, so as to obtain an ideal segmentation effect, which reduces the user’s interactive workload and improves the accuracy. It is an improvement of Graph cuts. Traditional graph cuts refer to the manual annotation of certain pixels as foreground objects and background by user interaction, and the use of Graph-cut to complete the marking of all pixels [2]. Grab cut is an advanced version of this method. It uses rectangular boundary box to represent foreground objects through user interaction and three-dimensional Gauss Mixture Model (GMM) to represent the distribution of color statistics. It has been widely used because of its higher segmentation accuracy and simpler user interaction, and subsequent research is also increasing. One-Cut algorithm has made remarkable achievements, and even the segmentation accuracy on some open datasets has reached the most advanced level in the world. But it still faces some problems, such as unreasonable use of color information, unreasonable structure of network graph, redundant calculation, too many edges with single weight in network graph and too many nodes in network graph, which have led to low efficiency and accuracy of image segmentation [3]. Different from other gray value methods in image segmentation, Grab cut is an interactive segmentation algorithm based on the improved Graph cuts algorithm, which has high efficiency and good effect, characterized by less computation and less workload. It mainly describes the distribution of the foreground and background pixels of the image using the Gauss Mixture Model (GMM), and calculates the parameters of the model by iteration method. At the same time, incomplete marking method is used, and the distinction between background and foreground is very obvious. But there are also some problems, such as the poor segmentation effect in the case of high similarity between foreground and background, the inability of rectangular frame in foreground area to achieve adaptive segmentation, and the poor segmentation effect in edge thinning.
Maize is the main crop in Northeast China, whose main diseases and pests have distinct characteristics with distinct differences in color, location and shape. Therefore, the image of three major diseases and pests of maize is selected as the research sample to segment the image and extract the effective information. The three major diseases and insect pests of maize are maize smut, maize head smut and maize rust. Maize smut is mainly caused by the formation of nodules with different shapes and sizes in stem nodes, ears and tassels. The nodules begin to be surrounded by white membrane and then grow black inside rapidly. After the rupture of the outer membrane of the nodules, a large amount of black powder falls on the ground and other maize plants. The symptoms of maize head smut are most obvious at ear stage. Some florets in tassel suffer from enlargement at the base and form fungous gall. Black powder is released after the outer white membrane breaks down. Especially in late ear stage, the residual vascular bundles of the diseased ear can be seen, so it is called head smut, which is different from maize smut. Corn rust mainly infects the leaves of maize, and the sheath, bracts and tassels can also be damaged in severe cases. In the early stage, yellow-brown uredinium are scattered on both sides of leaves, but in the late stage of maize rust, brown teleutosorus are produced on the diseased parts.
Methodology
Improvement of grab cut algorithm
Different from other gray value methods in image segmentation, Grab cut is an interactive segmentation algorithm based on the improved Graph cuts algorithm, which has high efficiency and good effect, characterized by less computation and less workload. It mainly describes the distribution of the foreground and background pixels of the image using the Gauss Mixture Model (GMM), and calculates the parameters of the model by iteration method. At the same time, incomplete marking method is used [4].
Based on Grab Cut hard segmentation algorithm, three improvements on the basis of Graph cuts are made in this paper: Firstly, the histogram is replaced by the Gaussian Mix Model (GMM) to extend the gray image to the color image. Secondly, energy minimization is achieved by replacing a minimum estimate with an iterative algorithm that can be evolved in the process of estimation and parameter learning. Thirdly, the requirement of interactive work is reduced by incomplete numbering.
Gaussian model
Gauss mixture model (GMM) has good robustness to the estimation of color channel, so Grab cut transforms the segmentation problem into the problem of calculating the opacity of each pixel through GMMS estimation of color channel model. Represent the image as z = (z1, z2,... Zn, that is
Where, α (α1, α2 . . . , αx), αn∈0,1 denotes the opacity of a pixel, and the αn value of 0 of a pixel denotes that it belongs to the background and the value of 1 denotes that it belongs to the foreground, so segmentation is the set of the transparency of a pixel. In addition, Grab Cut has two GMMs, which correspond to the foreground and background respectively. Each GMM is a mixture of H-Gaussian models (usually H = 5), and each pixel has a parameter hn∈ (h1, . . . , hH), which represents the number of Gaussian function of each pixel in the GMM. Usually, the Gibbs energy function of Grab Cut is:
Where, data item U is defined as:
Where, D {αn, hn, θ n , z n } = - logp (z n , α n , h n , θ) - log π (α n , h n ), and p (·) is a Gaussian Probability Distribution, π (·) is a mixed weight coefficient.
In this case, the Gauss parameter model is:
Its parameters correspond to the weight π, mean μ and covariance ∑ of the h-th Gaussian model, respectively. The smoothing term V can be calculated by Euclidean distance in RGB space:
One-Cut algorithm has led the world in both segmentation accuracy and related technical achievements, but it still has some shortcomings and deficiencies, such as poor color processing, low information utilization and extraction rate, unreasonable network graph structure, complex data and image processing, single weight of image and information processing [5], which are often caused by the relatively low segmentation accuracy and efficiency of processing nodes. Therefore, the processing of the algorithm solving process and the construction and optimization of network graph are the urgent problems to be solved in the process of improving the segmentation accuracy and efficiency, which have very important practical significance.
The problem of low efficiency and accuracy in image segmentation process can be solved by improving the overlapped penalty items. In the process of image processing, the superposition effect of gray histogram can be optimized by using corresponding acceleration technology, which can also improve the optimization of network composition. Achieving optimal processing of superposition effects and better improvement of network composition can improve accuracy and efficiency.
θ1 and θ0 are used to represent the foreground target area and background part. If I is used to represent the segmented image, the probability that the I
p
pixel belongs to the category S
p
is Pr(I
p
|θ
S
p
), and the active appearance model is shown in formula (6).
Where, Ω is the set of all the pixels in the image;S p is the binary indicator variable of the labeled segmentation result M is a set of edges between all adjacent pixels in an image.
When the appearance model θ1 and θ0 are represented by the color histogram, the minimum solution of formula (6) is equivalent to the minimum solution of the energy term E(S) containing only S. The energy termE(S) is shown in formula (7):
Where, θ
s
and
The length of the edge of the network graph after processing the data with the algorithm is selected as 1, and the length of the path and the number of nodes and edges are relatively small, which reduces the complexity of the network graph. At the same time, the maximum flow and the minimum cut algorithm are used to process the approximation value, so that the network graph can be solved more accurately. Meanwhile, through the organic combination of Grab Cut algorithm and One-Cut algorithm, it further improves the solution of the appearance overlapped penalty terms, and optimizes the network graph structure. In the process of image processing, the running time and processing efficiency have also been greatly improved. By optimizing the node, the unnecessary redundancy calculation has been reduced to a certain extent, so as to improve the efficiency of segmentation and processing.
In the meantime, it is difficult to accurately segment the foreground object only by color and edge information for the image with relatively serious overlapping between the foreground object and the background color region [6]. Accurate segmentation of such images also requires effective information such as texture and structural characteristics.
In SLIC method, super-pixels are used instead of pixels to generate saliency maps with the clues of super-pixels above, below, left and right edges respectively, and then the saliency map is used as the clue to generate the final saliency map. Firstly, a single-layer graph G = (V, E) is constructed, where V is the node and E is the undirected edge. The weight between the two nodes is defined as:
Where, c
i
and c
j
represent the color values of the two nodes and σ is the weight coefficient. Based on the nodes on the boundary, a sorting function is used to sort the super-pixels of the whole graph. The sorting formula is as follows:
Where f is the sorting function, each super-pixel block corresponds to a sorting value f i ; q is an indicator vector. q i denotes the i-th super-pixel as the basis, q i denotes the i-th super-pixel as the state to be sorted; W corresponds to the weight matrix between super-pixels; β is the coefficient of matrix W; D is the metric matrix of graph G, D = diag{ d11, ⋯ , d nn }, where d ii = ∑ j w ij .
Based on the super-pixels on the upper side of the image, saliency map S
t
is obtained by sorting other super-pixels.
The latter term in formula (11) is a normalized vector. Similarly, the formula is used to calculate the saliency maps S
b
, S
l
and S
r
on the other three sides to integrate the four salient graphs to get the saliency mapof the first step.
Based on the average salience value of the saliency map in the first step, the saliency map is divided into a binary image by threshold segmentation, and the final saliency map is obtained by the same method according to the image center.
After the saliency map is obtained, the binary image is usually segmented by a given threshold, and then the rectangle used to initialize Grab cut is determined.
Where, Num is the actual number of super-pixels and S (i) is the salience value of the i-th super-pixel. Assuming that the salience value is greater than T in the foreground, it is reset to 1, and reset to 0 in the background less than T. The pixels are scanned from top to bottom, and the initial rectangle of Grab cut is obtained by marking the first non-zero pixel.
For the depth processing and feature extraction of the foreground target area, the algorithm in this paper guides the fusion depth of depth information by choosing rectangle, and improves the energy function to improve the fusion efficiency and segmentation accuracy. Figure 1 shows simple process of face detection. After image input, the first is to extract facial features, which is a key step of the testing process that concerns face detector configuration. Face detector is to judge where is face in the image. Its output results are generally not unique, there will be overlaps, so integration of result needs to be set up to integrate and process output result of the detector, thus making face detection results more accurate.

Simple process of face detection.

Output of foreground target area.

Flowchart of image segmentation algorithm based on pre-detection.

Output of image segmentation.
Firstly, the initial rectangle is selected by popular sorting algorithm. The closer the pixels and gray levels are, the closer the depth is, but the relationship between depth and saliency is non-linear, and the location of the foreground target area may be different, hence SLIC preprocessing should be performed to segment the corresponding super-pixel region before choosing the rectangle, and then the next step is processed by the average of the depth information of the region as a whole.
Generally, there are two methods to fuse depth information: the fourth channel method with GMM input and the fixed weight fusion method. However, the integration of depth information has not been well processed, and the effect and efficiency have not been improved. On the contrary, it increases the computational complexity and complexity of the algorithm. In this paper, the similarity between data items and smoothing items is improved by pixels, and data items are segmented by color and infused information average, in which the infused information average is taken as the main determinant, while smoothing items are segmented by calculated iteration parameters to better handle the weight of edges, and then to carry out max-flow or min-cut.
From the example of image segmentation by Grab cut algorithm, it is found that the distinction between background and foreground is very obvious, but there are also some problems, such as the poor segmentation effect in the case of high similarity between foreground and background, the inability of adaptive acquisition of rectangle in foreground area, and the poor segmentation effect in edge thinning. Extraction of Rectangle, To simplify the calculation, maximize the posterior probability P (S|D):
The following form is used to estimate the depth priori map:
Where, d (i) is the depth mean of the i-th super-pixel. This formula is generally suitable for posterior distribution, with only a small deviation at a relatively close distance.
After processing the depth map, the normalized depth information is used to guide the saliency of the next calculation:
Where, S sd (i) is the information after combining depth and saliency of the i-th super-pixel. Grab cut rectangle can be obtained by substituting S sd (i) into (14).
The final energy formula is:
SLIC is used to segment and construct a single-layer graph. The salience values are obtained by popular sorting algorithm. Super-pixel segmentation is carried out on the depth map obtained in the previous step and its corresponding original image. Formulas (13) and (14) are used to process salience and deep information, and the initial Grab cut algorithm is obtained. The original graph of Grab cut is constructed and initialized on the basis of (2). The rectangle is selected, and the background area Tb is set outside rectangle, and the unknown area Tc is set inside the rectangle. If the foreground target area is empty, GMM parameters are calculated: mean u(x, h), covariance(a, h) and weight r(a, h) of the k-th Gaussian model. The weights of the original edges are calculated by formula (18) and the max-flow/min-cut is performed. The convergence of energy function is judged, if not, the GMM parameters will be recalculated and returned to (4); if it converges, the next step will be taken. Max-flow/min-cut is performed in pixels.
Comparison of segmentation accuracy
Comparison of segmentation accuracy
Experimental results and analysis
The main object of this study is to extract the effective information of three major maize diseases and pests by taking maize plant as unit, collecting experimental data as original image and segmenting the image [7]. In this experiment, the corresponding experimental images of the root, stem and leaf of maize plant were mainly collected, which were divided into many classes, for example, whether there were diseases and pests, the size of speckles and disease part, and whether the location of speckles and disease part was on the edge or not. More than ten images were selected for detection and analysis. Firstly, gray-scale processing and gray-scale histogram were carried out, irrelevant background was removed and corresponding threshold segmentation was carried out, and the central area of the disease was selected accurately to highlight the target area, so as to calculate the degree of plant diseases and insect pests in the final. The root, stem and leaf of maize were the main experimental references. The average damage degree of maize leaves was 7.131%, 3.669% and 12.012% respectively. As for the absence rate of disease-free and incompletely recognizable images below 1 point, they were 0.898%, 0.229% and 0.915% respectively, which can more intuitively reflect the difference between different sample images through the improved Grab cut algorithm described in this paper, and can well highlight and reflect the degree of damage to crop leaves, and can effectively control the situation of pests and diseases and the dosage of pesticides, so as to avoid unnecessary waste and environmental pollution, providing a scientific basis for the quality inspection of crop diseases and pests in the future.
Experimental conditions and procedures
Taking maize plant as a unit, the experimental data were collected as the original image, and the images were segmented to extract the effective information of three major maize diseases and pests. In this experiment, the corresponding experimental images of the root, stem and leaf of maize plant were mainly collected, which were divided into many classes, for example, whether there were diseases and pests, the size of speckles and disease part, and whether the location of speckles and disease part was on the edge or not. More than ten images were selected for detection and analysis.
After sample collection, the gray processing of the collected image was carried out first. For the initial center of image selection, a fuzzy clustering method was used to classify the i value of the peak area by histogram after gray processing, and then Ada boost monitoring was carried out. Preliminary localization was carried out for the presence or absence of disease in the gray-scale image after processing. Threshold segmentation was performed for the image with disease information at first. Whether or not there is disease information in the leaf image, edge detection is necessary. Then, the original center of image processing was accurately located by precisely repositioning the image with disease. Finally, the minimum iteration was performed by the Grab cut algorithm of Gaussian iteration to output the results [8].
Experimental results
In this paper, a new interactive object segmentation method is studied. By optimizing the Grab Cut algorithm, the image blurring, pixel overlap and ambiguous edge segmentation at the edge of the object are all superior to other related image processing techniques such as Gauss iteration algorithm and edge processing. At the same time, it can get a very satisfactory segmentation effect in the relatively less processed interactive work. Nowadays, with the rapid development and maturity of computer technology and image segmentation technology, the research and application of image processing are more and more extensive, and the prospect of simpler and more efficient extraction algorithm has a broader application prospect [9–14].
Comparisons of recognition rates of four algorithms
Comparisons of recognition rates of four algorithms
Grab Cut algorithm is a relatively mature and excellent interactive image segmentation algorithm nowadays. It has relatively simple operation in interaction, relatively few machine languages and processing steps, and has a very high segmentation accuracy. Its application in image segmentation nowadays is in good agreement with most of the requirements of target extraction for roots, stems and leaves of maize plants in this paper. At the same time, after some improvements and extensions are made, it is a relatively good one among many image-based segmentation technologies. Therefore, the research of Grab Cut algorithm is of great theoretical and practical significance. In the future, it is of great practical significance for the processing and segmentation speed of the algorithm, as well as for the expansion and involvement in other fields.
Maize is the main crop in Northeast China, whose main diseases and pests have distinct characteristics with distinct differences in color, location and shape. Therefore, the image of three major diseases and pests of maize is selected as the research sample to segment the image and extract the effective information. The three major diseases and insect pests of maize are maize smut, maize head smut and maize rust [10]. Maize smut is mainly caused by the formation of nodules with different shapes and sizes in stem nodes, ears and tassels. In this paper, the image of the disease part of maize plant is mainly processed, and a variety of image segmentation methods are used to preprocess the image to achieve better results, and the improved and optimized Grab Cut algorithm is employed for the corresponding interactive processing to achieve better image segmentation effect [11–13].
Nowadays, there are many researches and explorations on crop diseases and pests processing and segmentation algorithms in image processing. The combination and application of image segmentation methods such as fuzzy clustering, artificial neural network and so on are also rising gradually. But in agriculture and practical application, not only the quality of image segmentation but also the characteristics of various image segmentation methods and specific combination methods should be taken into account. It cannot depend on the subjective judgment of the relevant technicians alone, which will bring some inconvenience to the application of image segmentation methods and the promotion of the related methods of image segmentation. In this paper, taking corn as an example, image segmentation and preprocessing are carried out for the collected images of corn diseases and insect pests. The main methods of image segmentation are edge detection, fuzzy clustering and accurate repositioning, and the theoretical characteristics of these methods are introduced. Firstly, the extracted image was grayed and the gray histogram was drawn. Then, the peak region was extracted and the initial center position was selected and calibrated by using the method of fuzzy clustering and precise repositioning. Next, a better threshold segmentation of image was carried out based on edge detection. Finally, the improved Grab cut algorithm was used for energy minimization iterative segmentation to compare the output of the data. The image background in static image editing was replaced by an improved One-Cut algorithm. The Grab cut rectangle was extracted with salience graph guided by depth information. Depth and salience information were combined into Grab cut color model through adaptive combination of weights, so as to improve the segmentation accuracy, obtain good segmentation effect and obtain effective information [14–19]. It provides a basis for the actual selection of image segmentation methods for crop disease images and has a certain reference value [20–22].
Conclusion
The combination of Grab Cut algorithm and One-Cut algorithm is used to improve the problem of low segmentation efficiency and accuracy in Grab Cut algorithm. Under the environment based on the former framework algorithm, the latter One-Cut algorithm is improved accordingly, and the gray histogram generated by image preprocessing is processed by acceleration technology. By improving the apparent overlapping penalty items, the segmentation efficiency and accuracy are improved better. At the same time, the advantages of Grab Cut iterative Gaussian summation algorithm and the unified segmentation method of set fuzzy clustering and mathematical morphology are utilized to solve the problem of poor segmentation when the foreground and background in Grab Cut have high similarity, and the rectangle containing foreground region is acquired adaptively, which reduces the manual interaction and achieves the automatic batch operation of image segmentation. In the final test, the new improved algorithm is proved effective and suitable for the retrieval system of massive images when identifying crop diseases and pests.
Nowadays, there are many researches and explorations on segmentation algorithms in image processing. The combination and application of image segmentation methods such as fuzzy clustering, artificial neural network and so on are also rising gradually. But in agriculture and practical application, not only the quality of image segmentation but also the characteristics of various image segmentation methods and specific combination methods should be taken into account. It cannot depend on the subjective judgment of the relevant technicians alone, which will bring some inconvenience to the application of image segmentation methods and the promotion of the related methods of image segmentation. In this paper, the theoretical characteristics of image segmentation methods such as edge detection, fuzzy clustering and accurate repositioning are introduced. Firstly, the extracted image is grayed and the gray histogram is drawn. The peak region is extracted and the initial center position is selected and calibrated by using the method of fuzzy clustering and precise repositioning. Combining the edge detection method, the image is segmented by a better threshold. Finally, the Grab cut algorithm is used for energy minimization iterative segmentation to compare the output of the data, which provides a basis for the actual selection of image segmentation methods for crop disease images and has a certain reference value.
Both Grab Cut algorithm and One-Cut algorithm only use the edge information and color information between adjacent pixels. If the distance information of image pixel cutting can be effectively excavated and utilized, and the super-pixel segmentation can be more reasonably combined, the segmentation efficiency or accuracy of the algorithm will be further improved. Therefore, the research of Grab Cut algorithm is of great theoretical and practical significance. In the future, it is of great practical significance for the processing and segmentation speed of the algorithm, as well as for the expansion and involvement in other fields. Image segmentation algorithm based on pre-detection was proposed, algorithm was improved based on classical algorithm Crab cut, and original manual operation was replaced by location box automatically generated by algorithm. In this paper, algorithms were described in detail, experiments were done on 1500 images, and the experiment results were verified with the two authoritative assessment criteria of recall ration and precision ratio. The results show that although it falls behind classical algorithm in accuracy, its time efficiency is greatly improved, and image batch processing can be basically realized.
Footnotes
Acknowledgments
The research was supported by Jilin Province Education Department Research Project “Research on Key Technologies of Early Monitoring of Agricultural Pests and Diseases Based on High Precision Sensor Recognition Processing” (JJKH20180650KJ).
