Rice seed image classification method and system based on improved mobile convolutional neural network, and application

Through the improved mobile convolutional neural network, combined with channel rearrangement operation, mixed precision training and cosine annealing learning rate scheduling, the problems of low efficiency and high computational complexity of traditional rice seed recognition methods are solved, and high-precision and fast single-grain rice seed classification is achieved.

CN120088550AInactive Publication Date: 2025-06-03RICE RES INST GUANGDONG ACADEMY OF AGRI SCI

Patent Information

Application Number
CN202510157597.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-06-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional rice seed recognition methods have low efficiency and high error rate, and existing deep learning-based methods have high computational complexity, making it difficult to achieve fast and high-precision single-grain rice seed classification.

Method used

The improved mobile convolutional neural network (ImprovedMobileCNN) is adopted to build a lightweight deep neural network model to achieve the precise classification of single rice seeds by introducing optimization technologies such as channel rearrangement operation, mixed precision training and cosine annealing learning rate scheduling.

Benefits of technology

High-precision rice seed classification has been achieved, using only 1.8 million parameters, which is reduced by about 91.7% compared with the traditional ResNet34 network, achieving a classification accuracy of nearly 100%, and the training speed is about 1-2.7 times higher.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088550A_ABST
    Figure CN120088550A_ABST
Patent Text Reader

Abstract

The invention provides a rice seed image classification method and system based on an improved mobile convolutional neural network and application. According to the method, feature fusion is enhanced by introducing a channel rearrangement operation mechanism, and precise classification of single rice seeds is realized by adopting optimization technologies such as mixed precision training and cosine annealing learning rate scheduling. According to the method, a data set containing 112000 rice seed images of seven different varieties is constructed, the verification accuracy rate on the large-scale data set reaches 99.24%, and the test accuracy rate reaches 99.39%. The method is particularly suitable for rapid classification of different varieties of rice seeds or rice grains with high appearance similarity, has the characteristics of light weight, high efficiency and high precision, provides a rapid and accurate solution for rice seed variety identification, and can be widely applied to the fields of crop breeding and seed quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of artificial intelligence, machine vision, and agricultural intelligent detection, and particularly relates to a method for classifying rice seed images based on deep learning, and especially a method for rapidly and accurately classifying highly similar rice seeds or rice grains by using an improved mobile convolutional neural network. Background Art

[0002] Rice, as the most important food crop globally, has a planting area of over 160 million hectares and an annual output of over 750 million tons, providing food for nearly half of the world's population. Rice production plays a crucial role in ensuring national food security. Seeds are the foundation of rice production, and seed quality directly affects the yield and quality of rice and can also lead to accelerated variety degradation. However, for a long time, the mixing of rice varieties has been one of the key factors restricting the high-yield and high-quality development of rice. The mixing of rice varieties will directly lead to a decrease in the purity of rice seeds, a reduction in the yield per unit area, and a deterioration in the quality of rice, causing immeasurable losses to breeding research and the seed industry; the classification of rice seeds is a very important task in rice production.

[0003] However, traditional rice seed recognition methods mainly rely on expert experience judgment or traditional image processing techniques, and the traditional rice seed recognition methods have the following problems: (1) The manual recognition method relies on expert experience, with low efficiency and being easily affected by subjective factors; (2) Traditional machine vision methods require complex feature engineering and have insufficient accuracy when dealing with highly similar varieties; (3) Existing deep learning-based methods mostly adopt complex network structures, consuming a large amount of computing resources. For example, methods based on traditional CNNs such as VGG and ResNet have a large number of parameters and high computational complexity; methods based on lightweight networks such as MobileNet, although reducing the amount of computation, have insufficient classification accuracy; methods based on transfer learning are difficult to fully adapt to the characteristic features of rice seeds; most methods require stacked images of seeds and have poor single-grain recognition effects. (4) There is a lack of an efficient recognition method for single-grain rice seed images, making it difficult to meet the actual needs of rapid and high-precision sorting.

