Grain condition detection method in grain transportation based on convolutional neural network optimization model

CN120409217BActive Publication Date: 2026-08-21NORTHEAST AGRICULTURAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510478001.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2026-08-21
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

经典的网络模型通常是由在数据和卷积神经网络方面都拥有丰富知识的专家人工设计,而专家经验难以泛化到所有场景

Benefits of technology

[0064] 1. This invention can achieve a balance between global and local search capabilities:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409217B_ABST
    Figure CN120409217B_ABST
Patent Text Reader

Abstract

A kind of grain condition detection method in grain transportation based on convolutional neural network optimization model, its specific steps are as follows: (1) parameter setting;(2) data set acquisition and processing;(3) model construction: improved multi-objective emperor penguin optimization algorithm is used to construct convolutional neural network regression model, model parameter quantity and the difference between model and actual value are used as optimization target, search space of multiple convolution module design algorithm is introduced by referring to the symmetrical down-sampling and up-sampling process of UNet model, a variable code length coding strategy, dynamic decoding strategy and individual updating strategy are proposed, the most suitable model structure for grain condition detection in grain transportation process is obtained;(4) output the model corresponding to the optimal individual.The method combines the advantages of intelligent optimization algorithm automatic optimization, the regression model built can better adapt to the task of grain condition detection in grain transportation process, ensure the monitoring accuracy, and significantly reduce the computing cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grain transportation technology, and in particular to a grain condition detection method in grain transportation based on a convolutional neural network optimization model. Background Technology

[0002] In recent years, with the rapid development of deep learning, it has been widely applied in various fields, such as computer vision, speech recognition, natural language processing, medical diagnosis, and precision agriculture. Along with the popularization of deep learning technology, its application in grain storage security is also increasing, but its application in grain storage security during grain transportation is still very limited.

[0003] The performance of convolutional neural networks (CNNs) largely depends on their structure and parameter settings, which exhibit significant performance differences when dealing with different datasets. Classical network models are typically designed manually by experts with extensive knowledge of both data and CNNs, but expert experience is difficult to generalize to all scenarios. For researchers lacking expertise in CNNs, optimizing and designing models is challenging, and the diversity and complexity of agricultural data further complicates this task. Therefore, researching how to optimize CNN structures and parameters for agricultural data using automated and intelligent methods is essential and meaningful for improving the accuracy of grain condition detection during grain transportation. Summary of the Invention

[0004] The technical problem to be solved by this invention is to address the shortcomings of existing technologies by providing a grain condition detection method based on a convolutional neural network optimization model. This method is a convolutional neural network optimization method based on a multi-objective emperor penguin optimization algorithm, which combines the advantages of intelligent optimization algorithms. By leveraging the global and local search capabilities of the algorithm, it can obtain a convolutional neural network model that is most suitable for grain condition detection during grain transportation, thereby ensuring high-precision detection results and effectively improving the quality and efficiency of grain condition detection during grain transportation.

[0005] The technical problem to be solved by this invention is achieved through the following technical solution. This invention is a grain condition detection method in grain transportation based on a convolutional neural network optimization model. The steps of this method are as follows:

[0006] (1) Parameter settings:

[0007] The Emperor Penguin optimization algorithm uses a population size of n, 20 iterations, a convolutional neural network regression model with 200 training epochs, a batch size of 32, an initial learning rate of 0.015, and a weight decay coefficient of 5 × 10⁻⁶. -5 The optimized algorithm is AdamW;

[0008] (2) Dataset collection and processing:

[0009] Sensors for measuring temperature and humidity are arranged in a 3×5 pattern at the center of the top of the cargo compartment of the transport vehicle. The data collected inside the transport vehicle includes temperature, humidity, grain temperature at each node of each row and column of each layer, average temperature, maximum temperature, minimum temperature of the entire grain pile, average temperature, maximum temperature and minimum temperature of each layer, and moisture content of the grain pile.

[0010] The collected data values ​​were labeled to create a grain condition detection dataset. Of this dataset, 70% was used for subsequent model training, 15% was used for model performance testing, and 15% was used for model validation.

[0011] (3) Model building:

