Field rice image automatic segmentation method based on generative adversarial network

The improved CycleGan cycle generative adversarial network is used to perform illumination style conversion on rice images, which solves the problem of rice image segmentation under different lighting conditions, achieves efficient and accurate rice leaf surface extraction and segmentation, and reduces the cost of manual annotation.

CN118628743APending Publication Date: 2024-09-10SOUTH CHINA AGRICULTURAL UNIVERSITY +1

Patent Information

Application Number
CN202410795257.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In the existing technology, rice image segmentation has problems such as the difficulty in segmenting the exposure area and the high cost of manual labeling of thin-leaf rice. Especially under different lighting conditions, the illumination changes in the image and the small proportion of rice leaves increase the difficulty of segmentation.

Method used

An automatic segmentation method for field rice images based on a generative adversarial network is adopted. The exposure style image blocks are processed through an improved CycleGan cyclic generative adversarial network, converted into warm and light style image blocks, and the binary image blocks are used for reverse splicing. Achieve accurate segmentation of rice.

Benefits of technology

It effectively solves the problem of difficult segmentation of rice in exposed areas, improves the accuracy and efficiency of segmentation, maintains the clarity of detailed information on rice leaves, and reduces manual labeling costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628743A
    Figure CN118628743A
Patent Text Reader

Abstract

The invention discloses an automatic segmentation method for a field rice image based on a generative adversarial network, which belongs to the field of image processing and comprises the following steps of: partitioning original field rice images Img acquired under different illumination conditions, and numbering and classifying styles of image blocks; processing the image blocks of the exposure style under different hues by adopting an improved CyclGan cyclic generative adversarial network, and converting the image blocks of the exposure style into image blocks of a temperature and light style; carrying out segmentation processing on the converted image blocks to obtain an image block binary image; and according to the number of the binary image of the image block, performing reverse splicing synthesis processing in sequence to obtain a segmentation result of the original image Img of the field rice. According to the method, the manual marking cost is reduced, the rice leaf surface detail information and definition are better maintained, and the problem that the rice in the exposure area in the original image is difficult to segment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an automatic segmentation method for field rice images based on a generative adversarial network. Background Art

[0002] At present, the research on rice growth monitoring is of great significance to rice production. However, the manual observation method of rice growth monitoring is time-consuming, labor-intensive, subjective, error-prone and discontinuous, which makes it difficult to meet the needs of agricultural modernization. In order to reduce labor costs, improve the accuracy and real-time nature of records, and avoid damage to plants and the environment, it is urgent to study the automatic monitoring technology of rice growth. In the process of automatic monitoring of rice growth, it is often necessary to accurately extract the rice leaves in the image from the background, and then further process and analyze them to obtain the growth and development information of rice. Therefore, rice image segmentation processing is an important part of its automatic monitoring technology.

[0003] The research on crop image segmentation technology mainly includes threshold segmentation, cluster segmentation, edge segmentation and other methods based on visual features such as color, texture, shape, and segmentation methods based on deep learning. However, the above-mentioned traditional image segmentation methods based on visual features are not universal, and they also require prior domain knowledge to guide the manual setting of feature parameters. Compared with traditional image segmentation methods based on visual features, image segmentation methods based on deep learning can automatically learn appropriate feature representations for specific objects. However, a good deep learning segmentation model often requires a large number of sample inputs to learn the features contained in the image well, and the processing process is a supervised learning process, which means that each pixel of these input sample images requires true value annotation. This is not friendly to the image segmentation of fine-leaf rice. For example, the rice leaves in each image of the transplanting and tillering period are small and thin, making manual annotation extremely time-consuming and labor-intensive. In addition, the proportion of rice leaves in the image is too small, which also increases the difficulty of the model learning process.