[0004] With the development of deep learning technology, convolutional neural networks have become the core technology for image recognition due to their excellent feature learning ability, and their structures are suitable for recognizing complex models, such as the recognition of rice grain and seed morphology. However, existing network models have problems such as high computational complexity and long training time in practical applications. Therefore, there is an urgent need for a rice seed recognition method that can both ensure classification accuracy and improve processing efficiency. Summary of the Invention

[0005] Aiming at the problems of traditional rice seed classification methods relying on manual vision and stacked seed images, with low efficiency and high error rates, the present invention provides a rice seed image classification method based on an improved mobile convolutional neural network. By introducing channel rearrangement operations to enhance feature fusion and adopting optimization techniques such as mixed-precision training and cosine annealing learning rate scheduling, accurate classification of single rice seeds is achieved. Through an optimized network structure design, this method can achieve high-precision classification with only 1.8 million parameters, reducing the number of parameters by about 91.7% compared to the traditional ResNet34 network. It reaches a classification accuracy of nearly 100% on a public dataset of 75,000 images, and the training time is only 1138.20 seconds, with the training speed being about 1 - 2.7 times faster than models such as Mobilenet. The present invention constructs a dataset containing 112,000 rice seed images of 7 different varieties, with a validation accuracy of 99.24% and a test accuracy of 99.39% on this large-scale dataset. This method is particularly suitable for the rapid classification of different varieties of rice seeds or rice grains with high appearance similarity, featuring lightweight, high efficiency, and high precision, providing a fast and accurate solution for rice seed variety identification and can be widely applied in the fields of crop breeding and seed quality detection.

[0006] The technical solution of the present invention is as follows.

[0007] A rice seed image classification method based on an improved mobile convolutional neural network specifically includes the following steps:

[0008] Step S1: Obtain the image to be classified;

[0009] Step S2: Preprocess the obtained image to be classified;

[0010] Step S3: Construct an image dataset based on the preprocessed image;

[0011] Step S4: Construct a deep neural network model with ImprovedMobileCNN as the backbone network;

[0012] Step S5: Train the neural network model;

[0013] Step S6: Classify the image to be classified.

[0014] In the above method, in step S1, 250x250 pixel images of single rice seeds are batch-shot using a smartphone or a digital camera.

[0015] In the above method, in step S2, the preprocessing of the obtained image specifically includes the following steps:

[0016] Step S21: Uniformly adjust the image to a size of 128×128;

[0017] Step S22: Convert the image into a tensor format;

[0018] Step S23: Perform normalization using the mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225].

[0019] In the above method, in step S3, the construction of the image dataset specifically includes:

[0020] Step S31: Divide the dataset into a training set, a validation set, and a test set in a ratio of 7:2:1;

[0021] Step S32: Process the data in batches through a data loader, where the batch_size is set to 64 and the number of worker processes is set to 4.

[0022] In the above method, in step S4, it specifically includes:

[0023] Step S41: Construct an initial convolutional layer, using a 3×3 convolutional kernel with 32 output channels and a stride of 2;

[0024] Step S42: Construct 7 groups of inverted residual blocks, with the following configurations:

[0025] The first group: expansion ratio 1, output channels 16, number of blocks 1, stride 1;

[0026] The second group: expansion ratio 6, output channels 24, number of blocks 2, stride 2;

[0027] The third group: expansion ratio 6, output channels 32, number of blocks 3, stride 2;

[0028] The fourth group: expansion ratio 6, output channels 64, number of blocks 4, stride 2;

[0029] The fifth group: expansion ratio 6, output channels 96, number of blocks 3, stride 1;

[0030] The sixth group: expansion ratio 6, output channels 160, number of blocks 3, stride 2;

[0031] The seventh group: expansion ratio 6, output channels 320, number of blocks 1, stride 1;

[0032] Step S43: Construct a 1×1 convolutional layer with 1280 channels for feature integration;

[0033] Step S44: Construct a classification head structure, including a Dropout layer with a probability of 0.2 and a fully connected layer.