[0012] An improved multi-objective emperor penguin optimization algorithm is used to construct a convolutional neural network regression model. The optimization objectives are the number of model parameters and the degree of difference between the predicted and actual values. By drawing on the symmetric downsampling and upsampling process of the UNet model, a search space for various convolutional module design algorithms is introduced. A variable code length encoding strategy, a dynamic decoding strategy, and an individual update strategy are proposed to obtain a model structure most suitable for grain condition detection during grain transportation.

[0013] (4) Output the model corresponding to the best individual as the grain condition detection model during grain transportation.

[0014] The technical problem to be solved by the present invention can also be further realized through the following technical solutions. For the grain condition detection method in grain transportation based on the convolutional neural network optimization model described above, different individuals are generated in step (3), and the improved emperor penguin optimization algorithm is used to update the individuals. The specific steps of individual generation and optimization are as follows:

[0015] Step 1: Initial iteration count gen=0, use variable code length encoding strategy to generate n individuals with different code lengths, as shown in equation (1):

[0016] (1)

[0017] In the formula, X i For the i-th individual in the population, rand(1, h) is an h-dimensional random vector between [0, 1], where the dimension h is a random integer between [5, 20], which determines the depth of the model;

[0018] Step Two: Dynamic Decoding Strategy: A dynamic decoding strategy is used to decode the encoded values ​​based on the component values ​​of different dimensions of individuals in the population, thus decoding each individual into a convolutional neural network regression model; where the encoded values... For individual Xi The s-th component, s = 1, 2, …, v, where v is a component of X. i The number of components in The calculation formula is shown in equation (2):

[0019] (2)

[0020] Where, x min It is individual X i The smallest component, x max It is individual X i The largest component;

[0021] Step 3: After decoding, multiple convolutional neural network regression models are generated. The model is trained using the parameter settings in step (1) and the dataset in step (2).

[0022] Step 4: Calculate the fitness value using a multi-objective function. The calculation formula is as follows:

[0023] (3)

[0024]

[0025] In the formula, p i MSE represents the number of model parameters corresponding to the i-th individual in the population. i The model corresponding to the i-th individual in the population represents the recognition error of grain condition detection during grain transportation; N represents the number of data points, y el y represents the true label of data e. e This is the prediction result of the CNN regression model for the e-th data point;

[0026] Step 5: Individuals perform population update operations and determine whether the individuals participating in the update are consistent. If they are consistent, update the individuals using the update operations of Adaptive Perturbation Search Strategy I, Dynamic Movement Strategy II, Random Movement Strategy III, and Adaptive Selection Strategy; if they are inconsistent, proceed to Step 6.

[0027] Step 6: Provide a subtraction and addition operation for individuals when the code lengths are inconsistent, and use the update operations of the adaptive perturbation search strategy I, dynamic movement strategy II, random movement strategy III and adaptive selection strategy in Step 5 to perform the update operation;

[0028] Step 7: The number of iterations gen = gen + 1. If gen satisfies the maximum iteration condition, output the model and detection value corresponding to the optimal individual and end the loop; otherwise, proceed to the next step.

[0029] Step 8: Return to Step 2 for dynamic decoding of the updated individuals; update the optimal individual and the population.

[0030] The technical problem to be solved by this invention can also be further achieved through the following technical solution: Regarding the grain condition detection method in grain transportation based on the convolutional neural network optimization model described above, in step five:

[0031] ① Adaptive Disturbance Movement Strategy I:

[0032] For the minimization problem, the update formula for the optimal individual in the population is as follows:

[0033] (4)

[0034] (5)

[0035] (6)

[0036] (7)

[0037] In the formula, For the optimal individual, t represents the current iteration number, D represents the dimension of the variable, q is a randomly generated D-dimensional 0-1 row vector, Ub is the upper bound row vector of the variable in D dimensions, Lb is the lower bound row vector of the variable in D dimensions, Maxg is the maximum number of iterations of the algorithm, β is the perturbation term, and λ is the adaptive change amount. This indicates that the elements at the same position of two vectors are multiplied together.

[0038] ②Dynamic movement strategy II:

[0039] A dynamic movement strategy based on individual dimension updates is given, and the improved individual update formula is shown in Equation (8).

[0040] (8)

[0041] (9)

[0042] In the formula, and It represents the optimal position in the memory of two randomly selected emperor penguins, where d represents... and The distance between;

[0043] ③ Random movement strategy III:

[0044] Emperor penguins move randomly, the algorithm has a large search range and strong global search capability, and the update formula is shown in equation (10);

