Dynamic adaptive attention cross-domain small sample image classification method for crop disease detection

By introducing dynamic adaptive attention mechanism and regularization technology in crop disease detection, the problem of insufficient detection performance in cross-domain small sample scenarios is solved, and higher detection accuracy, model robustness and generalization capabilities are achieved.

CN120164044APending Publication Date: 2025-06-17EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510423368.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The existing crop disease detection methods show shortcomings in cross-domain small sample scenarios, especially when the data distribution varies greatly, the detection performance of the model is difficult to meet the actual needs.

Method used

The dynamic adaptive attention mechanism is used to fuse the output of the pre-trained model, combine channel attention and spatial attention, adaptively adjust the network's attention to feature channels and spatial positions, and introduce regularization technology during fine-tuning training to improve the robustness and generalization ability of the model.

Benefits of technology

It significantly improves the accuracy of crop disease detection, enhances the adaptability and generalization capabilities of the model, can process cross-domain small sample data more effectively, and improves the cross-domain identification accuracy of crop diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164044A_ABST
    Figure CN120164044A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer vision, and provides a dynamic adaptive attention cross-domain small sample image classification method for crop disease detection, and the training process of a cross-domain image classification model comprises data set acquisition, ResNet10 network pre-training, cross-domain dynamic adaptive attention fusion, pre-training model iteration and fine tuning training. According to the method, the spatial features and the channel features of the pre-training model in the cross-domain training stage are fused by using the dynamic adaptive attention mechanism, so that the classification efficiency of the cross-domain features is improved; a regularization technology is introduced and utilized during fine tuning training, so that the stability and adaptability of the model to cross-domain target domain data distribution are improved; through carrying out pre-training, cross-domain training and fine tuning training on the ResNet10 network, the learning efficiency of cross-domain small sample learning is improved, and the improvement of crop disease identification accuracy under a small sample condition is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and particularly to a dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection. Background Art

[0002] Crop disease detection is an important task in agricultural production. Its purpose is to accurately diagnose the type of disease and provide corresponding prevention and control suggestions by analyzing crop images. In recent years, with the rapid development of artificial intelligence technology, crop disease detection methods based on machine learning and deep learning have gradually replaced traditional manual detection methods. These methods establish classification models to extract features and classify and judge crop disease images, which improves the detection efficiency and accuracy to a certain extent. However, existing machine learning and deep learning methods still face many challenges in practical applications, especially showing obvious deficiencies in cross-domain few-shot scenarios. First, traditional machine learning methods rely on manually designed feature expressions, such as low-level features like color, texture, and shape. The detection effect of such methods highly depends on the quality of feature engineering and shows poor generalization ability when facing complex and variable crop disease symptoms. In addition, machine learning methods usually require a large amount of labeled data for training, and in agricultural scenarios, obtaining large-scale labeled data is both labor-intensive and costly. Especially, data for some rare diseases is scarce, further restricting the application of these methods. Second, although crop disease detection methods based on deep learning can automatically learn high-level features through deep neural networks, significantly improving the accuracy of disease detection, their performance often depends on the support of a large amount of labeled data. In the case of insufficient data volume, deep learning models are prone to overfitting problems. In addition, existing deep learning methods usually assume that the training data and test data have the same distribution, while in practical applications, due to differences in shooting equipment, lighting conditions, crop varieties, or geographical regions, the distribution of image data may vary significantly. This cross-domain distribution difference will cause a significant decline in the detection performance of the model in the target domain and is difficult to meet the actual needs.

[0003] To solve the above problems, transfer learning technology has been introduced into crop disease detection. Transfer learning can effectively alleviate the problem of insufficient data in the target domain by transferring knowledge from the source domain to the target domain. However, existing transfer learning methods usually cannot fully narrow the distribution difference between the source domain and the target domain when dealing with cross-domain scenarios, resulting in limited transfer effects. In addition, existing methods have weak key feature extraction ability for the target domain and may not be able to accurately capture the disease features of the target domain, further affecting the detection performance. Summary of the Invention

