A method for classifying rotten strawberries based on the GC-EfficientNet V2 model
By developing a rotten strawberry classification method based on the GC-EfficientNet V2 model, and combining graph convolutional networks and improved residual structures, this method solves the problems of low recognition efficiency and high subjectivity in traditional methods, and achieves efficient and accurate classification of strawberry rot detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO UNIV OF TECH
- Filing Date
- 2024-02-05
- Publication Date
- 2026-07-24
AI Technical Summary
Traditional methods for detecting rotten strawberries rely on human vision and subjective judgment, which suffers from low recognition efficiency, high subjectivity, and high labor intensity, making it difficult to quickly and accurately detect the rottenness of strawberries.
A rotten strawberry classification method based on the GC-EfficientNet V2 model is adopted. It combines graph convolutional networks (GCN) and improved residual structures, uses CA-Transformer for feature extraction and fusion, and utilizes channel and spatial attention mechanisms to improve model performance.
It improves the accuracy and recall of strawberry rot classification, showing significant advantages over traditional methods in terms of time-saving, labor-saving and high accuracy, especially with an improvement of 0.47-3.26% in recognition accuracy compared to the EfficientNet V2-m model.
Smart Images

Figure CN118212631B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image classification technology, and in particular to a method for classifying rotten strawberries based on the GC-EfficientNet V2 model. Background Technology
[0002] Strawberries, known as the "Queen of Fruits," hold a prominent position and importance in the fruit world. They are a small berry with high economic and nutritional value. Rich in Vitamin C, dietary fiber, and antioxidants, strawberries are beneficial for the immune system, digestive system, and cardiovascular health. According to statistics from the Food and Agriculture Organization of the United Nations, China has the largest strawberry-growing area in the world. However, due to their thin skin, susceptibility to damage, and water sensitivity, strawberries are highly susceptible to rotting during planting, transportation, and storage. Rotting strawberries pose a significant health risk. To avoid food poisoning or discomfort, rotten strawberries must be avoided. Furthermore, rotten strawberries negatively impact surrounding healthy strawberries, as the rot can spread. Once rotten strawberries are present in the same batch or storage environment, bacteria, fungi, or other pathogens can infect nearby healthy strawberries through contact, airborne transmission, or resource sharing. This spread can be rapid, causing more strawberries to rot and resulting in substantial economic losses. Therefore, rapid and accurate detection of strawberry rot is crucial for both human health and product sales. However, traditional methods for detecting rotten strawberries usually rely on human vision and subjective judgment, which have problems such as low identification efficiency, high subjectivity, and high labor intensity. Summary of the Invention
[0003] To overcome the aforementioned problems in the existing technology, this invention proposes a method for classifying rotten strawberries based on the GC-EfficientNetV2 model.
[0004] The technical solution adopted by this invention to solve its technical problem is: a method for classifying rotten strawberries based on the GC-EfficientNet V2 model, comprising:
[0005] Step 1: Collect photos of strawberries, including those in good condition and those in rotten condition, and manually label the collected photos. Use the manually labeled strawberry photos as the dataset.
[0006] Step 2: Divide the dataset obtained in Step 1 into a training set and a validation set using the 5-fold cross-validation method;
[0007] Step 3: Construct the GC-EfficientNet V2 model. Train the GC-EfficientNet V2 model using the training set obtained in Step 2. Test the performance of the GC-EfficientNet V2 model using the validation set based on the cross-validation method. Finally, obtain the GC-EfficientNet V2 classification model.
[0008] Step 4: Collect strawberry photos and input them into the GC-EfficientNetV2 classification model obtained in Step 3. The classification model will output the classification results.
[0009] The GC-EfficientNetV2 model consists of two feature extraction branches: one based on CNN and CA-Transformer, and the other based on GCN. The feature extraction branch based on CNN and CA-Transformer is responsible for processing image data, while the feature extraction branch based on GCN converts the image data into graph data and performs three layers of graph convolution. The results of the two feature extraction branches are fused to output the final classification result and confidence score.
[0010] The aforementioned rotten strawberry classification method based on the GC-EfficientNet V2 model consists of a feature extraction branch based on CNN and CA-Transformer, which comprises four layers: the first layer is a 3x3 convolution for feature extraction; the second and third layers are convolutions fused with MBConv to reduce computation and the number of parameters; and the fourth layer is a CA-Transformer.
[0011] The aforementioned method for classifying rotten strawberries based on the GC-EfficientNet V2 model introduces an improved residual structure in the second and third layers of the feature extraction branches based on CNN and CA-Transformer.
[0012] The aforementioned rotten strawberry classification method based on the GC-EfficientNet V2 model includes a CA-Transformer structure comprising channel attention and spatial attention. Channel attention focuses on the channel dimension of features, learning the importance weight of each channel to enable the model to adaptively and selectively focus on features from different channels. Spatial attention focuses on the spatial dimension of feature points, learning the weight of each spatial location to enhance the model's perception of local details and global context, thereby improving the model's performance in handling spatially related tasks.
[0013] The above-mentioned method for classifying rotten strawberries based on the GC-EfficientNet V2 model involves improving the residual structure by adding two learning parameters to the traditional residual structure and multiplying the two learning parameters by the features extracted from the two feature extraction branches.
[0014] The above-mentioned method for classifying rotten strawberries based on the GC-EfficientNet V2 model uses two learning parameters that are normalized using a softmax activation function. The specific calculation formula is as follows:
[0015]
[0016] Wherein, Softmax(x) i Let represent the SoftMax value of the i-th element in the input vector x, where x is the SoftMax value. i Let exp(x) represent the i-th element in the input vector x. j ) represents the exponential function of the vector elements corresponding to element j.
[0017] The beneficial effects of this invention are that, based on a large amount of strawberry image data, this invention uses a deep learning method of neural networks, which has the advantages of saving time and effort and high accuracy compared with the traditional method of manually sorting rotten strawberries.
[0018] This invention adds a graph convolution branch to the baseline model, updating the node's feature representation by aggregating neighbor information, thus better capturing the node's contextual information within the graph structure. Secondly, it integrates a novel attention-based Transformer structure (CA-Transformer) into the backbone of the baseline model, replacing some convolutional operations to achieve the capture and fusion of global and local features, thereby better identifying strawberry rot. Finally, it introduces learning parameters based on the traditional residual structure to achieve dynamic feature fusion. Experimental results show that the improved GC-EfficientNetV2 model improves accuracy by 1.86% and recall by 1.49% compared to the baseline model. Furthermore, compared to the EfficientNetV2-m model, this improved model has advantages in both accuracy and model size. Compared with InceptionV3, ResNet50, VGGNet, Vision Transformer, and EfficientNet V2-m, this model improves the recognition accuracy by 0.93%, 2.08%, 2.79%, 3.26%, and 0.47%, respectively.
[0019] The model proposed in this invention can accurately classify rotten strawberries, providing theoretical support for automatic strawberry sorting. This invention can effectively learn global and local features in the data and achieve effective aggregation of neighbor features, thereby significantly improving the accuracy of strawberry rot classification. Attached Figure Description
[0020] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0021] Figure 1 This is a flowchart of the present invention;
[0022] Figure 2 These are some of the strawberry photos in the embodiments of the present invention, wherein (a-1) and (a-2) are intact strawberries; (b-1) and (b-2) are rotten strawberries;
[0023] Figure 3 This is a schematic diagram of the network structure of GC-EfficientNetV2 of the present invention;
[0024] Figure 4 This is a schematic diagram illustrating the conversion of image data into graph data in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the CA-Transformer network structure of the present invention;
[0026] Figure 6 The diagram shows a comparison of the residual structures before and after the improvement of the present invention, where (a) is a schematic diagram of the original residual structure and (b) is a schematic diagram of the residual structure of the embodiment of the present invention.
[0027] Figure 7 These are heatmaps of some data in an embodiment of the present invention; where (a-1), (b-1), and (c-1) are the original image data; and (a-2), (b-2), and (c-2) are heatmaps generated by the Grad-CAM algorithm.
[0028] Figure 8 This is a visualization diagram of convolutional features in an embodiment of the present invention, wherein (a) is the feature map after convolution of the first convolutional layer, (b) is a schematic diagram after convolution of the second convolutional layer, and (c) is a schematic diagram after convolution of the third convolutional layer;
[0029] Figure 9 This illustrates how the maximum information entropy of the feature map changes with the number of layers in this embodiment of the invention.
[0030] Figure 10 The curves showing the change in accuracy of different models with the number of training rounds in this embodiment of the invention are shown.
[0031] Figure 11The curves showing the change in accuracy of the GC-EfficientNet v2 and the baseline model as a function of the number of training epochs are shown.
[0032] Figure 12 This is the confusion matrix in an embodiment of the present invention. Detailed Implementation
[0033] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] like Figure 1 As shown in the figure, this embodiment discloses a method for classifying rotten strawberries based on the GC-EfficientNet V2 model, which specifically includes the following steps:
[0035] Step 1: Collect strawberry images, including both intact and rotten strawberries, using a mobile phone. The samples used in this self-built dataset come from the Hongshiya Strawberry Planting Base in Huangdao District, Qingdao City, Shandong Province, China (Longitude: 121.49°E, Latitude: 36.77°N, Altitude: 17 meters). Established in 1991, this base has over 360 greenhouses covering an area of over 500 hectares. The samples are distributed across greenhouses belonging to different farmers growing varieties such as 'Miaoxiang', 'Xuelixiang', 'Tianbao', and 'Hongyan' to eliminate data bias caused by individual geographical locations and varieties. Some strawberry photos in this embodiment are shown below. Figure 2 As shown, (a-1, a-2) represent intact strawberries, and (b-1, b-2) represent rotten strawberries.
[0036] The collected strawberry images were manually labeled and classified into two categories: intact strawberries and rotten strawberries, thus creating a dataset. This study used 2152 images for classifying rotten strawberries. The dataset includes two categories of strawberries: 1031 images of intact strawberries and 1121 images of rotten strawberries. Some data are shown below. Figure 1 As shown. Guided by the farmer's years of planting experience, each image was classified to ensure the accuracy of the dataset. This dataset consists of photos of harvested strawberry samples taken from different angles and distances on an indoor desktop. It can be used for online detection of strawberry rot after harvesting and for accurate sorting of rotten strawberries.
[0037] Step 2: The dataset obtained in Step 1 is divided into training and validation sets using 5-fold cross-validation. This embodiment employs 5-fold cross-validation to ensure randomness in the dataset partitioning process. Compared to traditional proportional dataset partitioning, cross-validation improves model evaluation, providing a more comprehensive, robust, and reliable performance assessment. It helps reduce uncertainty in model selection and evaluation while effectively utilizing the limited dataset.
[0038] Step 3: Construct the GC-EfficientNet V2 model. Train the GC-EfficientNet V2 model using the training set obtained in Step 2. Test the performance of the GC-EfficientNet V2 model using the validation set based on the cross-validation method. Finally, obtain the GC-EfficientNet V2 classification model.
[0039] The GC-EfficientNet V2 model innovatively integrates graph convolutional structures with traditional convolutions. The specific structure is as follows: Figure 3 As shown, Figure 3 The lower half of the dashed box represents the original EfficientNetV2 model; the upper half of the dashed box represents the GC-EfficientNet V2 model proposed in this embodiment. The GC-EfficientNet V2 model consists of two feature extraction branches: one based on CNN and CA-Transformer, and the other based on GCN. The CNN and CA-Transformer feature extraction branch is responsible for processing image data. This branch consists of four layers: the first layer is a 3x3 convolution, a fundamental building block of deep learning used for feature extraction. The second and third layers are convolutions fused with MBConv, a specialized and efficient convolutional layer design designed to reduce computation and the number of parameters. The fourth layer is a CA-Transformer, which incorporates channel attention and spatial attention mechanisms. Channel attention focuses primarily on the channel dimension of features, learning the importance weights of each channel, allowing the model to adaptively and selectively focus on features from different channels. This mechanism enhances the model's ability to represent and utilize different features, thereby improving its robustness and representational power. On the other hand, spatial attention mechanisms primarily focus on the spatial dimension of feature points. By learning the weights of each spatial location, the model's ability to perceive local details and global context can be improved, thereby enhancing its performance in handling spatially related tasks. Finally, by fusing channel attention and spatial attention, the model's expressive power is further enhanced. The feature extraction branch based on GCN converts image data into graph data, which then undergoes three layers of graph convolution. The results from both parts are then fused to output the final classification result and confidence score.
[0040] The proposed GC-EfficientNet V2 model in this embodiment features three key improvements. First, a graph convolutional structure is introduced to capture global graph structure information. By combining GCN and CNN, local and global information can be better integrated, improving image classification performance, especially suitable for processing complex image data. Second, a portion of the original backbone structure is replaced with a CA-Transformer structure, which has stronger feature extraction capabilities, enhancing the model's generalization ability and improving performance. Finally, the traditional residual structure is improved by adding two learnable parameters to achieve dynamic feature fusion.
[0041] This embodiment innovatively integrates graph convolution structure with traditional convolution, as shown in the following structure: Figure 2 As shown, images possess spatial relationships and structure, which traditional convolution operations cannot directly capture. Graph convolution can effectively capture the structural information of an image through the connections between graphs, thereby improving classification accuracy.
[0042] This embodiment first converts the strawberry image into a graph structure, constructing an adjacency graph of the image. Nodes represent pixels in the image, and edges represent the relationships between them. This graph data structure is used to capture the feature relationships between adjacent pixels. The detailed process is as follows: Figure 4 As shown: First, pixels with a value greater than 102 are identified and added as nodes in the graph data, while pixels with a value less than 102 are removed. Throughout the image, nodes are numbered from 0 to N, where N represents the total number of nodes. Each node has two features: its x and y coordinates. Next, edge information needs to be obtained. All nodes are traversed, and the eight surrounding pixels of each node are searched. If a surrounding pixel is also a node (pixel value greater than 102), it is connected to the current node; otherwise, it is not connected. Through this process, two data sets are obtained: nodes and edges. The shape of a node is (N, 2), where N is the number of nodes in the graph, and 2 represents the number of features of the node. The shape of an edge is (M, 2), where M is the number of edges in the graph, and 2 represents the orientation of the edge.
[0043] This embodiment introduces a new attention mechanism into the CRATE structure, including channel attention and spatial attention, named CA-Transformer (structure as follows). Figure 5(As shown). Channel attention primarily focuses on the channel dimension of features. By learning the importance weights of each channel, the model can adaptively and selectively focus on features from different channels. This mechanism enhances the model's ability to represent and utilize different features, thereby improving its robustness and representational power. On the other hand, spatial attention primarily focuses on the spatial dimension of feature points. By learning the weights of each spatial location, it improves the model's perception of local details and global context, thus enhancing its performance in spatially relevant tasks. Finally, by fusing channel attention and spatial attention, the model's expressive power is further enhanced.
[0044] This embodiment introduces an improved residual structure in the second and third layers of the feature extraction branch based on CNN and CA-Transformer. By adding two learnable parameters to the traditional residual structure, dynamic feature fusion is achieved, such as... Figure 6 As shown, traditional residual structures have achieved significant success in deep learning by introducing skip connections to address the vanishing gradient problem, effectively promoting model convergence and training. However, traditional residual structures use simple addition operations in each skip connection, lacking the ability to model complex relationships between features. To address this issue, this embodiment introduces learnable parameters into the structure and multiplies them by the two branches respectively, thereby enhancing the model's ability to model relationships between features.
[0045] The softmax activation function is used to normalize the learning parameters, ensuring that their values are between 0 and 1 and that their sum is 1, as shown in equation (1). This design allows the learning parameters to dynamically allocate the importance of different feature channels and can be adaptively adjusted according to task requirements. It introduces interactions and constraints between branches, enabling the model to better capture the interactions between features.
[0046]
[0047] Wherein, Softmax(x) i () represents the SoftMax value of the i-th element in the input vector x, where x i Let exp(x) represent the i-th element in the input vector x. j ) represents the exponential function of the vector elements corresponding to element j.
[0048] Experiments on a rotten strawberry classification dataset demonstrate that the proposed residual structure with learning parameters improves model performance compared to traditional residual structures. Experimental results show that this structure can enhance model accuracy and generalization ability without significantly increasing model parameters.
[0049] During training, the data undergoes forward propagation, and the model continuously learns and optimizes the feature data through backpropagation. The unfolded data passes through a fully connected layer, and the classification module ultimately outputs the classification results, covering two categories: intact and rotten strawberries, along with their confidence scores. After completion, the model and its parameter configuration are saved.
[0050] The specific training process is as follows:
[0051] 1. During the data preprocessing stage, perform random image flipping with a 50% probability.
[0052] 2. This invention uses GC-EfficientNet V2, which integrates graph convolutional networks, CA-Transformer, and an improved residual structure.
[0053] 3. Employ the cross-entropy loss function and use the SGD optimizer to minimize the loss function.
[0054] 4. Train the model on the prepared dataset, including two phases: forward propagation and back propagation. In the forward propagation phase, the data passes through the model, and the model then outputs a prediction. In the back propagation phase, the error between the prediction and the actual value is calculated, and the model weights are adjusted by an optimizer to reduce the error.
[0055] 5. The learning rate is set to 0.1, the weight decay factor is set to 0.0001, the number of training epochs is 100, the momentum is set to 0.9, and the batch size is set to 16.
[0056] Step 4: Collect strawberry photos and input them into the GC-EfficientNetV2 classification model obtained in Step 3. The classification model will output the classification results.
[0057] Based on the above classification method, a series of experiments were conducted, and the model proposed in this embodiment was compared with the model in the prior art to obtain data graphs. The specific analysis is as follows:
[0058] Figure 7 The images shown are heatmaps of a subset of the data; (a-1, b-1, c-1) are the original image data, and (a-2, b-2, c-2) are heatmaps generated using the Grad-CAM algorithm. All three images are of rotten strawberries. Comparing the original images with the model's heatmaps shows that the model proposed in this embodiment successfully identifies the rotten parts of the strawberries, providing important and accurate feature information for subsequent classification. Figure 7 The convolutional features of sample (b) are visualized, and the results are as follows: Figure 8 As shown, from Figure 8As can be seen, convolutional layers extract features such as edges, contours, and lines from the input image, which are clearly visible in the feature map. With increasing network layers, deeper convolutions extract more complex features compared to shallower convolutions. This phenomenon can be attributed to the hierarchical representation capabilities of deep neural networks. Shallow convolutional layers primarily focus on low-level image features, such as edges and textures. As information propagates through the network to deeper convolutional layers, the neural network gradually extracts higher-level feature representations through multiple non-linear transformation layers. Deep convolutional layers can capture more abstract and semantic features, such as the shape and structure of objects, as well as higher-level semantic information.
[0059] As the number of layers in a deep neural network increases, the maximum entropy also gradually increases (e.g., Figure 9 As shown in the figure, this demonstrates that the model can learn more information from the rotten strawberry classification dataset, exhibiting stronger representation and learning capabilities, and better capturing the complex structures and features among strawberries. Compared to shallow models, deep neural networks can gradually extract higher-level feature representations through multiple nonlinear transformation layers, thus better adapting to the complexities of the sorting process.
[0060] from Figure 10 As observed, the improved model exhibited extremely high accuracy in the early stages of training, and the accuracy maintained a rapid rate of improvement as training progressed. Furthermore, the improved model achieved higher accuracy compared to other models. Through these comparative experiments, this study validated the superior performance of the GC-EfficientNet v2 model in the strawberry classification task, providing strong support for further promoting the application of deep learning models in the agricultural field.
[0061] Figure 11 The graph shows the accuracy changes of the model in this embodiment and the baseline model as a function of the number of training epochs, illustrating how the accuracy of different models changes during training. The horizontal axis represents the number of training epochs; the vertical axis represents accuracy. There are five lines in the graph, representing five different models: 1. Blue line represents the EfficientNet V2-s model. 2. Orange line represents the EfficientNet V2-s+GCNs model. 3. Green line represents the EfficientNet V2-s+GCNs+CA-Transformer model. 4. Red line represents the EfficientNet V2-s+GCNs+CA-Transformer+Residual model. 5. Purple line represents the GC-EfficientNet V2 model. Based on the final training results, GC-EfficientNetV2 achieved the highest accuracy.
[0062] Figure 12This is the confusion matrix for this embodiment. This figure shows the best model performance on the validation set after training. The data in the figure reveals the model's classification performance on the validation set, including the ratio of correct to incorrect recognitions.
[0063] Information entropy is used to thoroughly examine the model's feature extraction capabilities. To evaluate the performance of the deep learning model, this embodiment conducts comparative experiments, comparing the improved model GC-EfficientNet v2 with other mainstream models. Detailed results are shown in Table 1, aiming to highlight the performance advantages of the GC-EfficientNet v2 model.
[0064] First, GC-EfficientNet v2 was compared with traditional convolutional neural network models (such as VGG, InceptionV3, and ResNet) and the Transformer-based Vit model. The results show that GC-EfficientNet v2 achieved higher classification accuracy on the self-built rotten strawberry classification dataset. Second, this embodiment also compared GC-EfficientNet v2 with benchmark models. The results show that the improved model achieved a 1.86% improvement in accuracy and a 1.49% improvement in recall compared to the original model. Furthermore, it achieved superior results using only 9.7% of the parameters of the EfficientNetV2-m model, thus demonstrating the effectiveness of the improvement strategy.
[0065] Table 1 Comparison of the classification performance of rotten strawberries using different methods
[0066]
[0067] To evaluate the impact of the added graph convolution, CA-Transformer, and improved residual structure on the classification performance of EfficientNet V2, ablation experiments were conducted in this embodiment. The results are shown in Table 2. In Table 2, 1 is the official EfficientNetV2-s model, 2 is the model with GCN added to EfficientNet V2-s, 3 is the model with CA-Transformer added to EfficientNet v2-s, and 5 is the GC-EfficientNet v2 model proposed in this invention. The data in Table 2 show that adding graph convolution to the original model improved accuracy by 0.93%, and introducing the CA-Transformer structure improved accuracy by 1.31%. When using ordinary residuals, the model accuracy was 98.13%, and the improved residuals resulted in an improvement of 0.47%, with a corresponding improvement in recall. The accuracy curves of each improved model as a function of training epochs are shown below. Figure 10 As shown. According to Figure 11 The confusion matrix results show that the classification accuracy of intact strawberries reached 98.22%, while the classification accuracy of rotten strawberries was as high as 98.98%, which meets the requirements of real-world production environments.
[0068] Table 2 Ablation Experiment
[0069]
[0070] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its spirit and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.
Claims
1. A method for classifying rotten strawberries based on the GC-EfficientNet V2 model, characterized in that, include: Step 1: Collect photos of strawberries, including those in good condition and those in rotten condition, and manually label the collected photos. Use the manually labeled strawberry photos as the dataset. Step 2: Divide the dataset obtained in Step 1 into a training set and a validation set using the 5-fold cross-validation method; Step 3: Construct the GC-EfficientNet V2 model. Train the GC-EfficientNet V2 model using the training set obtained in Step 2. Test the performance of the GC-EfficientNet V2 model using the validation set based on the cross-validation method. Finally, obtain the GC-EfficientNet V2 classification model. Step 4: Collect strawberry photos and input them into the GC-EfficientNet V2 classification model obtained in Step 3. The classification model will output the classification results. The GC-EfficientNet V2 model consists of two feature extraction branches: one based on CNN and CA-Transformer, and the other based on GCN. The feature extraction branch based on CNN and CA-Transformer is responsible for processing image data, while the feature extraction branch based on GCN converts the image data into graph data and performs three layers of graph convolution. The results of the two feature extraction branches are fused to output the final classification result and confidence score. The feature extraction branch based on CNN and CA-Transformer consists of four layers: the first layer is a 3x3 convolution for feature extraction; the second and third layers are convolutions fused with MBConv to reduce computation and the number of parameters; the fourth layer is CA-Transformer, which introduces new attention mechanisms in the CRATE structure, including channel attention and spatial attention. The second and third layers of the feature extraction branches based on CNN and CA-Transformer introduce an improved residual structure; The improved residual structure is achieved by adding two learning parameters to the traditional residual structure and multiplying the two learning parameters by the features extracted by the two feature extraction branches, respectively.
2. The method for classifying rotten strawberries based on the GC-EfficientNet V2 model according to claim 1, characterized in that, The channel attention focuses on the channel dimension of the feature. By learning the importance weight of each channel, the model can adaptively and selectively focus on the features of different channels. Spatial attention mechanisms focus on the spatial dimension of feature points. By learning the weight of each spatial location, they enhance the model's ability to perceive local details and global context, thereby improving the model's performance when handling spatially related tasks.
3. The method for classifying rotten strawberries based on the GC-EfficientNet V2 model according to claim 1, characterized in that, The two learning parameters are normalized using the softmax activation function, and the specific calculation formula is as follows: in, This represents the SoftMax value of the i-th element in the input vector x. Let exp(x) represent the i-th element in the input vector x. j ) represents the exponential function of the vector elements corresponding to element j.