[0045] (10)

[0046] (11)

[0047] In the formula, Individuals are randomly selected from the population. It is the i-th individual in the population. The optimal position in memory; a1 and a2 use formula (9), where a1 represents and The distance between them, a2 represents and The distance between;

[0048] ④ Adaptive selection strategy:

[0049] The probability of choice P v The calculation formula is shown in equation (12);

[0050] (12)

[0051] In the formula, t is the current iteration number, Maxg is the maximum number of iterations of the algorithm, v takes integer values ​​of 1, 2 and 3, and g is a power of 1, 0.8 and 0.6 respectively.

[0052] The technical problem to be solved by this invention can also be further achieved through the following technical solution: Regarding the grain condition detection method in grain transportation based on the convolutional neural network optimization model described above, in step six:

[0053] A. Subtraction operation

[0054] During the algorithm update process, when the code lengths of the two entities involved in the subtraction are inconsistent, the specific implementation steps of the two entity subtraction operations are as follows:

[0055] Step 1: Determine the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the subtraction, assuming D2 > D1;

[0056] Step 2: When X1 - X2, the dimension of the offspring individual is D1; ​​in the offspring individual, the first to D1 dimensions are equal to the subtraction of the component values ​​of the corresponding dimensions of individuals X1 and X2 in the first to D1 dimensions; when X2 - X1, the dimension of the offspring individual is D2; in the offspring individual, the first to D1 dimensions are equal to the subtraction of the component values ​​of the corresponding dimensions of individuals X1 and X2 in the first to D1 dimensions, and the remaining D2-D1 dimension of the offspring individual is equal to the remaining D2-D1 dimension of X2;

[0057] B. Addition operation

[0058] During the algorithm update process, when the code lengths of the two entities participating in the addition are inconsistent, the implementation steps of the addition operation are as follows:

[0059] Step 1: Determine the size of the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the addition, assuming D2 > D1;

[0060] Step 2: Randomly generate an n1-dimensional random variable V between [0, 1]; where n1 = D2 - D1;

[0061] Ste3: Add the first to the first dimensions of individuals X1 and X2, and assign the result to the first to the first dimensions of the offspring individual;

[0062] Step 4: Determine the i-th component V in V one by one. i Where i = 1, 2, …, n1; if V i If V ≥ 0.5, the (i+D1)th dimension component of the parent individual X2 is saved to the offspring individual; i If the value is less than 0.5, this component will not be added to the offspring.

[0063] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0064] 1. This invention can achieve a balance between global and local search capabilities:

[0065] The algorithm proposed in this invention combines the advantages of global search and local search, ensuring that in the process of finding the optimal solution, it can both broadly explore the solution space and deeply search for better solutions in a certain region.

[0066] 2. The method of this invention has a high convergence speed:

[0067] Compared to other algorithms, the algorithm of this invention exhibits a faster convergence speed in most cases, meaning that it can find a better or near-optimal solution in a shorter time.

[0068] 3. The method of this invention has strong adaptability:

[0069] By adaptively searching the model structure, the model can exhibit good performance in different problem instances and different contexts;

[0070] 4. This invention has wide applicability:

[0071] Although this invention is mainly aimed at grain condition detection during grain transportation, the proposed methods and ideas can be widely applied to other problems and have high practical value.

[0072] In summary, the method of this invention is a convolutional neural network optimization model that can effectively solve the problem of grain condition detection during grain transportation. This algorithm combines the advantages of intelligent optimization algorithms and aims to improve the quality and efficiency of grain condition detection during grain transportation by leveraging the global and local search capabilities of intelligent optimization algorithms. Attached Figure Description

[0073] Figure 1 This is a diagram of the optimized convolutional neural network model obtained in this invention;

[0074] Figure 2 This is a diagram illustrating the subtraction operation when updating individual code lengths in this invention.

[0075] Figure 3 This is a diagram illustrating the addition operation when the individual code lengths are inconsistent in this invention.

[0076] Figure 4 This is a diagram illustrating the attention mechanism during the decoding process of this invention.

[0077] Figure 5 These are diagrams of various convolutional blocks in the decoding process of this invention. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0079] Reference Figure 1-5 A method for grain condition detection during grain transportation based on a convolutional neural network optimization model, the specific steps of which are as follows:

