Search

CN-122024067-A - Corn drought image classification method and device based on improved Swin converter network

CN122024067ACN 122024067 ACN122024067 ACN 122024067ACN-122024067-A

Abstract

The invention provides a corn drought image classification method and device based on a modified Swin Transformer network, which comprises the steps of S1, obtaining a multi-source corn field visible light image, constructing a corn drought image data set containing combinations of different drought stress degrees and different breeding stages, S2, modifying the Swin Transformer network, connecting MDFA modules in series so as to construct a SWT-MDFA classification network, S3, training the SWT-MDFA classification network by using the corn drought image data set to obtain a trained corn drought image classification model, and S4, inputting the corn field visible light image to be classified into the corn drought image classification model and outputting a pair result. The invention solves the technical problems that the existing maize drought image classification method is difficult to consider the phenotype difference of different maize breeding stages and the cooperative discrimination of the detail change of the blades in the field image and the whole plant state, and is interfered by complex field environments such as large scale difference, illumination change, background disorder and the like of the multi-source field image, so that the recognition accuracy and stability are insufficient.

Inventors

  • WU RONGSHENG
  • CHEN HONG
  • YANG LIPING
  • LIU SHUNING
  • ZHANG CHAO
  • HONG YING
  • SU YUE
  • De Zhipeng
  • LIU XIAXIA
  • FENG XUYU
  • SU LIJUN
  • SUN LINLI
  • GAO HONGXIA
  • WEI XUE
  • TIAN XIAOLONG

Assignees

  • 内蒙古自治区生态与农业气象中心(内蒙古自治区气象卫星遥感中心)

Dates

Publication Date
20260512
Application Date
20260212

Claims (9)

  1. 1. The corn drought image classification method based on the improved Swin converter network is characterized by comprising the following steps of: S1, obtaining visible light images of a multi-source corn field, and constructing a corn drought image data set comprising combinations of different drought stress degrees and different breeding stages; S2, improving a Swin Transformer network, adopting at least one of post-residual normalization, scaling cosine attention and logarithmic spacing continuous position deviation in a basic module, and connecting a multi-scale cavity fusion attention (MDFA) module in series behind the network to construct a SWT-MDFA classification network; S3, training the SWT-MDFA classification network by using the corn drought image dataset to obtain a trained corn drought image classification model; S4, inputting the corn field visible light images to be classified into the trained corn drought image classification model, and outputting a classification result of the combination of the corresponding drought stress degree and the fertility stage.
  2. 2. The method for classifying corn drought images based on the improved Swin converter network according to claim 1, wherein in step S1, a multi-classification label system is constructed according to drought stress degree and growth stage after collecting visible light images of a multi-source corn field, data cleaning and data enhancement treatment, and is divided into a training set, a verification set and a test set according to a certain proportion.
  3. 3. The method for classifying maize drought images based on the modified Swin Transformer network according to claim 2, wherein in step S1, constructing a multi-classification tag system specifically comprises: And (3) constructing a 9-class tag system, wherein the tag system is formed by cross combination of 3 maize fertility periods including a jointing period, a male pulling period and a maturing period and 3 drought grades including no drought, light drought and heavy drought.
  4. 4. The method for classifying maize drought images based on the improved Swin Transformer network according to claim 1, wherein in step S2, the post-residual normalization comprises: layer normalization is placed after the self-attention layer and the feedforward neural network, and the output thereof is normalized.
  5. 5. The method for classifying maize drought images based on the modified Swin Transformer network according to claim 1, wherein in step S2, the scaled cosine attention is used specifically comprising: replacing the dot product attention of the query vector q and the key vector k with cosine attention in a basic module, wherein the calculation formula is as follows: ; Wherein, the And (3) with For indexing the pixel locations within the window, Is the first The number of query vectors is chosen to be the number of, Is the first The number of key vectors is set to be, For the cosine similarity calculation, In order to scale the cosine coefficient, As the relative positional deviation between the pixels, Is the attention similarity score between vectors.
  6. 6. The method for classifying maize drought images based on a modified Swin Transformer network according to claim 1, wherein in step S2, employing log-interval continuous position deviations comprises: The linear mapping in the original relative position coding is replaced by logarithmic interval continuous position deviation, and the calculation formula is as follows: ; Wherein, the , The coordinates are respectively in logarithmic space, , Is a linear scale coordinate; Is a sign function for preserving the displacement direction; Is natural logarithm; Is an absolute value operation.
  7. 7. The method for classifying maize drought images based on the improved Swin Transformer network according to claim 1, wherein in step S2, a multiscale hole fusion attention (MDFA) module is used for extracting multiscale features and global semantic features of the input feature map, fusing and recalibrating the same, and outputting the enhanced features.
  8. 8. The method for classifying maize drought images based on the modified Swin Transformer network according to claim 7, wherein in step S2, the multiscale hole fusion attention (MDFA) module specifically comprises: The multi-scale feature extraction branch is used for extracting multi-scale features of the input feature map in parallel through a plurality of cavity convolution branches with different cavity rates; The global average pooling branch is used for extracting and processing global semantic features of the input feature map and finally fusing the global semantic features with the multi-scale features to form fusion features; And the attention recalibration branch is used for respectively generating a channel attention weight and a space attention weight based on the fusion characteristics, weighting the fusion characteristics and finally outputting the enhanced characteristics.
  9. 9. A maize drought image classification device based on a modified Swin Transformer network, comprising: the image acquisition module is used for acquiring visible light images of corn fields to be classified; The classification processing module is used for inputting the images into a corn drought image classification model configured by the images and outputting a classification result of drought stress degree and fertility stage combination corresponding to the images; Wherein the maize drought image classification model is a model obtained after training the SWT-MDFA classification network according to the method of any one of claims 1 to 8.