[0004] To overcome the deficiencies of the prior art, the purpose of the present invention is to provide a dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection, so as to significantly improve the accuracy of crop disease detection and provide stronger support for agricultural production.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection, comprising:

[0007] Collect the image to be detected, and input the image to be detected into a pre-trained cross-domain image classification model for classification to obtain an image analysis result; the training process of the cross-domain image classification model includes:

[0008] Obtain a source domain dataset and a target domain dataset according to the publicly available benchmark dataset, and collect 20% of the data in the target domain dataset to obtain an unlabeled dataset;

[0009] Train the ResNet10 network using a pre-training loss according to the source domain dataset to obtain a pre-trained model;

[0010] Input the unlabeled dataset into the pre-trained model for calculation, and use a dynamic adaptive attention mechanism to fuse the output of the pre-trained model to obtain a block output; the dynamic adaptive attention mechanism includes: channel attention and spatial attention;

[0011] Calculate the total loss of the pre-trained model in the cross-domain transfer stage according to the block output, and use the SimCLR method to iteratively train the pre-trained model according to the total loss to obtain a transfer model;

[0012] Freeze the feature extractor of the transfer model, and use a regularization technique to fine-tune the transfer model according to the target domain dataset to obtain a cross-domain image classification model.

[0013] Preferably, the expression of the pre-training loss is:

[0014]

[0015] Wherein, is the pre-training loss; is the cross-entropy loss; f c (x i ) represents the predicted output of the i-th sample; y i is the true label of the i-th sample.

[0016] Preferably, the calculation formula of the channel attention is:

[0017]

[0018] Among them, is the channel attention map; δ(·) represents the sigmoid function; MLP(·) represents the MLP multi-layer perceptron; MaxPool(·) represents global max pooling; AvgPool(·) represents global average pooling; β0 represents the first weight; β1 is the second weight; is the intermediate feature map; is the maximum eigenvalue; is the average eigenvalue.

[0019] Preferably, the regularization technique is dropout.

[0020] Preferably, the benchmark dataset includes any one of miniImageNet and tieredImageNet.

[0021] Preferably, the calculation formula of the spatial attention is:

[0022]

[0023] Among them, is the spatial attention map; f 7×7 (·) represents the convolution operation; is the max pooling feature; is the average pooling feature.

[0024] Preferably, the expression of the total loss is:

[0025]

[0026] Among them,

[0027] is the total loss; is the similarity loss; represents the unlabeled dataset; N is the number of samples; s(a m , a n ) represents the cosine similarity between sample a m and sample a n ; τ is the temperature parameter; K is the number of negative samples.

[0028] Preferably, the calculation formula of the block output is:

[0029]

[0030] Among them, α + β = 1; for the block output; α and β are the first training parameter and the second training parameter respectively; are the channel attention enhanced feature map and the spatial attention enhanced feature map respectively; represents element-wise multiplication.

[0031] The present invention discloses the following technical effects:

[0032] The present invention provides a dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection. By using the dynamic adaptive attention mechanism to fuse the spatial features and channel features of the pre-trained model in the cross-domain training stage, the limitation of the traditional fixed feature extraction network in dealing with domain differences is solved, and the network's attention to feature channels and spatial positions is adaptively adjusted; by introducing regularization techniques during fine-tuning training, the problem of performance degradation caused by insufficient training on few-shot data is solved, and the robustness and generalization ability of the model are enhanced; by pre-training, cross-domain training, and fine-tuning training on the ResNet10 network, the problem of insufficient mining of cross-domain few-shot data by traditional methods is solved, and the accuracy of cross-domain recognition of crop diseases is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0034] Figure 1 is a schematic diagram of the dynamic adaptive attention cross-domain few-shot image classification process for crop disease detection provided by an embodiment of the present invention;

[0035] Figure 2 is an overall framework diagram of the dynamic adaptive attention cross-domain few-shot learning algorithm for crop disease detection provided by an embodiment of the present invention;