[0080] (1) Parameter settings:

[0081] The Emperor Penguin optimization algorithm uses a population size of n, 20 iterations, a convolutional neural network regression model with 200 training epochs, a batch size of 32, an initial learning rate of 0.015, and a weight decay coefficient of 5 × 10⁻⁶. -5 The optimized algorithm is AdamW.

[0082] (2) Dataset collection and processing:

[0083] Temperature and humidity sensors were arranged in a 3x5 pattern at the center of the roof inside the transport vehicle's compartment. Data collected inside the vehicle included temperature, humidity, grain temperature at each row and column node of each layer, the overall average temperature, maximum temperature, and minimum temperature of the grain pile, as well as the average, maximum, and minimum temperatures of each layer, and the moisture content of the grain pile. The collected data values ​​were labeled to create a grain condition monitoring dataset.

[0084] Of the data, 70% was used for subsequent model training, 15% for model performance testing, and 15% for model validation.

[0085] (3) Model building:

[0086] An improved multi-objective emperor penguin optimization algorithm is used to construct a convolutional neural network regression model. The optimization objectives are the number of model parameters and the degree of difference between the predicted and actual values. Drawing on the symmetric downsampling and upsampling process of the UNet model, a search space for various convolutional module design algorithms is introduced. A variable code length encoding strategy, a dynamic decoding strategy, and an individual update strategy are proposed to obtain a model structure most suitable for grain condition detection during grain transportation.

[0087] The process involves generating different individuals and updating them using an improved emperor penguin optimization algorithm. The specific steps for individual generation and optimization are as follows:

[0088] Step 1: Initial iteration count gen=0, use variable code length encoding strategy to generate n individuals with different code lengths, as shown in equation (1).

[0089] (1)

[0090] In the formula, X i Let be the i-th individual in the population. rand(1, h) is an h-dimensional random vector between [0, 1], where the dimension h is a random integer between [5, 20], which determines the depth of the model.

[0091] Step 2: Dynamic Decoding Strategy: Using a dynamic decoding strategy, the encoded values ​​are decoded according to the corresponding rules in Table 1 based on the component values ​​of different dimensions of individuals in the population, and the individuals are decoded into a convolutional neural network regression model.

[0092] Among them, the encoded value For individual X i The s-th component, s = 1, 2, …, v, where v is a component of X. i The number of components in The calculation formula is shown in equation (2), where D represents the expansion rate, p represents the zero-padding strategy, and ⌊⌋ represents rounding down.

[0093] Table 1 Dynamic Decoding Strategy