[0034] In the above method, in step S42, the inverted residual block further includes a channel rearrangement operation, which specifically includes the following steps: (1) Group the input feature map by channel dimension; (2) Perform a transpose operation on the grouped features; (3) Re-integrate the transposed features.

[0035] In the above method, in steps S41 to S44, the network parameter initialization method includes: (1) Use He initialization for the weights of the convolutional layer; (2) Initialize the weights of the batch normalization layer to 1 and the biases to 0; (3) Initialize the weights of the fully connected layer with a normal distribution having a mean of 0 and a standard deviation of 0.01, and initialize the biases to 0.

[0036] In the above method, in step S5, the model training specifically includes:

[0037] Step S51: Use the AdamW optimizer with an initial learning rate of 0.001 and a weight decay of 0.01;

[0038] Step S52: Use the cosine annealing learning rate scheduling strategy with an initial period T0 of 5, a period doubling factor T_mult of 2, and a minimum learning rate of 1e-6;

[0039] Step S53: Use a cross-entropy loss function with a label smoothing coefficient of 0.1;

[0040] Step S54: Implement mixed-precision training and use a gradient scaler for loss calculation;

[0041] Step S55: Set an early stopping mechanism to prevent overfitting.

[0042] In the above method, the early stopping mechanism in step S55 specifically includes: (1) Set the patience parameter patience to 15; (2) Monitor the validation set loss value; (3) Stop training when the validation set loss value has not improved for patience consecutive times; (4) Save the model parameters with the highest validation accuracy.

[0043] Step S6 specifically includes: (1) Load the trained optimal model parameters; (2) Perform the same preprocessing on the input image as in the training stage; (3) Perform forward inference in mixed-precision mode; (4) Output the predicted class probability distribution and the final classification result.

[0044] The present invention also provides a computer system, including: a processor, a memory, and a computer program stored in the memory and running on the processor, wherein: the processor includes a GPU device supporting CUDA acceleration; when the program is executed by the processor, it implements a rice seed image classification method based on an improved mobile convolutional neural network.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] (1) The improved mobile convolutional neural network (ImprovedMobileCNN) proposed by the present invention achieves a classification accuracy of 99.35% in the high-similarity rice variety recognition task; compared with MobileNetV2, the verification accuracy is increased by about 14% and the training speed is increased by about 25%; compared with MobileNetV3, the training speed is increased by about 1 time under the condition of comparable accuracy.

[0047] (2) Through innovative network architecture design, the present invention can achieve high-precision classification with only 1.8 million parameters, reducing the number of parameters by 49.1% compared with MobileNetV2 (about 3.54 million parameters). Specifically, it includes:

[0048] · Design an improved inverted residual module, and combine 3×3 depthwise separable convolution for feature extraction;

[0049] · Adopt a skip connection structure to optimize information flow;

[0050] · Introduce a channel rearrangement operation mechanism to improve the model's recognition ability for subtle features;

[0051] · Adopt a multi-level cascade structure to achieve the extraction and fusion of multi-scale features.

[0052] (3) The present invention adopts a mixed-precision training strategy to significantly reduce the video memory occupancy, and combines the cosine annealing learning rate scheduling and early stopping strategy to effectively improve the model convergence speed and generalization performance.

[0053] (4) The method of the present invention has strong practicability:

[0054] · It can be directly applied to the rapid classification of single rice seeds;

[0055] · It is suitable for deployment on mobile devices with limited computing resources;

[0056] · It has strong environmental adaptability and anti-interference ability, and high reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is the overall flowchart of the method of the present invention.

[0058] Figure 2 are the seed pictures for making the dataset and the seed pictures to be classified, where the left is the seed matrix picture and the right is a random picture example of 7 kinds of rice seeds.

[0059] Figure 3 is the structural schematic diagram of the inverted residual module of the present invention.

[0060] Figure 4 Schematic diagram of the channel rearrangement operation of the present invention.

[0061] Figure 5 Overall structure diagram of the ImprovedMobileCNN network of the present invention.

[0062] Figure 6 Confusion matrix diagram of the method of the present invention on the test data set. Detailed implementation manners