[0036] Figure 3 is a statistical chart of the accuracy change of the crop disease target domain dataset under different shot conditions provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0038] The object of the present invention is to provide a dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection, so as to significantly improve the accuracy of crop disease detection and provide stronger support for agricultural production.

[0039] In order to make the above objects, features and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] Figure 1 It is a schematic flowchart of a dynamic adaptive attention cross-domain few-shot image classification for crop disease detection provided by an embodiment of the present invention. As Figure 1 shown, the present invention provides a dynamic adaptive attention cross-domain few-shot image classification method for crop disease detection, including:

[0041] Step 100: Collect the image to be detected, and input the image to be detected into a pre-trained cross-domain image classification model for classification to obtain an image analysis result; the training process of the cross-domain image classification model includes:

[0042] Step 101: Obtain a source domain dataset and a target domain dataset according to the publicly available benchmark dataset, and collect 20% of the data in the target domain dataset to obtain an unlabeled dataset;

[0043] Step 102: Train the ResNet10 network using the pre-training loss according to the source domain dataset to obtain a pre-trained model;

[0044] Step 103: Input the unlabeled dataset into the pre-trained model for calculation, and use the dynamic adaptive attention mechanism to fuse the output of the pre-trained model to obtain a block output; the dynamic adaptive attention mechanism includes: channel attention and spatial attention;

[0045] Step 104: Calculate the total loss of the pre-trained model in the cross-domain transfer stage according to the block output, and use the SimCLR method to iteratively train the pre-trained model according to the total loss to obtain a transfer model;

[0046] Step 105: Freeze the feature extractor of the transfer model, and use the regularization technique to fine-tune the transfer model according to the target domain dataset to obtain a cross-domain image classification model.

[0047] Specifically, the expression of the pre-training loss is:

[0048]

[0049] Among them, is the pre-training loss; is the cross-entropy loss; f c (x i ) represents the predicted output of the i-th sample; y i is the true label of the i-th sample.

[0050] Furthermore, the calculation formula of the channel attention is:

[0051]

[0052] Among them, is the channel attention map; δ(·) represents the sigmoid function; MLP(·) represents the MLP multi-layer perceptron; MaxPool(·) represents global max pooling; AvgPool(·) represents global average pooling; β0 represents the first weight; β1 is the second weight; is the intermediate feature map; is the maximum eigenvalue; is the average eigenvalue.

[0053] Optionally, the regularization technique is dropout.

[0054] Preferably, the benchmark dataset includes any one of miniImageNet and tieredImageNet.

[0055] Furthermore, the calculation formula of the spatial attention is:

[0056]

[0057] Among them, is the spatial attention map; f 7×7 (·) represents the convolution operation; is the max pooling feature; is the average pooling feature.

[0058] Specifically, the expression of the total loss is:

[0059]

[0060] Among them,

[0061] is the total loss; is the similarity loss; represents the unlabeled dataset; N is the number of samples; s(a m ,a n ) represents sample a m and sample a nCosine similarity; τ is the temperature parameter; K is the number of negative samples.

[0062] Furthermore, the calculation formula of the block output is:

[0063]

[0064] Wherein, α + β = 1; is the block output; α and β are the first training parameter and the second training parameter respectively; are the channel attention enhanced feature map and the spatial attention enhanced feature map respectively; represents element-wise multiplication.

[0065] Reference Figure 2 , the overall framework of the algorithm. In this embodiment, a widely labeled natural image dataset is used as the source dataset, such as miniImageNet, tieredImageNet, etc. First, a pre-trained model is obtained by training based on the source dataset, and then fine-tuned on the target dataset to achieve good classification results on the crop disease target data. The key to transfer learning lies in discovering the similarity between new knowledge and existing knowledge, and achieving the goal of transfer learning through the transfer of these similarities. The overall framework of the method proposed in this embodiment is as Figure 2 shown, which is mainly divided into three stages, namely:

[0066] 1) In the pre-training stage based on the source domain, the miniImageNet natural image dataset is used as the source dataset input, and the model is pre-trained using a large number of natural image data therein. By learning these data, the model can extract rich feature representations, which serve as basic knowledge in cross-domain transfer and provide support for adapting to the new domain, thereby outputting a pre-trained model that has learned general feature representations;