[0094] -10≤xs i<-8.5 3×3 convolution, output dimension: max(64, ⌊256-256*x'⌋) -8.5≤xs i<-7 7'7 convolution, output dimension: max(32, ⌊64-64*x'⌋) -7≤xs i<-6 5×5 convolution, output dimension: max(32, ⌊128-128*x'⌋) -6≤xs i<-4.5 Max pooling -4.5≤xs i<-3 5'5 dilated convolution, D=2, p=4, output dimension: max(32, ⌊64-64*x'⌋) -3≤xs i<-1.5 3'3 dilated convolution, D=2, p=2, output dimension: max(32, ⌊64-64*x'⌋) -1.5≤xs i≤1.5 ConvNeXt convolution, output dimension: max(64, ⌊256-256*x'⌋) 1.5<xs i≤4.5 ResNet convolution, output dimension: max(32, ⌊128-128*x'⌋) 4.5<xs i≤6 SE attention mechanism 6<xs i≤8.5 Pooling blocks 8.5<xs i≤10 Dilated pyramid convolution, output dimension: max(64, ⌊256-256*x'⌋) If xs i≤0 Global average pooling, output dimension: 1 If xs i>0 Two fully connected layers, sigmoid, output dimensions: 512 and 1.

[0095] (2)

[0096] Where, x min It is individual X i The smallest component, xmax It is individual X i The largest component in the middle.

[0097] Step 3: After decoding, multiple convolutional neural network regression models are generated. The model is trained using the parameter settings in step (1) and the dataset in step (2).

[0098] Step 4: Calculate the fitness value using a multi-objective function. The calculation formula is as follows:

[0099] (3)

[0100]

[0101] In the formula, p i MSE represents the number of model parameters corresponding to the i-th individual in the population. i Let y represent the recognition error of the model corresponding to the i-th individual in the population during grain condition detection during grain transportation. N represents the number of data points, and y... el y represents the true label of data e. e This is the prediction result of the CNN regression model for the e-th data point.

[0102] Step 5: Individuals perform population update operations and determine whether the individuals participating in the update are consistent. If they are consistent, use update operations ①②③④ to update the individuals. If they are inconsistent, proceed to step 6.

[0103] ① Adaptive Disturbance Movement Strategy I

[0104] For the minimization problem, the update formula for the optimal individual in the population is as follows:

[0105] (4)

[0106] (5)

[0107] (6)

[0108] (7)

[0109] In the formula, For the optimal individual, t represents the current iteration number, D represents the dimension of the variable, q is a randomly generated D-dimensional 0-1 row vector, Ub is the upper bound row vector of the variable in D dimensions, Lb is the lower bound row vector of the variable in D dimensions, Maxg is the maximum number of iterations of the algorithm, β is the perturbation term, and λ is the adaptive change amount. This indicates that the elements at the same position in two vectors are multiplied together.

[0110] ②Dynamic Movement Strategy II

[0111] A dynamic movement strategy based on individual dimension updates is proposed, and the improved individual update formula is shown in Equation (8).

[0112] (8)

[0113] (9)

[0114] In the formula, and It represents the optimal position in the memory of two randomly selected emperor penguins, where d represents... and The distance between them.

[0115] ③ Random movement strategy III

[0116] Emperor penguins move randomly, the algorithm has a large search range and strong global search capability, and the update formula is shown in equation (10).

[0117] (10)

[0118] (11)

[0119] In the formula, Individuals are randomly selected from the population. It is the i-th individual in the population. The optimal position in memory. a1 and a2 are calculated using formula (9), where a1 represents and The distance between them, a2 represents and The distance between,

[0120] ④ Adaptive selection strategy

[0121] The probability of choice P v The calculation formula is shown in equation (12).

[0122] (12)

[0123] In the formula, t is the current iteration number, Maxg is the maximum number of iterations of the algorithm, v takes integer values ​​of 1, 2 and 3, and g is a power of 1, 0.8 and 0.6 respectively.

[0124] Step 6: Since the individual code lengths participating in the update are different, a subtraction and addition operation is given for individuals with inconsistent code lengths, and the update operation ①②③④ in step 5 is used to perform the update operation.

[0125] 1) Subtraction operation

[0126] During the algorithm update process, when the code lengths of the two entities involved in the subtraction are inconsistent, the specific implementation steps of the two entity subtraction operations are as follows:

[0127] Step 1: Determine the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the subtraction, assuming D2 > D1;

[0128] Step 2: When X1 - X2, the dimension of the offspring individual is D1. In the offspring individual, dimensions 1 through D1 are equal to the subtraction of the corresponding component values ​​of dimensions 1 through D1 of individuals X1 and X2. When X2 - X1, the dimension of the offspring individual is D2. In the offspring individual, dimensions 1 through D1 are equal to the subtraction of the corresponding component values ​​of dimensions 1 through D1 of individuals X1 and X2. The remaining D2-D1 dimension of the offspring individual is equal to the remaining D2-D1 dimension of X2.

[0129] 2) Addition operation

[0130] During the algorithm update process, when the code lengths of the two entities participating in the addition are inconsistent, the implementation steps of the addition operation are as follows:

[0131] Step 1: Determine the size of the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the addition, assuming D2 > D1;

[0132] Step 2: Randomly generate an n1-dimensional random variable V between [0, 1]. Where n1 = D2 - D1;

[0133] Ste3: Add the first to the first dimensions of individuals X1 and X2, and assign the result to the first to the first dimensions of the offspring individuals.

[0134] Step 4: Determine the i-th component V in V one by one. i Where i = 1, 2, …, n1. If V i If V ≥ 0.5, the (i+D1)th dimension component of the parent individual X2 is saved to the offspring individual; i If the value is less than 0.5, this component will not be added to the offspring.

[0135] Step 7: The number of iterations gen = gen + 1. If gen satisfies the maximum iteration condition, output the model and detection value corresponding to the optimal individual and end the loop; otherwise, proceed to the next step.

[0136] Step 8: Return to Step 2 for dynamic decoding of the updated individuals, and update the optimal individual and the population.