[0063] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. As Figures 1 to 6 shown, the present invention is a rice seed image classification method based on an improved mobile convolutional neural network. The following uses specific embodiments to elaborate on the specific working methods.

[0064] Embodiment 1

[0065] Step S1: Acquisition of single rice seed image data.

[0066] Select 7 excellent varieties of Guangdong rice seeds: Yuehe Simiao (YHSM), Nanguang Heinuo (NGHN), Yuenuo 2 Hao (YN2H), Yuewangxiangzhan (YWXZ), Xiangyaxiangzhan (XYXZ), Heguang Simiao (HGSM), Yuexiang 430 (YX430). All seeds were harvested in the late season of 2023, with a water content of approximately 13%. Randomly select 1500 normally mature seeds (excluding deformed seeds such as empty and shriveled grains) for each variety. Every 100 seeds are grouped and arranged into a 10×10 matrix on a pure black background board. Seed placement positions are pre-printed on the black background board to ensure neatness. The mobile phone is fixed on a bracket at a height of 40 cm to ensure vertical shooting. Use a smartphone to shoot in high-pixel mode (50 million pixels), with other parameters default. Shoot 15 groups for each variety, and a total of 75 high-definition seed matrix images are obtained, as shown in Figure 2 the left.

[0067] Step S2: Image preprocessing.

[0068] Use Photoshop version 2024.25.9 to preprocess the collected original images: unify the background to pure black (RGB: 0, 0, 0); adjust the brightness and contrast; apply the smart sharpening filter to improve clarity; divide each seed matrix picture (10×10) into 100 single-seed pictures; ensure that the seeds are located in the center of each divided picture. Finally, 10,500 single-seed pictures with a size of 500×500 pixels are obtained, as shown in Figure 2 the right.

[0069] Step S3: Construction of a single rice seed image data set

[0070] Construct a single rice seed image dataset. Use an algorithm to crop single-seed pictures from 500×500 pixels to 128×128 pixels, and keep the seeds in the center of the pictures. By randomly rotating each picture at 10 different angles, the 10,500 pictures are augmented to 112,500 pictures. After data cleaning, pictures with poor effects and distortion are removed, leaving 112,000 pictures, 16,000 for each variety. The data is divided into a training set, a test set, and a validation set according to the ratio of 7:2:1.

[0071] Step S4: Construct an improved mobile CNN network (ImprovedMobileCNN)

[0072] As Figure 5 shown, the ImprovedMobileCNN network proposed by the present invention adopts a lightweight depthwise separable convolution structure, and realizes efficient and accurate rice seed classification through innovative network architecture design. The specific implementation steps of the network are as follows:

[0073] Step S41 Network overall architecture design, the network consists of four functional modules:

[0074] 1. Feature extraction front end:

[0075] · Use a 3×3 convolutional layer (stride = 2) for initial feature extraction;

[0076] · The number of input channels is 3 (RGB image), and the number of output channels is 32;

[0077] · Use BatchNorm2d and ReLU6 activation functions;

[0078] 2. Feature learning backbone:

[0079] · As Figure 3 , it is composed of 7 groups of improved inverted residual blocks in series;

[0080] · Each group of blocks adopts different parameter configurations to meet the requirements of feature extraction at different levels;

[0081] · As Figure 4 , introduce the channel shuffle operation to promote feature interaction;

[0082] 3. Feature integration module:

[0083] · Use a 1×1 convolutional layer for channel dimension reduction and feature integration;

[0084] · The number of output channels is 1280;

[0085] · Adopt global average pooling to compress the spatial dimension;

[0086] 4. Classification Decision Module:

[0087] · The Dropout layer (p = 0.2) prevents overfitting;

[0088] · The fully connected layer maps to the number of class dimensions;

[0089] · Softmax outputs the class probability distribution;

[0090] Step S42 Core Innovation Module Design

[0091] 1. Improved Inverted Residual Module:

[0092] · Input parameters include: number of input channels (inp), number of output channels (oup), stride, and expansion ratio (expand_ratio);