[0004] Since rice images are automatically acquired through cameras outdoors in the field, the lighting conditions of rice images are relatively complex. On the one hand, the reflection of the water surface increases the exposure of the rice image, making it difficult to show the rice details in the highlight part of the image; on the other hand, different light intensities and outdoor camera parameters, such as automatic white balance settings, make the fluctuation range of daylight color temperature relatively large, resulting in changes in the color tone of rice images. These factors have brought challenges to the accurate segmentation of field rice images. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides an automatic segmentation method for field rice images based on a generative adversarial network, which solves the problems of difficulty in segmenting rice in the exposed area of ​​the captured image and high cost of manual labeling of fine-leaf rice.

[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0007] This scheme provides a method for automatic segmentation of field rice images based on a generative adversarial network, comprising the following steps:

[0008] S1, dividing the original image Img of rice in the field collected under different lighting conditions into blocks, and numbering and style classification of the image blocks;

[0009] S2. Using the improved CycleGan cycle generative adversarial network, the exposure style image blocks are processed in different tones, and the exposure style image blocks are converted into warm light style image blocks;

[0010] S3, segmenting the converted image block to obtain a binary image of the image block;

[0011] S4. According to the serial numbers of the binary images of the image blocks, reverse splicing and synthesis processing is performed in sequence to obtain the segmentation result of the original image Img of the rice in the field.

[0012] Beneficial effects of the present invention: The present invention adopts an improved CycleGan generative adversarial network to process image blocks, which is an unsupervised processing method. It can better convert the exposed image blocks into warm light image blocks, and effectively and accurately extract rice from the converted image blocks, which to a certain extent solves the problem that rice in the exposed area of ​​the original image is difficult to segment. The illumination transformation results of the improved CycleGan generative adversarial network for exposure image blocks of different tones can better maintain the detail information and clarity of the rice leaf surface.

[0013] Furthermore, the S1 specifically includes the following steps:

[0014] S11, inputting an original image Img of rice in the field with a collection size of M×N pixels, and dividing the original image Img of rice in the field into n equal blocks; wherein n is the number of equal blocks, M is the image width, and N is the image height;

[0015] S12, sequentially numbering the image blocks to obtain numbered image blocks of size M'×N' pixels, and performing style classification on the numbered image blocks; wherein M' is the width of the numbered image blocks, and N' is the height of the numbered image blocks;

[0016] The beneficial effect of the above further scheme is that by dividing the original field rice image Img into blocks, when processing high-resolution or large-size images, the block processing can significantly reduce the consumption of computing resources, improve processing efficiency, flexibility and accuracy, and enhance the versatility and portability of the algorithm.

[0017] Furthermore, the S2 specifically includes the following steps:

[0018] S21, based on the corresponding generator G, discriminator D Y , and the corresponding generator F and discriminator D X The adversarial process uses the following formula to generate the adversarial loss function:

[0019] L GAN (G,D Y , X, Y) = E y~pdata(y) [logD Y (y)]+E x~pdata(x) [log(1-D Y (F(x))]

[0020] L GAN (G,D X , X, Y) = E x~pdata(x) [logD X (x)]+E y~pdata(y) [log(1-D X (G(y))]

[0021] Among them, L GAN is the adversarial loss function, X and Y are both image domains, G and F are both generators, and D X , D Y All are discriminators, x is a sample in the X image domain, y is a sample in the Y image domain, G(x) is an image x in the X domain generated by an image y in the Y domain, F(x) is an image y in the Y domain generated by an image x in the X domain, E x~pdata(x) is the data distribution of image set x, E y~pdata(y) is the data distribution of image set y;

[0022] S23. Calculate the cycle-consistent loss function:

[0023] L cyc (G,F,X,Y)=E x~pdata(x) [||G(F(x))-x||1]+E y~pdata(y) [||F(G(y))-y||1]

[0024] Among them, L cyc is the cycle consistent loss function;

[0025] S24. Based on the generated adversarial loss function and the cycle-consistent loss function, the objective function of the original CycleGan cycle-generated adversarial network is calculated using the following formula:

[0026] L=L GAN (G,D Y ,X,Y)+LGAN (F,D X ,X,Y)+λL cyc (G,F,X,Y)

[0027] Among them, λ is the adjustment weight of the two cycle losses in the objective loss function;

[0028] S25. Introduce perceptual loss function:

[0029]

[0030] Among them, L p is the perceptual loss function, W is the width of the image, H is the height, and D is the depth of the extracted features. represents the feature extraction function;

[0031] S26. According to the original CycleGan cycle generation adversarial network and the perception loss function, the following formula is used to obtain a new target loss function of the improved CycleGan cycle generation adversarial network, and the construction of the improved CycleGan cycle generation adversarial network is completed;

[0032] L'=L GAN (G,D Y ,X,Y)+L GAN (F,D X ,X,Y)+αL cyc (G,F,X,Y)+βL p (G,F)

[0033] Among them, L' is the new target loss function, α is the adjustment weight of the cycle consistent loss function in the target loss function, and β is the adjustment weight of the perceptual loss function in the target loss function;

[0034] S27, using the improved CycleGan cycle generative adversarial network to process the exposure style image blocks in different tones;

[0035] S28. Using the improved CycleGan cycle generative adversarial network, the processed exposure-style image blocks are converted into warm-light-style image blocks.

[0036] The beneficial effect of the above further scheme is that the loss function of the original CycleGan cyclic generative adversarial network includes two adversarial loss functions and two cyclic loss functions. The present invention introduces a perceptual loss function into the target loss function of the original CycleGan cyclic generative adversarial network, which can capture both the texture information of the image and the object-level style, making the generated image closer to the real image and preventing the generated image from being blurred and losing details.

[0037] Furthermore, the process of processing the exposure style image block in different tones in S27 is as follows:

[0038] S271, inputting the negative sample image image_x into the generator G, and the generator G outputs the generated image Fake_y; wherein the negative sample image image_x is an image block of the exposure style;

[0039] S272, input the positive sample image image_y and the generated image Fake_y into the discriminator D Y In the output, the discriminant label is 1, the image with the discriminant label is the positive sample image image_y, and the image with the discriminant label is 0, the generated image Fake_y; among them, the positive sample image image_y is the image block of the warm light style;

[0040] S273, inputting the positive sample image image_y into the generator F, and the generator F outputs the generated image Fake_x;

[0041] S274, input the negative sample image image_x and the generated image Fake_x into the discriminator D X In the output, the discriminant label is 1, the image with the discriminant label is the negative sample image image_x, and the image with the discriminant label is 0, the generated image Fake_x;

[0042] S275, judgment discriminator D Y Can the generated image Fake_y and the positive sample image image_y be distinguished? If so, return to S21. Otherwise, when the difference between the generated image Fake_y and the positive sample image image_y is the smallest, the discriminator model D Y When the generated image Fake_y and the positive sample image image_y cannot be correctly distinguished, the processing ends.

[0043] The beneficial effect of the above further scheme is: using the improved CycleGan cycle generative adversarial network to process the image blocks of the exposure style under different image tones respectively, and its processing accuracy has an important influence on the segmentation result.

[0044] Furthermore, the S4 specifically includes the following steps:

[0045] S41, extracting the original image name Img and the digital sequence number from the number according to the number of the binary image of the image block;

[0046] S42, performing reverse stitching and synthesis processing on the image blocks in numerical order to obtain a segmentation result of the original image Img of the rice field.

[0047] The beneficial effect of the above further scheme is that by extracting the image block numbers and performing reverse stitching in the order of digital labels, the consistency of the processing flow, the accuracy of the segmentation results and the improvement of processing efficiency are ensured, while the scalability and versatility of the algorithm are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of a method for automatic segmentation of field rice images based on a generative adversarial network of the present invention;

[0049] Figure 2 It is the camera deployment scheme of the present invention;

[0050] Figure 3 is an example of a portion of image blocks of a rice image collected under different illumination conditions of the present invention;

[0051] Figure 4 This is the rice image block segmentation effect of different styles of the present invention;

[0052] Figure 5 It is a flow chart of the automatic segmentation algorithm of rice image of the present invention;

[0053] Figure 6 It is a schematic diagram of the processing process of the improved CycleGan cyclic generative adversarial network of the present invention;

[0054] Figure 7 It is a structural diagram of the generator in the improved CycleGan cyclic generative adversarial network of the present invention;

[0055] Figure 8 This is a structural diagram of the discriminator in the improved CycleGan cyclic generative adversarial network of the present invention. DETAILED DESCRIPTION

[0056] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0057] Example

[0058] like Figure 1 As shown, the present invention provides a method for automatic segmentation of field rice images based on a generative adversarial network, comprising the following steps:

[0059] S1, dividing the original image Img of rice in the field collected under different lighting conditions into blocks, and numbering and style classification of the image blocks;

[0060] S2. Using the improved CycleGan cycle generative adversarial network, the exposure style image blocks are processed in different tones, and the exposure style image blocks are converted into warm light style image blocks;

[0061] In this embodiment, the field rice image Img collected under different lighting conditions is processed by block processing, mainly including two lighting image styles, and each lighting style has three image tones. The improved CycleGan cycle generative adversarial network is used to process the exposure style image blocks under different image tones (such as tone 1, tone 2 and tone 3) and convert them into warm light style image blocks, so as to accurately segment the rice. Different image tones are processed separately.

[0062] S3, segmenting the converted image block to obtain a binary image of the image block;

[0063] In this embodiment, the Ostu adaptive threshold segmentation method is used to segment the converted image blocks, wherein the Ostu adaptive threshold segmentation method is a prior art.

[0064] S4. According to the serial numbers of the binary images of the image blocks, reverse splicing and synthesis processing is performed in sequence to obtain the segmentation result of the original image Img of the rice in the field.

[0065] The S1 specifically includes the following steps:

[0066] S11, inputting an original image Img of rice in the field with a collection size of M×N pixels, and dividing the original image Img of rice in the field into n equal blocks; wherein n is the number of equal blocks, M is the image width, and N is the image height;

[0067] S12, sequentially numbering the image blocks to obtain numbered image blocks of size M'×N' pixels, and performing style classification on the numbered image blocks; wherein M' is the width of the numbered image blocks, and N' is the height of the numbered image blocks;

[0068] In this embodiment, a series of collected field rice original images Img with a size of 1280×720 pixels are input, and each field rice original image Img is divided into 32 equal parts using an image batch blocking algorithm, and the image blocks are numbered according to certain rules (such as Img_1, Img_2, ..., Img_32), to obtain numbered image blocks with a size of 160×180 pixels, and the styles of the image blocks are summarized and classified; wherein, the image batch blocking algorithm is a prior art.

[0069] The S2 specifically includes the following steps:

[0070] S21, based on the corresponding generator G, discriminator DY , and the corresponding generator F and discriminator D X The adversarial process uses the following formula to generate the adversarial loss function:

[0071]

[0072]

[0073] Among them, L GAN is the adversarial loss function, X and Y are both image domains, G and F are both generators, and D X , D Y All are discriminators, x is a sample in the X image domain, y is a sample in the Y image domain, G(x) is an image x in the X domain that is input to generate an image y in the Y domain, and F(x) is an image y in the Y domain that is input to generate an image x in the X domain. is the data distribution of the image set x, is the data distribution of image set y;

[0074] S23. Calculate the cycle-consistent loss function:

[0075]

[0076] Among them, L cyc is the cycle consistent loss function;

[0077] S24. Based on the generated adversarial loss function and the cycle-consistent loss function, the objective function of the original CycleGan cycle-generated adversarial network is calculated using the following formula:

[0078] L=L GAN (G,D Y ,X,Y)+L GAN (F,D X ,X,Y)+λL cyc (G,F,X,Y)

[0079] Among them, λ is the adjustment weight of the two cycle losses in the objective loss function;

[0080] S25. Introduce perceptual loss function:

[0081]

[0082] Among them, L p is the perceptual loss function, W is the width of the image, H is the height, and D is the depth of the extracted features. represents the feature extraction function;

[0083] S26. According to the original CycleGan cycle generation adversarial network and the perception loss function, the following formula is used to obtain a new target loss function of the improved CycleGan cycle generation adversarial network, and the construction of the improved CycleGan cycle generation adversarial network is completed;

[0084] L'=L GAN (G,D Y ,X,Y)+L GAN (F,D X ,X,Y)+αL cyc (G,F,X,Y)+βL p (G,F)

[0085] Among them, L' is the new target loss function, α is the adjustment weight of the cycle consistent loss function in the target loss function, and β is the adjustment weight of the perceptual loss function in the target loss function;

[0086] S27, using the improved CycleGan cycle generative adversarial network to process the exposure style image blocks in different tones;

[0087] S28. Using the improved CycleGan cycle generative adversarial network, the processed exposure-style image blocks are converted into warm-light-style image blocks.

[0088] In this embodiment, the original CycleGan cyclic generative adversarial network is the existing technology, and the improved CycleGan cyclic generative adversarial network has the same structure as the original CycleGan cyclic generative adversarial network, except that a perceptual loss function is introduced to improve the calculation method of the original loss function, so that the generated image of the processing result is closer to the real image.

[0089] The process of processing the exposure style image block in different tones in S27 is as follows:

[0090] S271, inputting the negative sample image image_x into the generator G, and the generator G outputs the generated image Fake_y; wherein the negative sample image image_x is an image block of the exposure style;

[0091] S272, input the positive sample image image_y and the generated image Fake_y into the discriminator D Y In the output, the discriminant label is 1, the image with the discriminant label is the positive sample image image_y, and the image with the discriminant label is 0, the generated image Fake_y; among them, the positive sample image image_y is the image block of the warm light style;

[0092] S273, inputting the positive sample image image_y into the generator F, and the generator F outputs the generated image Fake_x;

[0093] S274, input the negative sample image image_x and the generated image Fake_x into the discriminator D X In the output, the discriminant label is 1, the image with the discriminant label is the negative sample image image_x, and the image with the discriminant label is 0, the generated image Fake_x;

[0094] S275, judgment discriminator D Y Can the generated image Fake_y and the positive sample image image_y be distinguished? If so, return to S21. Otherwise, when the difference between the generated image Fake_y and the positive sample image image_y is the smallest, the discriminator model D Y When the generated image Fake_y and the positive sample image image_y cannot be correctly distinguished, the processing ends.

[0095] In this embodiment, the collected field rice original image Img may be divided into image blocks of different tones and different illumination styles. Before using the improved CycleGan cyclic generative adversarial network for testing, a new classifier, called the tone classification model, needs to be pre-trained to discriminate the tone of the input field rice original image Img. First, separate the field rice original images Img of different tones, and then collect the image blocks of different tones into exposure styles. X Classified into the negative sample image set X domain corresponding to the improved CycleGan cycle generative adversarial network, the mild lighting style image blocks in the different tones image set are passed through the discriminator D Y Classify into the positive sample image set Y domain corresponding to the improved CycleGan cycle generative adversarial network.

[0096] The S4 specifically comprises the following steps:

[0097] S41, extracting the original image name Img and the digital sequence number from the number according to the number of the binary image of the image block;

[0098] S42, performing reverse stitching and synthesis processing on the image blocks in numerical order to obtain a segmentation result of the original image Img of the rice field.

[0099] In this embodiment, according to the numbering of the binary image of the segmented image block, the original image name (such as Img) and the digital label (1, 2, ..., 32) in the numbering are extracted respectively, and the image blocks are reversely spliced ​​and merged in the order of the digital labels to obtain the final segmentation result of the original image Img.

[0100] like Figure 2As shown, Jinnong Silk Rice is planted in a square field of about 40m×40m, with 2 to 3 seedlings in each hole and a hole spacing of about 15-18cm. The experiment uses four identical cameras arranged in the four corners of the field to monitor rice. The camera uses Hikvision DS-2DC7423IW-A series smart ball camera, fixed at a height of 2.5m from the ground, and the lens field of view is the same. Due to the outdoor conditions, the lighting conditions for shooting images are more complicated. On the one hand, the reflection of the water surface increases the exposure of the captured image (the overall image is whitish, the highlight level of the bright part is lost, and the details of the rice are lost); on the other hand, different light intensities and outdoor camera parameters (such as white balance) are automatically set, which makes the fluctuation range of daylight color temperature relatively large, resulting in changes in the color tone of the captured image. As shown Figure 3 As shown, some image blocks of rice images collected under different lighting conditions are shown. It can be seen that the image hue and the color of rice taken under different lighting conditions (exposure and temperature) vary greatly.

[0101] like Figure 3 As shown in the figure, there are two types of image styles under two lighting styles, and each lighting style has three image tones. The original field rice image Img of the above styles is segmented by a color-based threshold segmentation algorithm. It is found that under different image tones, the segmentation effect of the warm light image is much better than that of the exposed image. The segmentation effect is shown in the figure. Figure 4 Therefore, the present invention considers using an improved CycleGan cycle generative adversarial network to convert the lighting style of rice under different image tones, so as to uniformly convert the exposure style into the warm light style, so as to accurately segment the rice.

[0102] like Figure 5 As shown, the present invention proposes an automatic segmentation method for field rice images based on a generative adversarial network, and the overall technical flow chart of the method mainly includes four stages: image segmentation, illumination transformation, image block segmentation, and image synthesis. Input the original image Img of field rice, perform block processing on the original image Img of field rice, process the image blocks of exposure style under different tones, convert the image blocks of exposure style into image blocks of warm light style, perform segmentation processing on the converted image blocks, obtain image block binary images, perform reverse splicing and synthesis processing in sequence according to the numbers of the image block binary images, and obtain the final segmentation result of the original image Img of field rice.

[0103] like Figure 6 As shown in FIG. 1 , it is a schematic diagram of the improved CycleGan cycle generation adversarial network processing process of the present invention. Among them, the generator structure is as follows Figure 7As shown, it includes an input image, an encoder, a converter, a decoder and a generated image, the encoder includes one-dimensional convolution, two-dimensional convolution and three-dimensional convolution, the converter includes one-dimensional residual network, two-dimensional residual network, three-dimensional residual network, four-dimensional residual network, five-dimensional residual network, six-dimensional residual network, seven-dimensional residual network, eight-dimensional residual network and nine-dimensional residual network, the decoder includes one-dimensional deconvolution, two-dimensional deconvolution and four-dimensional convolution; the discriminator structure is as shown Figure 8 As shown, it includes an input image, a convolution layer and a discrimination result, and the convolution layer includes one-dimensional convolution, two-dimensional convolution, three-dimensional convolution, four-dimensional convolution and five-dimensional convolution.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatic segmentation of field rice images based on generative adversarial networks, characterized in that: The following steps are involved: S1, dividing the original image Img of rice in the field collected under different lighting conditions into blocks, and numbering and style classification of the image blocks; S2. Using the improved CycleGan cycle generative adversarial network, the exposure style image blocks are processed in different tones, and the exposure style image blocks are converted into warm light style image blocks; S3, segmenting the converted image block to obtain a binary image of the image block; S4. According to the serial numbers of the binary images of the image blocks, reverse splicing and synthesis processing is performed in sequence to obtain the segmentation result of the original image Img of the rice in the field.

2. The method for automatic segmentation of field rice images based on a generative adversarial network according to claim 1, characterized in that: The S1 specifically includes the following steps: S11, inputting an original image Img of rice in the field with a collection size of M×N pixels, and dividing the original image Img of rice in the field into n equal blocks; wherein n is the number of equal blocks, M is the image width, and N is the image height; S12, sequentially numbering the image blocks to obtain numbered image blocks of size M'×N' pixels, and performing style classification on the numbered image blocks; wherein M' is the width of the numbered image blocks, and N' is the height of the numbered image blocks.

3. The method for automatic segmentation of field rice images based on a generative adversarial network according to claim 1, characterized in that: The S2 specifically includes the following steps: S21, based on the corresponding generator G, discriminator D Y , and the corresponding generator F and discriminator D X The adversarial process uses the following formula to generate the adversarial loss function: Among them, L GAN is the adversarial loss function, X and Y are both image domains, G and F are both generators, and D X , D Y All are discriminators, x is a sample in the X image domain, y is a sample in the Y image domain, G(x) is an image x in the X domain that is input to generate an image y in the Y domain, and F(x) is an image y in the Y domain that is input to generate an image x in the X domain. is the data distribution of the image set x, is the data distribution of image set y; S23. Calculate the cycle-consistent loss function: Among them, L cyc is the cycle consistent loss function; S24. Based on the generated adversarial loss function and the cycle-consistent loss function, the objective function of the original CycleGan cycle-generated adversarial network is calculated using the following formula: L=L GAN (G,D Y ,X,Y)+L GAN (F,D X ,X,Y)+λL cyc (G,F,X,Y) Among them, λ is the adjustment weight of the two cycle losses in the objective loss function; S25. Introduce perceptual loss function: Among them, L p is the perceptual loss function, W is the width of the image, H is the height, and D is the depth of the extracted features. represents the feature extraction function; S26. According to the original CycleGan cycle generation adversarial network and the perception loss function, the new target loss function of the improved CycleGan cycle generation adversarial network is obtained using the following formula, and the construction of the improved CycleGan cycle generation adversarial network is completed; L'=L GAN (G,D Y ,X,Y)+L GAN (F,D X ,X,Y)+αL cyc (G,F,X,Y)+βL p (G,F) Among them, L' is the new target loss function, α is the adjustment weight of the cycle consistent loss function in the target loss function, and β is the adjustment weight of the perceptual loss function in the target loss function; S27, using the improved CycleGan cycle generative adversarial network to process the exposure style image blocks in different tones; S28. Using the improved CycleGan cycle generative adversarial network, the processed exposure-style image blocks are converted into warm-light-style image blocks.

4. The method for automatic segmentation of field rice images based on a generative adversarial network according to claim 3, characterized in that: The process of processing the exposure style image block in different tones in S27 is as follows: S271, inputting the negative sample image image_x into the generator G, and the generator G outputs the generated image Fake_y; wherein the negative sample image image_x is an image block of the exposure style; S272, input the positive sample image image_y and the generated image Fake_y into the discriminator D Y In the output, the discriminant label is 1, the image with the discriminant label is the positive sample image image_y, and the image with the discriminant label is 0, the generated image Fake_y; among them, the positive sample image image_y is the image block of the warm light style; S273, inputting the positive sample image image_y into the generator F, and the generator F outputs the generated image Fake_x; S274, input the negative sample image image_x and the generated image Fake_x into the discriminator D X In the output, the discriminant label is 1, the image with the discriminant label is the negative sample image image_x, and the image with the discriminant label is 0, the generated image Fake_x; S275, judgment discriminator D Y Can the generated image Fake_y and the positive sample image image_y be distinguished? If so, return to S21. Otherwise, when the difference between the generated image Fake_y and the positive sample image image_y is the smallest, the discriminator model D Y When the generated image Fake_y and the positive sample image image_y cannot be correctly distinguished, the processing ends.

5. The method for automatic segmentation of field rice images based on generative adversarial networks according to claim 1, characterized in that: The S4 specifically comprises the following steps: S41, extracting the original image name Img and the digital sequence number from the number according to the number of the binary image of the image block; S42, performing reverse stitching and synthesis processing on the image blocks in numerical order to obtain a segmentation result of the original image Img of the rice field.

Citation Information

Patent Citations

  • Rice growth period identification method and system based on improved neural network

    CN114627467A

  • Ground feature type segmentation method and device based on remote sensing image, equipment and medium

    CN117911699A

  • Tiling and merging framework for segmenting large images

    US20090208098A1

Cited By

  • Pixel extraction and reconstruction method for large-size SAR image simulation of unmanned aerial vehicle

    CN120892586A