[0137] (4) Output the optimal individual model MAutoCNN as the grain condition detection model during grain transportation.

[0138] This invention provides a grain condition detection method based on a convolutional neural network (CNN) optimization model during grain transportation. This method employs an improved multi-objective Emperor Penguin optimization algorithm to construct a CNN regression model, replacing manual construction and optimization methods. This balances model performance and computational efficiency. The CNN regression model constructed by the algorithm continuously detects the temperature and humidity of transport vehicles, transforming "post-event alarm" into "pre-event warning." A variable code length encoding strategy is used for CNN regression model optimization, enabling the exploration of network structures with different depths and complexities. A dynamic decoding strategy incorporating various convolution and pooling operations improves the model's expressiveness and flexibility. An update strategy suitable for variable code length individuals is used for algorithm iteration, eliminating the need for discretization processing when constructing the CNN regression model using the multi-objective Emperor Penguin optimization algorithm.

[0139] The innovation of this method lies in:

[0140] 1. Improved Multi-Objective Emperor Penguin Optimization Algorithm: The improved multi-objective emperor penguin optimization algorithm includes adaptive perturbation search strategy I, dynamic movement strategy II, random movement strategy III, and adaptive selection strategy. Adaptive perturbation search strategy I has a wide applicability, strong optimization ability, and the ability to escape local optima, which helps reduce the algorithm's time complexity. Dynamic movement strategy II effectively traverses the complex multi-dimensional search space by combining local and global search, increasing the probability of finding the global optimum. Random movement strategy III enhances the algorithm's global search capability. The selection strategy strikes a good balance between the algorithm's exploration and development capabilities.

[0141] 2. Model construction method: The improved multi-objective emperor penguin optimization algorithm is used to construct a convolutional neural network regression model, replacing the manual construction and optimization method, and balancing model performance and computational efficiency.

[0142] 3. Encoding method: A variable code length encoding strategy is adopted for optimization of convolutional neural network regression models, which has the ability to explore network structures of different depths and complexities;

[0143] 4. Decoding method: A dynamic decoding strategy using multiple convolution and pooling operations is employed to improve the model's expressiveness and flexibility;

[0144] 5. Update operation: The algorithm iterates using an update strategy suitable for individuals with variable code length, so that the multi-objective emperor penguin optimization algorithm does not need to be discretized when constructing the convolutional neural network regression model.

[0145] According to the method of the present invention, the grain condition during the grain transportation process in a county in Heilongjiang Province is detected. First, data is collected and processed to obtain a grain condition detection dataset containing 2,000 sets of data. In the dataset, 70% (1,400 sets) of data are used for model training, 15% (300 sets) of data are used for model performance testing, and 15% (300 sets) of data are used for model validation.

[0146] Secondly, a convolutional neural network regression model is constructed using a long encoding strategy and a dynamic decoding strategy. The model is trained and validated using a grain condition detection dataset. Then, the Emperor Penguin optimization algorithm is used to optimize the constructed model. This process is repeated until the maximum number of iterations is reached, and the current optimal model is output, denoted as MAutoCNN. Figure 1 As shown.

[0147] Finally, the models CFEM, ER-CNN, RgeNet, and CNN-GA, as well as the AutoCNN model optimized using the intelligent optimization algorithm, were compared on the grain condition detection dataset. The comparison results of the models on the validation set are shown in Table 2.

[0148] Table 2 Comparison Results

[0149] CFEM - <![CDATA[1.68´10 -3 ]]> <![CDATA[3.43´10 -2 ]]> 0.867 ER-CNN 48.96 <![CDATA[1.24´10 -3 ]]> <![CDATA[2.54´10 -2 ]]> 0.902 RegNet 14.29 <![CDATA[7.15´10 -4 ]]> <![CDATA[1.97´10 -2 ]]> 0.943 CNN-GA 5.78 <![CDATA[3.96´10 -4 ]]> <![CDATA[1.51´10 -2 ]]> 0.969 MAutoCNN 0.87 <![CDATA[2.64´10 -4 ]]> <![CDATA[1.23´10 -2 ]]> 0.979