[0093] · First, calculate the hidden layer dimension: multiply the number of input channels by the expansion ratio and round it;

[0094] · Expand the feature space through 1×1 pointwise convolution to expand the input channels to the hidden layer dimension;

[0095] · Use 3×3 depthwise separable convolution for feature extraction, and set the groups parameter to hidden_dim to achieve grouped convolution;

[0096] · Finally, use 1×1 pointwise convolution to compress the features back to the required number of output channels;

[0097] · When the number of input and output channels is equal and the stride is 1, add a residual connection to achieve feature reuse;

[0098] 2. Channel Shuffle Operation Mechanism:

[0099] · Input parameters are the feature map tensor x and the number of groups groups;

[0100] · First, obtain the dimension information of the input tensor: batch size (N), number of channels (C), height (H), and width (W);

[0101] · Calculate the number of channels in each group: divide the total number of channels by the number of groups;

[0102] · Reshape the tensor into a 5D form of (N, groups, channels_per_group, H, W);

[0103] · Swap the positions of the 2nd and 3rd dimensions to achieve channel mixing between different groups;

[0104] · Finally, reshape the tensor back to its original 4D form (N, C, H, W);

[0105] · Ensure memory continuity through the contiguous() operation;

[0106] 3. Multi-level cascade structure design:

[0107] · Group 1: [t = 1, c = 16, n = 1, s = 1] for shallow feature extraction;

[0108] · Groups 2-3: [t = 6, c = 24 / 32, n = 2 / 3, s = 2] for middle-level feature learning;

[0109] · Groups 4-5: [t = 6, c = 64 / 96, n = 4 / 3, s = 2 / 1] for deep feature fusion;

[0110] · Groups 6-7: [t = 6, c = 160 / 320, n = 3 / 1, s = 2 / 1] for high-level semantic features;

[0111] Where t is the expansion ratio, c is the number of output channels, n is the number of blocks, and s is the stride of the first block.

[0112] Step S43 Network optimization strategy

[0113] 1. Depthwise separable convolution optimization:

[0114] · Decompose the standard convolution into depthwise convolution and pointwise convolution;

[0115] · Greatly reduce the number of parameters and computational volume;

[0116] · Maintain high feature extraction ability;

[0117] 2. Skip connection structure:

[0118] · Enable when stride = 1 and the number of input and output channels is equal;

[0119] · Alleviate the problem of gradient vanishing;

[0120] · Promote feature reuse;

[0121] 3. Channel shuffle optimization:

[0122] · Perform channel shuffle between each stage;

[0123] · Facilitate information interaction between different feature groups;

[0124] · Enhance feature expression ability;

[0125] Step S5: Network training process

[0126] Step S5.1 Parameter Initialization

[0127] 1. Convolutional Layer Initialization:

[0128] For each convolutional layer in the network, the He initialization method is used to initialize the weights, and the standard deviation of the initialization parameters is calculated using the fan_out mode. This method is particularly suitable for the ReLU activation function and helps to improve the stability of training.

[0129] 2. Batch Normalization Layer Initialization:

[0130] For all batch normalization layers, the weight parameters are initialized to 1.0 and the bias parameters are initialized to 0. This initialization method ensures that in the initial stage of training, the batch normalization layer will not overly change the distribution of the input features.

[0131] 3. Fully Connected Layer Initialization:

[0132] For the fully connected layer of the classification layer, the weights are initialized with a normal distribution with a mean of 0 and a standard deviation of 0.01, and the bias term is initialized to 0. These relatively small initialization values help to prevent gradient explosion in the initial stage of training.

[0133] S52 Training Strategy Design

[0134] 1. Optimizer Configuration:

[0135] The AdamW optimizer is adopted, with the initial learning rate set to 0.001 and the weight decay coefficient to 0.01. This optimizer combines the adaptive learning rate feature of the Adam optimizer and the regularization effect of weight decay.

[0136] 2. Learning Rate Scheduling:

[0137] Implement the cosine annealing learning rate scheduling strategy, with the initial period T 0 set to 5 epochs, the multiplier factor T_mult set to 2, and the minimum learning rate set to 1e-6. This scheduling method can effectively explore the parameter space during training.

[0138] 3. Loss Function Design:

[0139] Use the cross-entropy loss function with label smoothing, and the smoothing coefficient is set to 0.1. The label smoothing technique improves the generalization ability of the model by softening the target distribution.

[0140] 4. Regularization Techniques:

[0141] · Add a dropout layer before the fully connected layer, with a dropout rate of 0.2;

[0142] · Set the weight decay to 0.01 in the optimizer;

[0143] · Use label smoothing in the loss function with a coefficient of 0.1;

[0144] The training process in step S53 is implemented

[0145] 1. Mixed-precision training:

[0146] Create a gradient scaler for mixed-precision training. Enable automatic mixed-precision calculation during forward propagation, calculate the output and obtain the loss value, then scale the loss and perform backpropagation, and finally update the model parameters.

[0147] 2. Early stopping mechanism:

[0148] Implement the early stopping mechanism. Determine whether to terminate the training early by monitoring the improvement of the validation loss. Specifically, set the patience value to 15 epochs and the minimum improvement threshold (min_delta) to 0.001. During the training process, record the current validation loss at the end of each epoch and compare it with the historical best validation loss. If the current validation loss fails to decrease by more than the minimum improvement threshold relative to the historical best value, the counter is incremented by 1; if the validation loss decreases by more than the threshold relative to the historical best value, it is updated to the new best value and the counter is reset to 0. When the counter accumulates to the set patience value (i.e., the validation loss has not been effectively improved for 15 consecutive epochs), trigger the early stopping mechanism and terminate the training to prevent the model from overfitting and ensure sufficient training to the convergence state.

[0149] 3. Model saving strategy:

[0150] Evaluate the performance of the model on the validation set at the end of each training epoch. When a better validation set accuracy is obtained, update the record of the best accuracy and save the current model parameters.

[0151] Through the above detailed network design and training strategies, the present invention realizes an efficient and accurate rice seed classification model. While maintaining a low computational complexity, the model achieves excellent classification performance through innovative architecture design and optimization strategies.

[0152] Step S6: Classify the images to be classified (112K dataset), and the result is as Figure 6 shown in the confusion matrix, and use 500 independent test samples to verify the performance of the trained model. The results show that the average classification accuracy of the model for 7 rice varieties reaches over 98%.

[0153] Through the above steps, an intelligent rice seed classification system based on an improved mobile CNN network is successfully realized. The system has high accuracy, fast recognition speed and good practicability, providing effective technical support for the identification and management of rice germplasm resources.

[0154] Table 1 Hardware specifications and classifier network parameters used in this embodiment

[0155]

[0156] Table 2 ImprovedMobileCNN network structure and parameters

[0157]

[0158] Table 3 Classification accuracies of different neural networks on the custom 112K dataset under the same conditions

[0159]

[0160] Table 4 Classification accuracies of different neural networks on the public dataset (75,000 pics) under the same conditions

[0161]

[0162] The above embodiments are preferred embodiments of the present invention. However, the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.

Claims

1. A rice seed image classification method based on an improved mobile convolutional neural network, characterized in that: The specific steps include: Step S1: Obtain the image to be classified; Step S2: preprocessing the acquired image to be classified; Step S3: constructing an image dataset based on the preprocessed images; Step S4: construct a deep neural network model based on ImprovedMobileCNN as the backbone network; Step S5: training the neural network model; Step S6: classify the image to be classified.

2. A rice seed image classification method based on an improved mobile convolutional neural network as claimed in claim 1, characterized in that: In step S2, preprocessing the acquired image specifically includes the following steps: Step S21: resize the image to 128×128; Step S22: converting the image into a tensor format; Step S23: Use the mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225] for standardization.