[0067] 2) In the cross-domain transfer stage, the pre-trained model and a small amount of unlabeled crop disease target domain data are used as inputs. The knowledge in the pre-trained model is transferred to the target domain, and a dynamic adaptive attention strategy is adopted during the transfer to enhance the model's ability to capture cross-domain features. At the same time, the unlabeled crop disease target domain data is used for training (with contrastive learning loss) to enable the model to better adapt to the feature distribution of the target domain, further improving the model's performance in the new domain, thereby outputting a model that adapts to the feature distribution of the crop disease target domain, has better performance in the target domain, and can more accurately handle new tasks with small samples in the target domain.

[0068] 3) In the target domain adaptation stage of crop diseases, the model obtained through the cross-domain migration stage and the target domain data are used as inputs, where the target domain data is divided into a support set and a query set. First, the model is fine-tuned on the target domain support set, and regularization techniques are used to prevent overfitting, enabling the model to better adapt to the specific requirements of the target domain. Then, the fine-tuned model is tested and evaluated on the query set to verify the classification performance of the model on the few-shot tasks in the target domain. Finally, the classification accuracy on the query set is output, which reflects the classification effect of the model on the few-shot tasks in the target domain. The organic combination of these three stages enables the model to efficiently migrate from the source domain to the target domain, improving the adaptability and accuracy of the target domain tasks.

[0069] Specifically, the source domain pre-training stage. In this embodiment, miniImageNet is used as the source domain dataset. The source domain dataset has a large amount of labeled data, and there are significant differences between its joint distribution and the joint distribution of the target domain.

[0070] Assume a pre-trained model f t , a classification model where C is the linear classifier head, and θ represents embedding the input data x into First, a pre-trained model f with ResNet10 as the backbone is learned on the source domain dataset t , and the weights of the model are optimized through the cross-entropy loss. Therefore, the pre-training loss is calculated by the cross-entropy loss:

[0071]

[0072] Furthermore, the cross-domain migration stage. In the cross-domain migration training stage, ResNet10 with a dynamic adaptive attention mechanism is used as the feature extractor. The specific method is introduced as follows: Attention mechanism. The main elements of the dynamic adaptive attention proposed in this embodiment are channel attention (CA) and spatial attention (SA). Channel attention focuses on the importance of different channels in the input feature map, automatically learns the importance of different channels by weighting each channel in the feature map, enhances useful features, and suppresses unimportant features. Spatial attention focuses on the different importance of different positions in the feature map, emphasizes important features, and suppresses unimportant features by weighting each spatial position in the feature map.

[0073] Specifically, channel attention. Taking the intermediate feature map As input, global max pooling and global average pooling are performed separately on each channel to calculate the maximum eigenvalue and average eigenvalue of each channel, resulting in two vectors and Each vector contains the number of channels. These vectors respectively represent the global maximum and average features of each channel:

[0074]

[0075] After global max pooling and average pooling, the feature vectors enter a shared network, which consists of an MLP (Multi-Layer Perceptron) with a single hidden layer. To minimize the parameter overhead, the activation size of the hidden layer is adjusted to where r represents the reduction factor. The shared MLP is used to learn channel-specific attention weights. By using this MLP shared network to learn the attention weights of each channel, the network can dynamically determine the importance of different channels for a given task. Then, the global maximum feature vector is added to the average feature vector to obtain the final attention weight vector. To limit the attention weight values within the range of 0 to 1, channel attention weights are obtained by adopting the Sigmoid activation function, and then these weights are applied to each channel of the initial feature map. Therefore, the channel attention map is determined by the following calculation:

[0076]

[0077] where,

[0078] Furthermore, spatial attention. For the spatial attention module, the max-pooled feature and the average-pooled feature

[0079]

[0080] are obtained through global average pooling and global max pooling respectively. The concatenation of the max-pooled and average-pooled features along the channel axis generates a feature map that captures context details at different scales. Subsequently, this integrated feature map is processed through convolution to generate spatial attention weights. Similarly, the Sigmoid activation function is used to limit these spatial attention weights within the range of 0 to 1. The spatial attention map is calculated as:

[0081]

[0082] where, f 7×7 represents a convolution operation using a filter of size 7×7.

[0083] Preferably, dynamic adaptive attention. To simultaneously and independently obtain information from different dimensions of the feature map and improve the comprehensiveness of feature extraction, in this embodiment, the importance of channel attention and spatial attention is fused in the form of adaptive weights to enhance the ability to identify important features and improve the expression ability and performance of the model. Specifically, the dynamic adaptive attention mechanism can be summarized as follows:

[0084]

[0085] Among them, is the final output result, α and β are trainable parameters, the values of α and β respectively represent the weight importance of CA and SA for feature extraction, and α + β = 1. These values, as trainable parameters, actively participate in gradient descent. During the loss calculation process, the model automatically adjusts according to the initial values of α and β to minimize the overall loss. During the entire training process, the model obtains the importance knowledge of different features under CA and SA through the analysis of a large amount of data. By continuously updating α and β according to the feedback of the training data, the model can effectively adapt to the changing sample requirements. This adaptive adjustment can accurately capture key features and ultimately improve the overall performance. and are the feature maps enhanced by channel attention and spatial attention respectively, is obtained by multiplying the channels of the input feature map, while is obtained by multiplying the elements of the input feature map,

[0086]

[0087] Among them, the symbol represents the multiplication between elements.

[0088] Furthermore, the dynamic adaptive attention mechanism is used after each block of ResNet10, where the block is the basic building block of the ResNet model. Combining CA and SA and using adaptive weights has the advantage that it can dynamically adjust the influence of the two to meet the needs of different data features. This flexibility allows the model to automatically learn the optimal combination ratio during the training process, thereby improving the comprehensiveness and accuracy of feature representation. The adaptive weights enable the model to not only focus on the importance between channels but also emphasize the significance of spatial positions when capturing important information, enhancing the overall efficiency and generalization ability. At the same time, this method enhances the robustness of the model while maintaining computational efficiency, making it more capable of handling noise and incomplete data, and ultimately achieving richer feature representation and more stable classification results.

[0089] Specifically, the contrastive learning loss. In the cross - domain transfer training stage, the contrastive learning method SimCLR is mainly used. This method uses a small amount of unlabeled target domain data and enhances the effectiveness of the model in the new domain by creating positive and negative sample pairs. Different perspective sample pairs are mainly generated through data augmentation, enabling the model to obtain more robust feature representations. This method reduces the dependence on widely labeled data and also significantly improves the generalization ability of the model. Therefore, the training model f s is learned based on a small amount of unlabeled target domain data The total loss of model training is defined as follows:

[0090]

[0091] where is the SimCLR loss, which encourages the model to learn target features by maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs.

[0092] Furthermore, assume that a similarity metric function s(a m , a n ) is defined to measure the similarity between two samples a i and a j . For each sample a m , a sample a n is randomly selected from the same batch as its positive sample, and a sample a k is randomly selected from other batches as its negative sample. Then its similarity loss can be expressed as:

[0093]

[0094] s(a m , a n ) is represented by cosine similarity:

[0095]

[0096] The loss decreases as the similarity between positive sample pairs increases, and the greater the sample similarity, the smaller the loss. This enables the model to better distinguish between similar and dissimilar samples and learn more discriminative representations.

[0097] Specifically, it is the target domain adaptation stage of crop diseases. During the target domain adaptation stage of crop diseases, the feature extractor is frozen to utilize the general features it obtained during pre-training in the source domain, thereby preventing performance degradation caused by insufficient training on few-shot data. Then, a dropout layer is introduced before the classification layer, aiming to randomly discard some neurons, further enhancing the robustness and generalization ability of the model and reducing the risk of overfitting. Finally, only the last classification layer is retrained to enable the model to focus on adapting to the specific categories in the target domain of crop diseases, thus effectively using the limited target data to fine-tune the model. Through this strategy, while improving the classification performance of the target domain of crop diseases, the stability and adaptability of the model can be maintained, ensuring its effectiveness in the target domain.