Description

Corn drought image classification method and device based on improved Swin converter network Technical Field The invention relates to the technical field of agricultural information technology and computer vision, in particular to a corn drought image classification method based on a modified Swin transform network. Background Corn is used as a globally important grain crop, and the yield stability of the corn is directly related to grain safety and agricultural economy. In recent years, the occurrence frequency of drought is continuously increased due to global climate change, and the yield loss caused by drought stress of corn in the growth process becomes a prominent problem in agricultural production, so that the drought state of the corn is timely and accurately identified and evaluated, and the method has important significance in optimizing irrigation decisions and slowing down yield loss. At present, crop drought analysis generally depends on traditional methods such as remote sensing, ground sensors, meteorological data and the like. Although the method can provide drought background information with different scales, in a fine recognition task oriented to plant level or leaf level, the limitations of insufficient spatial resolution, limited real-time performance, high deployment cost and the like still exist generally. With the popularization of visible light imaging equipment, the drought identification method based on image analysis is widely focused on the visual phenotype characteristics of leaf curl, chlorosis, dry out and the like, and provides a new approach for evaluating the moisture condition of crops in field scale. In addition, deep learning-based crop drought identification studies have made significant progress, convolutional neural networks and variants thereof exhibiting potential in crop phenotype identification. However, aiming at a typical drought-sensitive crop of corn, the existing method still has the defects that firstly, the drought-affected phenotype of the corn is obvious along with the change of the growing stage, the detail change (such as curling and fading) of the blades in the field image and the integral state of the plant often occur at the same time, the existing method is difficult to judge both types of information, and secondly, the network identification stability under different acquisition conditions and data sources is insufficient due to interference factors such as illumination change and background disorder of the field image. Therefore, a robust identification method capable of effectively fusing multi-scale phenotype details with global context information, enhancing discrimination capability of key features of leaves, adapting to complex field environments such as field illumination fluctuation, background disorder and scale difference is needed, and achieving accurate and stable classification of maize drought phenotypes in different breeding periods and stress grades. Disclosure of Invention The invention aims to provide a corn drought image classification method and device based on a improved Swin transform network, which solve the technical problems that the conventional corn drought image classification method is difficult to consider the phenotype difference of different corn breeding stages and the cooperative discrimination of the detail change of a blade in a field image and the integral state of a plant, and is interfered by complex field environments such as large scale difference, illumination change, background disorder and the like of a multi-source field image, so that the identification accuracy and stability are insufficient. In order to solve the technical problems, the technical scheme of the invention is as follows: in a first aspect, the invention provides a corn drought image classification method based on a modified Swin transform network, comprising the following steps: S1, obtaining visible light images of a multi-source corn field, and constructing a corn drought image data set comprising combinations of different drought stress degrees and different breeding stages; S2, improving a Swin Transformer network, adopting at least one of post-residual normalization, scaling cosine attention and logarithmic spacing continuous position deviation in a basic module, and connecting a multi-scale cavity fusion attention (MDFA) module in series behind the network to construct a SWT-MDFA classification network; S3, training the SWT-MDFA classification network by using the corn drought image dataset to obtain a trained corn drought image classification model; S4, inputting the corn field visible light images to be classified into the trained corn drought image classification model, and outputting a classification result of the combination of the corresponding drought stress degree and the fertility stage. Further, in the step S1, a multi-classification label system is constructed according to drought stress degree and growth stage after th