[0150] Depend on Figure 1 As can be seen, the MAutoCNN model incorporates multiple strategies, specifically including three attention mechanisms, three 5x5 dilated convolutions, three ResNet convolutions, one ConvNeXt convolution, pooling blocks, 3x3 dilated convolutions, 3x3 ordinary convolutions, 7x7 ordinary convolutions, and 16 layers of global average pooling, covering nine different operations. This reflects the algorithm's high adaptability and flexibility in model optimization, demonstrating its optimization strategy for specific image processing tasks. By combining different types of convolutional blocks and pooling strategies, the model achieves a balance in multi-scale feature extraction, enhanced feature representation, preservation of detailed information, and improved computational efficiency. This comprehensive optimization method, considering both performance and efficiency, improves the model's performance in grain condition detection during grain transportation. Notably, the MAutoCNN model uses two consecutive SE modules. This structure weights the input features in the early stages of the model, strengthening its ability to capture important information from the input features, which is crucial for improving the model's recognition accuracy. This weighting strategy allows the model to focus more on features crucial for task completion, further improving its performance. Therefore, as shown in Table 2, the MAutoCNN model optimized using the intelligent optimization algorithm improves MSE, MAE, and R...2 The MAutoCNN model achieved optimal values ​​in all aspects. Furthermore, it had the lowest parameter count, indicating low complexity and suitability for deployment in computationally limited environments.

Claims

1. A method for grain condition detection in grain transportation based on a convolutional neural network optimization model, characterized in that: The steps of this method are as follows: (1) Parameter settings: (2) Dataset collection and processing: (3) Model building: An improved multi-objective emperor penguin optimization algorithm is used to construct a convolutional neural network regression model. The optimization objectives are the number of model parameters and the degree of difference between the predicted and actual values. By drawing on the symmetric downsampling and upsampling process of the UNet model, a search space for various convolutional module design algorithms is introduced. A variable code length encoding strategy, a dynamic decoding strategy, and an individual update strategy are proposed to obtain a model structure most suitable for grain condition detection during grain transportation. (4) Output the model corresponding to the optimal individual as the grain condition detection model during grain transportation; In step (3), different individuals are generated, and the improved Emperor Penguin optimization algorithm is used to update the individuals. The specific steps for individual generation and optimization are as follows: Step 1: Initial iteration count gen=0, use variable code length encoding strategy to generate n individuals with different code lengths, as shown in equation (1): (1) In the formula, X i For the i-th individual in the population, rand(1, h) is an h-dimensional random vector between [0, 1], where the dimension h is a random integer between [5, 20], which determines the depth of the model; Step Two: Dynamic Decoding Strategy: A dynamic decoding strategy is used to decode the encoded values ​​based on the component values ​​of different dimensions of individuals in the population, thus decoding each individual into a convolutional neural network regression model; where the encoded values... For individual X i The s-th component, s = 1, 2, …, v, where v is a component of X. i The number of components in The calculation formula is shown in equation (2): (2) Where, x min It is individual X i The smallest component, x max It is individual X i The largest component; Step 3: After decoding, multiple convolutional neural network regression models are generated. The model is trained using the parameter settings in step (1) and the dataset in step (2). Step 4: Calculate the fitness value using a multi-objective function. The calculation formula is as follows: (3) ; In the formula, p i MSE represents the number of model parameters corresponding to the i-th individual in the population. i The model corresponding to the i-th individual in the population represents the recognition error of grain condition detection during grain transportation; N represents the number of data points, y el y represents the true label of data e. e This is the prediction result of the CNN regression model for the e-th data point; Step 5: Individuals perform population update operations and determine whether the individuals participating in the update are consistent. If they are consistent, update the individuals using the update operations of Adaptive Perturbation Search Strategy I, Dynamic Movement Strategy II, Random Movement Strategy III, and Adaptive Selection Strategy; if they are inconsistent, proceed to Step 6. Step 6: Provide a subtraction and addition operation for individuals when the code lengths are inconsistent, and use the update operations of the adaptive perturbation search strategy I, dynamic movement strategy II, random movement strategy III and adaptive selection strategy in Step 5 to perform the update operation; Step 7: The number of iterations gen = gen + 1. If gen satisfies the maximum iteration condition, output the model and detection value corresponding to the optimal individual and end the loop; otherwise, proceed to the next step. Step 8: Return to Step 2 for dynamic decoding of the updated individuals; update the optimal individual and the population. In step six: A. Subtraction operation During the algorithm update process, when the code lengths of the two entities involved in the subtraction are inconsistent, the specific implementation steps of the two entity subtraction operations are as follows: Step 1: Determine the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the subtraction, assuming D2 > D1; Step 2: When X1 - X2, the dimension of the offspring individual is D1; ​​in the offspring individual, the first to D1 dimensions are equal to the subtraction of the component values ​​of the corresponding dimensions of individuals X1 and X2 in the first to D1 dimensions; when X2 - X1, the dimension of the offspring individual is D2; in the offspring individual, the first to D1 dimensions are equal to the subtraction of the component values ​​of the corresponding dimensions of individuals X1 and X2 in the first to D1 dimensions, and the remaining D2-D1 dimension of the offspring individual is equal to the remaining D2-D1 dimension of X2; B. Addition operation During the algorithm update process, when the code lengths of the two entities participating in the addition are inconsistent, the implementation steps of the addition operation are as follows: Step 1: Determine the size of the dimensions D1 and D2 of the two parent individuals X1 and X2 involved in the addition, assuming D2 > D1; Step 2: Randomly generate an n1-dimensional random variable V between [0, 1]; where n1 = D2 - D1; Ste3: Add the first to the first dimensions of individuals X1 and X2, and assign the result to the first to the first dimensions of the offspring individual; Step 4: Determine the i-th component V in V one by one. i Where i = 1, 2, …, n1; if V i If V ≥ 0.5, the (i+D1)th dimension component of the parent individual X2 is saved to the offspring individual; i If the value is less than 0.5, this component will not be added to the offspring.