[0098] Reference Figure 3 , CropDisease: Crop disease images. The model designed in this example shows excellent classification performance for cross-domain few-shot learning of crop diseases. Under the 5-way 50-shot (i.e., selecting 5 different categories of crop disease data, with 50 samples in each category) sample setting, the accuracy rate on the CropDisease target domain dataset of crop diseases reaches 99.25%.

[0099] The beneficial effects of the present invention are as follows:

[0100] By using the dynamic adaptive attention mechanism to fuse the spatial features and channel features of the pre-trained model during the cross-domain training stage, the present invention improves the classification efficiency of cross-domain features; by introducing the regularization technique during fine-tuning training, it improves the stability and adaptability of the model to the data distribution in the target domain of crop diseases; through pre-training, cross-domain training, and fine-tuning training of the ResNet10 network, it effectively improves the recognition accuracy of the model for few-shot crop diseases, which helps with early warning and prevention and control.

[0101] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, reference can be made to each other.

[0102] Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, based on the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A dynamic adaptive attention cross-domain small sample image classification method for crop disease detection, characterized in that: include: Collecting an image to be detected, and inputting the image to be detected into a pre-trained cross-domain image classification model for classification, to obtain an image analysis result; The training process of the cross-domain image classification model includes: Obtain a source domain dataset and a target domain dataset based on a public benchmark dataset, and collect 20% of the data in the target domain dataset to obtain an unlabeled dataset; According to the source domain data set, the ResNet10 network is trained using the pre-training loss to obtain a pre-training model; The unlabeled data set is input into the pre-trained model for calculation, and the output of the pre-trained model is fused using a dynamic adaptive attention mechanism to obtain a block output; the dynamic adaptive attention mechanism includes: channel attention and spatial attention; Calculating the total loss of the pre-trained model in the cross-domain migration stage according to the block output, and iteratively training the pre-trained model using the SimCLR method according to the total loss to obtain a migration model; The feature extractor of the migration model is frozen, and the migration model is fine-tuned and trained using a regularization technique according to the target domain data set to obtain a cross-domain image classification model.

2. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 1 is characterized in that: The expression of the pre-training loss is: in, is the pre-training loss; is the cross entropy loss; f c (x i ) represents the predicted output of the i-th sample; y i is the true label of the i-th sample.

3. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 1 is characterized in that: The calculation formula of the channel attention is: in, is the channel attention map; δ(·) represents the sigmoid function; MLP(·) represents the MLP multilayer perceptron; MaxPool(·) represents the global maximum pooling; AvgPool(·) represents the global average pooling; β0 represents the first weight; β1 represents the second weight; is the intermediate feature map; is the maximum eigenvalue; is the average eigenvalue.

4. The method of dynamic adaptive attention cross-domain small sample image classification for crop disease detection according to claim 1, characterized in that: The regularization technique is dropout.

5. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 1, characterized in that: The benchmark dataset includes: any one of miniImageNet and tieredImageNet.

6. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 3 is characterized in that: The calculation formula of the spatial attention is: in, is the spatial attention map; f 7×7 (·) represents the convolution operation; is the maximum pooling feature; is the average pooling feature.

7. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 6, characterized in that: The total loss is expressed as: in, is the total loss; is the similarity loss; represents the unlabeled data set; N is the number of samples; s(a m ,a n ) represents sample a m and sample a n The cosine similarity of ; τ is the temperature parameter; K is the number of negative samples.

8. The dynamic adaptive attention cross-domain small sample image classification method for crop disease detection according to claim 7, characterized in that: The block output is calculated as: in, α+β=1; is the block output; α and β are the first training parameter and the second training parameter respectively; They are the channel attention enhanced feature map and the spatial attention enhanced feature map respectively; Represents element-wise multiplication.

Citation Information

Cited By

  • Multi-scene pavement PCI (Peripheral Component Interconnect) prediction method based on cross-regional transfer learning

    CN120912573A