3. The rice seed image classification method based on the improved mobile convolutional neural network as claimed in claim 1, characterized in that: In step S3, the construction of the image dataset specifically includes: Step S31: Divide the data set into a training set, a validation set, and a test set in a ratio of 7:2:1; Step S32: batch process the data through the data loader, where batch_size is set to 64 and the number of working processes is set to 4.

4. The rice seed image classification method based on the improved mobile convolutional neural network as claimed in claim 1, characterized in that: Step S4 specifically includes: Step S41: construct an initial convolution layer, using a 3×3 convolution kernel with 32 output channels and a step size of 2; Step S42: construct 7 groups of inverted residual blocks, which are configured as follows: The first group: expansion ratio 1, output channels 16, number of blocks 1, step size 1; The second group: expansion ratio 6, output channels 24, number of blocks 2, step size 2; The third group: expansion ratio 6, output channels 32, number of blocks 3, step size 2; Group 4: expansion ratio 6, output channels 64, number of blocks 4, step size 2; Group 5: expansion ratio 6, output channels 96, number of blocks 3, step size 1; Group 6: expansion ratio 6, output channels 160, number of blocks 3, step size 2; Group 7: expansion ratio 6, output channels 320, number of blocks 1, step size 1; Step S43: construct a 1×1 convolutional layer with 1280 channels for feature integration; Step S44: construct a classification head structure, including a Dropout layer with a probability of 0.2 and a fully connected layer; In step S42, the inverted residual block further includes a channel rearrangement operation, which specifically includes the following steps: (1) Group the input feature maps by channel dimension; (2) Perform transposition operation on the grouped features; (3) Reintegrate the transposed features.

5. The rice seed image classification method based on the improved mobile convolutional neural network as claimed in claim 1, characterized in that: In step S5, model training specifically includes: Step S51: using the AdamW optimizer, with an initial learning rate of 0.001 and a weight decay of 0.01; Step S52: using the cosine annealing learning rate scheduling strategy, with an initial period T0 of 5, a period multiplication factor T_mult of 2, and a minimum learning rate of 1e-6; Step S53: using a cross entropy loss function with a label smoothing coefficient of 0.1; Step S54: Implement mixed precision training and use a gradient scaler to calculate the loss; Step S55: Setting an early stopping mechanism to prevent overfitting.

6. The rice seed image classification method based on the improved mobile convolutional neural network as claimed in claim 4, characterized in that: In steps S41 to S44, the network parameter initialization method includes: (1) Use He to initialize the convolutional layer weights; (2) Initialize the weight of the batch normalization layer to 1 and the bias to 0; (3) The weights of the fully connected layer are initialized with a normal distribution with a mean of 0 and a standard deviation of 0.01, and the bias is initialized to 0.

7. The rice seed image classification method based on the improved mobile convolutional neural network as claimed in claim 5, characterized in that: The early stopping mechanism specifically includes: (1) Set the patience parameter to 15; (2) Monitor the validation set loss value; (3) Stop training when the validation set loss value does not improve for consecutive patience times; (4) Save the model parameters with the highest verification accuracy.

8. The rice seed image classification method based on improved mobile convolutional neural network as claimed in claim 1, characterized in that: Step S6 specifically includes: (1) Load the trained optimal model parameters; (2) Perform the same preprocessing on the input image as in the training phase; (3) Forward reasoning through mixed precision mode; (4) Output the predicted category probability distribution and final classification result.

9. The method according to any one of claims 1 to 8 is applied to rice seed image classification.

10. A computer system, characterized in that: include: A processor, a memory, and a computer program stored in the memory and running on the processor, wherein: the processor includes a GPU device supporting CUDA acceleration; when the program is executed by the processor, a rice seed image classification method based on an improved mobile convolutional neural network is implemented.

Citation Information

Patent Citations

  • Composite modulation signal blind identification method based on frequency domain data compression sensing

    CN117061289A

  • Unmanned aerial vehicle electric power inspection obstacle identification method based on visual deblurring

    CN117710840A

  • Method for predicting laboratory earthquake based on deep convolutional neural network

    CN118501946A

Cited By

  • Vegetable variety identification method and system based on deep learning, and medium

    CN120431570A