2. The grain condition detection method in grain transportation based on a convolutional neural network optimization model according to claim 1, characterized in that: In step five: ① Adaptive Disturbance Movement Strategy I: For the minimization problem, the update formula for the optimal individual in the population is as follows: (4) (5) (6) (7) In the formula, For the optimal individual, t represents the current iteration number, D represents the dimension of the variable, q is a randomly generated D-dimensional 0-1 row vector, Ub is the upper bound row vector of the variable in D dimensions, Lb is the lower bound row vector of the variable in D dimensions, Maxg is the maximum number of iterations of the algorithm, β is the perturbation term, and λ is the adaptive change amount. This indicates that the elements at the same position of two vectors are multiplied together. The function f() is the function for calculating the fitness value; v is the D-dimensional adaptive perturbation step size vector; ②Dynamic movement strategy II: A dynamic movement strategy based on individual dimension updates is given, and the improved individual update formula is shown in Equation (8). (8) (9) In the formula, and It represents the optimal position in the memory of two randomly selected emperor penguins, where d represents... and The distance between; ③ Random movement strategy III: Emperor penguins move randomly, the algorithm has a large search range and strong global search capability, and the update formula is shown in equation (10); (10) (11) In the formula, Individuals are randomly selected from the population. It is the i-th individual in the population. The optimal position in memory; a1 and a2 use formula (9), where a1 represents and The distance between them, a2 represents and The distance between; ④ Adaptive selection strategy: The probability of choice P v The calculation formula is shown in equation (12); (12) In the formula, t is the current iteration number, Maxg is the maximum number of iterations of the algorithm, v takes integer values ​​of 1, 2, and 3, and g is a power of 1, 0.8, and 0.6, respectively; P v The correspondence between the policy and the strategy is as follows: based on P v Choose to execute either Adaptive Disturbance Movement Strategy I, Dynamic Movement Strategy II, or Random Movement Strategy III.

3. The grain condition detection method in grain transportation based on a convolutional neural network optimization model according to claim 1, characterized in that: In this method, (1) Parameter settings: The Emperor Penguin optimization algorithm uses a population size of n, 20 iterations, a convolutional neural network regression model with 200 training epochs, a batch size of 32, an initial learning rate of 0.015, and a weight decay coefficient of 5 × 10⁻⁶. -5 The optimized algorithm is AdamW; (2) Dataset collection and processing: Sensors for measuring temperature and humidity are arranged in a 3×5 pattern at the center of the roof inside the transport vehicle's cabin; the data collected inside the transport vehicle includes temperature and humidity. The collected data values ​​were labeled to create a grain condition detection dataset. Of this dataset, 70% was used for subsequent model training, 15% was used for model performance testing, and 15% was used for model validation.

Citation Information

Patent Citations

  • Improved CNN architecture optimization design method

    CN118153633A