A deep learning algorithm model optimization and deployment method for smart factories
The potato cleaning parameters are optimized through the deep learning algorithm model, which solves the problem of unstable cleaning effects in traditional cleaning methods, and realizes an efficient, accurate and automated potato cleaning process.
Patent Information
- Application Number
- CN202510340815.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-03-21
AI Technical Summary
Traditional potato cleaning methods rely on manual experience and are difficult to accurately adjust according to the characteristics of different batches of potatoes, resulting in unstable cleaning effect and easily lead to excessive or too little water, affecting the cleaning effect and product quality.
Using deep learning algorithm model optimization and deployment method for smart factories, we collect and evaluate cleaning feature data through random cleaning and image processing technology, train cleaning prediction models, optimize cleaning water volume and stirring parameters, and adapt to the characteristics of different batches of potatoes.
It significantly improves the cleaning effect and production efficiency, reduces water resource waste and agricultural product damage, improves cleaning consistency and automation level, and provides an efficient, accurate and optimized cleaning solution.
Smart Images

Figure CN119888588B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a deep learning algorithm model optimization and deployment method for smart factories. Background Art
[0002] In modern smart food processing factories, deep learning algorithms are widely used in the optimization and intelligent control of production lines. For example, by dynamically adjusting equipment parameters through deep learning models, processing efficiency can be improved, energy consumption can be reduced, and the uncertainty caused by human intervention can be reduced.
[0003] In the processing factories of root and tuber agricultural products, such as the potato washing process, the traditional method usually adopts a washing device and sets a stirring device in the washing device. The current production method relies on manual experience to add an appropriate amount of water into the bucket and wash the potatoes by stirring. However, this method has many problems: if too much water is added, the friction between the potatoes is insufficient, resulting in poor washing effect; if the amount of water is too little, the friction between the potatoes is too large, which may cause epidermal damage and affect the quality of the final product. In addition, due to the lack of intelligent control capabilities of the traditional washing method, it is difficult to make precise adjustments according to the characteristics of different batches of potatoes, resulting in unstable washing effect. Summary of the invention
[0004] The present invention provides a deep learning algorithm model optimization and deployment method for smart factories, which solves the problems raised in the background technology.
[0005] The present invention provides a deep learning algorithm model optimization and deployment method for smart factories, comprising:
[0006] Step 1: Randomly clean the agricultural products, including:
[0007] Set the range of adding cleaning water in the cleaning device and the speed adjustment range of the stirring device;
[0008] Adding cleaning water into the cleaning device based on the cleaning water addition range;
[0009] Stirring the cleaning device based on a speed adjustment range of the stirring device;
[0010] Step 2, repeating step 1 for N times to obtain N groups of characteristic data; wherein the i-th group of characteristic data includes: the amount of washing water added and the speed of the stirring device for the i-th random washing of the agricultural products;
[0011] Step 3, obtaining the approximate volume of the agricultural products randomly washed for the i-th time, and determining the number of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume;
[0012] Step 4, obtaining the pre-cleaning image and the post-cleaning image of the agricultural product randomly cleaned for the i-th time; and scoring the i-th group of feature data based on the pre-cleaning image and the post-cleaning image to obtain a cleaning score for the i-th group of feature data;
[0013] Step 5, based on the cleaning scores corresponding to the N groups of feature data, a cleaning prediction model is trained;
[0014] Step 6: within the target time period, based on the cleaning prediction model and combined with the optimization algorithm, a cleaning plan is planned for the target agricultural product; wherein the cleaning plan for the target agricultural product indicates determining the amount of cleaning water added and the speed of the stirring device for the target agricultural product.
[0015] Furthermore, the approximate volume of the agricultural products randomly washed for the i-th time is obtained, including:
[0016] The volume of the washing water added to the agricultural products randomly washed for the i-th time is taken as the first volume;
[0017] Obtaining a second volume of the agricultural product randomly washed for the i-th time in the washing device after adding washing water;
[0018] The difference between the second volume and the first volume is taken as the approximate volume of the agricultural products randomly washed for the i-th time.
[0019] Further, determining the quantity of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume includes:
[0020] Based on prior knowledge, the standard volume of a single root, tuber and fruit corresponding to the agricultural product randomly washed for the i-th time is obtained; based on the approximate volume of the agricultural product randomly washed for the i-th time and the standard volume of a single root, tuber and fruit, the number of characteristic agricultural products is calculated, specifically including:
[0021] ;
[0022] in, represents the number of characteristic agricultural products of the i-th group of agricultural products, represents the approximate volume of the i-th group of agricultural products, represents the standard volume of a single root, tuber or fruit corresponding to the i-th group of agricultural products, represents the first proportionality coefficient, Represents the bias coefficient.
[0023] Furthermore, the cleaning score of the i-th group of feature data is obtained, including:
[0024] The images before and after washing of the agricultural products randomly washed for the i-th time are semantically segmented to obtain a first matrix and a second matrix; wherein the semantic segmentation means deleting non-agricultural product parts in the images before and after washing based on a semantic segmentation tool;
[0025] Gray-scaling the first matrix and the second matrix to obtain a first gray-scale matrix and a second gray-scale matrix;
[0026] Obtain the standard color of the surface of the agricultural product randomly washed for the i-th time, and grayscale the standard color to obtain a reference grayscale value;
[0027] Calculate the difference between each element in the first grayscale matrix and the second grayscale matrix and the reference grayscale value. If the difference is greater than the preset grayscale threshold, replace the corresponding element in the first grayscale matrix or the second grayscale matrix with 1, otherwise replace it with 0, to obtain a first update matrix and a second update matrix;
[0028] The cleanliness is calculated for the first update matrix and the second update matrix. The calculation formula for the cleanliness is as follows:
[0029] ;
[0030] in, Indicates cleanliness, represents the element in the pth row and qth column in the first update matrix or the second update matrix, represents the number of elements of the first update matrix or the second update matrix, express The index of
[0031] The difference in cleanliness between the first grayscale matrix and the second grayscale matrix is calculated, and the difference is weighted to obtain the cleanliness score of the i-th group of agricultural products.
[0032] Furthermore, the cleaning score of the i-th group of feature data is obtained, including:
[0033] The i-th group of feature data is labeled, specifically including:
[0034] Obtaining a stirring and cleaning image corresponding to the agricultural products randomly cleaned for the i-th time; wherein the stirring and cleaning image represents a top view of the agricultural products randomly cleaned for the i-th time in the cleaning device;
[0035] Perform edge detection on the stirring and cleaning image to obtain K feature edges;
[0036] If there are feature edges in K with a number greater than a preset ratio intersecting at one point, the i-th group of feature data is marked as 1; otherwise, the i-th group of feature data is marked as 0;
[0037] Establishing a feature vector for the i-th group of feature data includes:
[0038] The type of agricultural products randomly washed for the ith time is encoded with real numbers to obtain the first element of the corresponding feature vector; the approximate volume of the agricultural products randomly washed for the ith time is used as the second element of the corresponding feature vector; the speed of the stirring device of the agricultural products randomly washed for the ith time is used as the third element of the corresponding feature vector; the first volume in the washing device of the agricultural products randomly washed for the ith time is used as the fourth element of the corresponding feature vector;
[0039] Normalize the feature vector of the i-th group of feature data to obtain the corresponding standard vector;
[0040] The standard vector of the i-th group of feature data is used as sample data, the cleaning score of the i-th group of feature data is used as the first sample label, and the annotation of the i-th group of feature data is used as the second sample label. The cleaning prediction model is obtained through loss function training.
[0041] Furthermore, the cleaning prediction model includes a hidden layer, which is constructed based on a convolutional neural network. The hidden layer formula is as follows:
[0042] ;
[0043] in, represents the feature state vector of the hidden layer output, express Activation function, represents the average pooling operation, represents the standard vector of the input, represents the convolution operation, represents a one-dimensional convolution vector, represents the bias vector, represents the weight matrix of the fully connected layer, Bias matrix for fully connected layers.
[0044] Furthermore, the loss function is calculated as follows:
[0045] ;
[0046] in, represents the loss function value, and Represent the first loss weight and the second loss weight respectively, represents the number of sample data, express The index of represents the cleanliness score of the i-th group of feature data, represents the cleaning score predicted by the cleaning prediction model for the i-th set of feature data, represents the label of the i-th group of feature data, Represents the predicted label of the i-th set of feature data.
[0047] Furthermore, a cleaning plan is planned for the target agricultural products, including:
[0048] Step 81, obtaining the code and approximate volume of the target agricultural product within the target time period to obtain the first element and the second element of the feature vector of the target agricultural product;
[0049] Step 82, randomly fill the third element and the fourth element of the feature vector to obtain R feature vectors; wherein the third element is within the speed adjustment range of the stirring device, and the fourth element is within the addition range of the cleaning water in the cleaning device; normalize the R feature vectors to obtain R optimization vectors;
[0050] Step 83, calculating predicted cleaning scores and labels for the R optimized vectors through a cleaning prediction model;
[0051] Step 84, screening based on the predicted cleanliness scores of the R optimization vectors, specifically includes:
[0052] The optimization vector marked as 0 is used as the parent for iterative update;
[0053] The optimization vectors marked as 1 are sorted from large to small to obtain feature sorting; a preset number of optimization vectors in the feature sorting are retained from front to back, and the remaining optimization vectors are used as parents for iterative update;
[0054] Step 85 , looping step 84 for a preset number of times, outputting the optimization vector with the largest cleaning score marked as 1 as the cleaning solution for the target agricultural product.
[0055] The beneficial effect of the present invention is that the cleaning effect and production efficiency are significantly improved by optimizing the cleaning parameters through data-driven. Compared with the traditional cleaning method that relies on manual experience, data is collected through random cleaning experiments, and the cleanliness is evaluated by combining image processing, and the optimal cleaning parameters are predicted by a convolutional neural network model. The method can adapt to the characteristics of different batches of agricultural products, reduce water waste, avoid damage to the surface of agricultural products caused by insufficient or excessive cleaning, improve cleaning consistency and automation level, and provide an efficient, accurate and optimizable cleaning solution for intelligent food processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flow chart of a deep learning algorithm model optimization and deployment method for smart factories of the present invention. DETAILED DESCRIPTION
[0057] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the contents of this specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.
[0058] like Figure 1 As shown, a deep learning algorithm model optimization and deployment method for smart factories includes:
[0059] Step 1: Randomly clean the agricultural products, including:
[0060] Set the range of adding cleaning water in the cleaning device and the speed adjustment range of the stirring device;
[0061] Adding cleaning water into the cleaning device based on the cleaning water addition range;
[0062] Stirring the cleaning device based on a speed adjustment range of the stirring device;
[0063] Step 2, repeating step 1 for N times to obtain N groups of characteristic data; wherein the i-th group of characteristic data includes: the amount of washing water added and the speed of the stirring device for the i-th random washing of the agricultural products;
[0064] Step 3, obtaining the approximate volume of the agricultural products randomly washed for the i-th time, and determining the number of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume;
[0065] Step 4, obtaining the pre-cleaning image and the post-cleaning image of the agricultural product randomly cleaned for the i-th time; and scoring the i-th group of feature data based on the pre-cleaning image and the post-cleaning image to obtain a cleaning score for the i-th group of feature data;
[0066] Step 5, based on the cleaning scores corresponding to the N groups of feature data, a cleaning prediction model is trained;
[0067] Step 6: within the target time period, based on the cleaning prediction model and combined with the optimization algorithm, a cleaning plan is planned for the target agricultural product; wherein the cleaning plan for the target agricultural product indicates determining the amount of cleaning water added and the speed of the stirring device for the target agricultural product.
[0068] In one embodiment of the present invention, obtaining the approximate volume of the agricultural products randomly washed for the i-th time includes:
[0069] The volume of the washing water added to the agricultural products randomly washed for the i-th time is taken as the first volume;
[0070] Obtaining a second volume of the agricultural product randomly washed for the i-th time in the washing device after adding washing water;
[0071] The difference between the second volume and the first volume is taken as the approximate volume of the agricultural products randomly washed for the i-th time.
[0072] Specifically, the approximate volume of agricultural products is accurately measured by the change in water volume, so as to optimize the washing water volume and stirring parameters, and realize an efficient, water-saving and stable washing process. This method avoids the use of expensive volume measurement equipment, simplifies the operation process, ensures the rationality of the washing parameters, and reduces the damage of agricultural products and the waste of resources. Assume a potato washing production line, which needs to process 50kg of potatoes each time. If the amount of water is added directly based on experience, it may result in too much water and poor washing effect, or too little water and excessive friction between potatoes, resulting in damage. According to the described method: first add 100L of washing water (first volume). Pour 50kg of potatoes into the bucket, the water level rises at this time, and the total water volume is measured to be 120L (second volume). Calculate the volume of agricultural products: 120L-100L=20L, which means that these potatoes occupy about 20L volume.
[0073] In one embodiment of the present invention, determining the quantity of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume includes:
[0074] Based on prior knowledge, the standard volume of a single root, tuber and fruit corresponding to the agricultural product randomly washed for the i-th time is obtained; based on the approximate volume of the agricultural product randomly washed for the i-th time and the standard volume of a single root, tuber and fruit, the number of characteristic agricultural products is calculated, specifically including:
[0075] ;
[0076] in, represents the number of characteristic agricultural products of the i-th group of agricultural products, represents the approximate volume of the i-th group of agricultural products, represents the standard volume of a single root, tuber or fruit corresponding to the i-th group of agricultural products, represents the first proportionality coefficient, Represents the bias coefficient.
[0077] Specifically, representative agricultural products are selected for testing by sampling, avoiding the high cost and low efficiency of measuring all individuals one by one. This method uses prior knowledge combined with proportional coefficients and bias coefficients to ensure that the number of samples is representative and improve the accuracy of cleaning effect evaluation. At the same time, it reduces the consumption of computing resources, enabling the deep learning model to maintain efficient learning and optimization with a small amount of data, thereby realizing the precise regulation of intelligent cleaning parameters, improving production efficiency, reducing water waste, and improving the consistency of cleaning quality to meet the automation needs of smart factories. Assume that a factory needs to wash a large number of potatoes every day, but the potatoes are of different sizes. Directly detecting the cleaning effect of all potatoes is too costly and inefficient. Therefore, it is necessary to calculate the number of characteristic agricultural products based on volume for evaluation, as follows: Determine the size of a single standard potato: Empirical data shows that the standard volume of a single potato is about 0.3L. Calculate the number of characteristic agricultural products: The total approximate volume of 100kg potatoes is calculated to be 150L. 25 selected potatoes are photographed before and after washing, color grayscale analysis is performed, and the cleaning score is calculated.
[0078] In one embodiment of the present invention, obtaining the cleaning score of the i-th group of feature data includes:
[0079] The images before and after washing of the agricultural products randomly washed for the i-th time are semantically segmented to obtain a first matrix and a second matrix; wherein the semantic segmentation means deleting non-agricultural product parts in the images before and after washing based on a semantic segmentation tool;
[0080] Gray-scaling the first matrix and the second matrix to obtain a first gray-scale matrix and a second gray-scale matrix;
[0081] Obtain the standard color of the surface of the agricultural product randomly washed for the i-th time, and grayscale the standard color to obtain a reference grayscale value;
[0082] Calculate the difference between each element in the first grayscale matrix and the second grayscale matrix and the reference grayscale value. If the difference is greater than the preset grayscale threshold, replace the corresponding element in the first grayscale matrix or the second grayscale matrix with 1, otherwise replace it with 0, to obtain a first update matrix and a second update matrix;
[0083] The cleanliness is calculated for the first update matrix and the second update matrix. The calculation formula for the cleanliness is as follows:
[0084] ;
[0085] in, Indicates cleanliness, represents the element in the pth row and qth column in the first update matrix or the second update matrix, represents the number of elements of the first update matrix or the second update matrix, express The index of
[0086] The difference in cleanliness between the first grayscale matrix and the second grayscale matrix is calculated, and the difference is weighted to obtain the cleanliness score of the i-th group of agricultural products.
[0087] Specifically, image processing technology is used to quantitatively evaluate the cleaning effect of agricultural products to improve the accuracy and automation of cleanliness detection. Traditional evaluation of cleaning effect relies on manual observation, which is easily affected by subjective factors and difficult to standardize. However, this method can accurately measure the degree of stain removal before and after cleaning through semantic segmentation, grayscale analysis and cleanliness calculation, ensure the stability of cleaning quality, and provide data support for subsequent optimization of cleaning parameters.
[0088] It should be noted that the semantic segmentation tool is an image segmentation model based on U-Net.
[0089] In one embodiment of the present invention, obtaining the cleaning score of the i-th group of feature data includes:
[0090] The i-th group of feature data is labeled, specifically including:
[0091] Obtaining a stirring and cleaning image corresponding to the agricultural products randomly cleaned for the i-th time; wherein the stirring and cleaning image represents a top view of the agricultural products randomly cleaned for the i-th time in the cleaning device;
[0092] Perform edge detection on the stirring and cleaning image to obtain K feature edges;
[0093] If there are feature edges in K with a number greater than a preset ratio intersecting at one point, the i-th group of feature data is marked as 1; otherwise, the i-th group of feature data is marked as 0;
[0094] Establishing a feature vector for the i-th group of feature data includes:
[0095] The type of agricultural products randomly washed for the ith time is encoded with real numbers to obtain the first element of the corresponding feature vector; the approximate volume of the agricultural products randomly washed for the ith time is used as the second element of the corresponding feature vector; the speed of the stirring device of the agricultural products randomly washed for the ith time is used as the third element of the corresponding feature vector; the first volume in the washing device of the agricultural products randomly washed for the ith time is used as the fourth element of the corresponding feature vector;
[0096] Normalize the feature vector of the i-th group of feature data to obtain the corresponding standard vector;
[0097] The standard vector of the i-th group of feature data is used as sample data, the cleaning score of the i-th group of feature data is used as the first sample label, and the annotation of the i-th group of feature data is used as the second sample label. The cleaning prediction model is obtained through loss function training.
[0098] Specifically, the cleaning prediction model is mainly used to optimize the cleaning process of agricultural products, and ensure the stability and controllability of the cleaning quality through a data-driven approach. The training process of the model involves the labeling of the cleaning state of agricultural products, the construction of feature vectors, and machine learning training to predict the cleaning effect and optimize the cleaning parameters. In the model training process, the feature data needs to be labeled first. The labeling process is as follows: The top view of the stirring and cleaning is collected by the camera to observe the movement of the agricultural products in the water. The image is edge detected to extract K key feature edges. Analyze whether the K edges have more intersection points: If the feature edges intersect at one point, it means that a vortex is formed during the cleaning process, which is marked as 1. If the feature edges do not intersect significantly, it means that a vortex is not formed during the cleaning process, which is marked as 0. It should be noted that if a vortex is formed, the dust on the surface of the agricultural products can be concentrated in the vortex by centrifugation through the vortex, and finally the dust is removed based on the vortex. Without a vortex, the dust is difficult to be removed in a centralized manner, and the dust will adhere to the surface of the agricultural products for a second time.
[0099] The significance of marking vortices: The formation of vortices helps mud residues to separate from the surface of agricultural products and be discharged with water, reducing secondary pollution. Without vortices, even after the agricultural products are washed, mud residues may still remain in the water and eventually reattach to the surface of the agricultural products, affecting the cleanliness.
[0100] In order for the machine learning model to effectively predict the cleaning effect, it is necessary to construct a feature vector for each group of agricultural products, including the following elements:
[0101] The first element: the type of agricultural product (potatoes, carrots, apples, etc.), represented by a real number code.
[0102] Second element: approximate volume of agricultural product.
[0103] The third element: the speed of the stirring device determines the intensity of the water flow and the cleaning efficiency.
[0104] The fourth element: the amount of water before cleaning affects the water flow pattern and the separation effect of mud and residue.
[0105] In one embodiment of the present invention, the cleaning prediction model includes a hidden layer, which is constructed based on a convolutional neural network. The hidden layer formula is as follows:
[0106] ;
[0107] in, represents the feature state vector of the hidden layer output, express Activation function, represents the average pooling operation, represents the standard vector of the input, represents the convolution operation, represents a one-dimensional convolution vector, represents the bias vector, represents the weight matrix of the fully connected layer, Bias matrix for fully connected layers.
[0108] Specifically, convolution operations, pooling operations and fully connected layers are used to extract deep patterns from feature data to improve the prediction accuracy of cleaning effects. The beneficial effect of this method is that compared with traditional linear models or manual rule settings, this deep learning method can automatically learn the impact of factors such as different types of agricultural products, washing water volume, stirring speed, etc. on cleanliness, thereby achieving personalized optimization in the cleaning process of different batches of agricultural products. At the same time, convolutional neural networks can efficiently process large-scale data, reduce manual intervention, and improve the generalization ability of predictions, ensuring that the cleaning solution can both reduce water consumption and optimize cleanliness, meeting the efficient, accurate and automated production needs of smart factories.
[0109] In one embodiment of the present invention, the calculation formula of the loss function is as follows:
[0110] ;
[0111] in, represents the loss function value, and Represent the first loss weight and the second loss weight respectively, represents the number of sample data, express The index of represents the cleanliness score of the i-th group of feature data, represents the cleaning score predicted by the cleaning prediction model for the i-th set of feature data, represents the label of the i-th group of feature data, Represents the predicted label of the i-th set of feature data.
[0112] Specifically, by optimizing the loss function, the cleaning prediction model can take into account both cleanliness prediction and vortex judgment, thereby improving the accuracy and stability of the model. The loss function comprehensively considers the cleaning score error and vortex labeling error to ensure that the model can not only accurately predict the cleanliness of agricultural products after cleaning, but also effectively distinguish the water flow state. Compared with single-objective optimization, this method can balance the cleaning quality and mud separation effect, ensuring that stains can be removed while preventing secondary contamination. Through the optimization of the loss function, the model can continuously learn the best cleaning strategies for different agricultural products, improve the intelligence, adaptability and resource utilization efficiency of cleaning, and ultimately achieve a more efficient and energy-saving intelligent cleaning process.
[0113] In one embodiment of the present invention, a cleaning scheme is planned for target agricultural products, including:
[0114] Step 81, obtaining the code and approximate volume of the target agricultural product within the target time period to obtain the first element and the second element of the feature vector of the target agricultural product;
[0115] Step 82, randomly fill the third element and the fourth element of the feature vector to obtain R feature vectors; wherein the third element is within the speed adjustment range of the stirring device, and the fourth element is within the addition range of the cleaning water in the cleaning device; normalize the R feature vectors to obtain R optimization vectors;
[0116] Step 83, calculating predicted cleaning scores and labels for the R optimized vectors through a cleaning prediction model;
[0117] Step 84, screening based on the predicted cleanliness scores of the R optimization vectors, specifically includes:
[0118] The optimization vector marked as 0 is used as the parent for iterative update;
[0119] The optimization vectors marked as 1 are sorted from large to small to obtain feature sorting; a preset number of optimization vectors in the feature sorting are retained from front to back, and the remaining optimization vectors are used as parents for iterative update;
[0120] Step 85 , looping step 84 for a preset number of times, outputting the optimization vector with the largest cleaning score marked as 1 as the cleaning solution for the target agricultural product.
[0121] Specifically, by intelligently optimizing the cleaning scheme, the cleaning process can be made more accurate and efficient, and can be adapted to different types and batches of agricultural products. This method uses a cleaning prediction model combined with an optimization algorithm to automatically calculate key parameters such as the optimal water volume and stirring speed within the target time period to ensure the best cleaning effect while reducing water waste and energy consumption. Compared with traditional empirical cleaning, this method can dynamically adjust cleaning parameters, improve production consistency, reduce damage to agricultural products, and improve cleaning efficiency. In addition, the optimization process adopts an iterative screening mechanism to continuously update the optimal cleaning strategy, so that the system has adaptive capabilities and can cope with the cleaning needs of different environments and different agricultural products, ultimately achieving an intelligent cleaning solution that saves energy and reduces consumption, improves cleanliness, and reduces manual intervention.
[0122] It should be noted that updating the parent generation based on crossover and mutation of genetic algorithms is a prior art and will not be described in detail.
[0123] The above describes an embodiment of the present embodiment, but the present embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present embodiment, ordinary technicians in this field can also make many forms, all of which are protected by the present embodiment.
Claims
1. A deep learning algorithm model optimization and deployment method for smart factories, characterized in that: include: Step 1: Randomly clean the agricultural products, including: Set the range of adding cleaning water in the cleaning device and the speed adjustment range of the stirring device; Adding cleaning water into the cleaning device based on the cleaning water addition range; Stirring the cleaning device based on a speed adjustment range of the stirring device; Step 2, repeating step 1 for N times to obtain N groups of characteristic data; wherein the i-th group of characteristic data includes: the amount of washing water added and the speed of the stirring device for the i-th random washing of the agricultural products; Step 3, obtaining the approximate volume of the agricultural products randomly washed for the i-th time, and determining the number of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume; Step 4, obtaining the pre-cleaning image and the post-cleaning image of the agricultural product randomly cleaned for the i-th time; and scoring the i-th group of feature data based on the pre-cleaning image and the post-cleaning image to obtain a cleaning score for the i-th group of feature data; Step 5, based on the cleaning scores corresponding to the N groups of feature data, a cleaning prediction model is trained; Step 6: within the target time period, based on the cleaning prediction model and combined with the optimization algorithm, a cleaning plan is planned for the target agricultural product; wherein the cleaning plan for the target agricultural product indicates determining the amount of cleaning water added and the speed of the stirring device for the target agricultural product.
2. According to claim 1, a method for optimizing and deploying a deep learning algorithm model for a smart factory is characterized in that: Get the approximate volume of the produce washed randomly for the ith time, including: The volume of the washing water added to the agricultural products randomly washed for the i-th time is taken as the first volume; Obtaining a second volume of the agricultural product randomly washed for the i-th time in the washing device after adding washing water; The difference between the second volume and the first volume is taken as the approximate volume of the agricultural products randomly washed for the i-th time.
3. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 1, characterized in that: Determining the quantity of characteristic agricultural products corresponding to the i-th group of characteristic data based on the approximate volume includes: Based on prior knowledge, the standard volume of a single root, tuber and fruit corresponding to the agricultural product randomly washed for the i-th time is obtained; based on the approximate volume of the agricultural product randomly washed for the i-th time and the standard volume of a single root, tuber and fruit, the number of characteristic agricultural products is calculated, specifically including: ; in, represents the number of characteristic agricultural products of the i-th group of agricultural products, represents the approximate volume of the i-th group of agricultural products, represents the standard volume of a single root, tuber or fruit corresponding to the i-th group of agricultural products, represents the first proportionality coefficient, Represents the bias coefficient.
4. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 3, characterized in that: Get the clean score of the i-th group of feature data, including: The images before and after washing of the agricultural products randomly washed for the i-th time are semantically segmented to obtain a first matrix and a second matrix; wherein the semantic segmentation means deleting non-agricultural product parts in the images before and after washing based on a semantic segmentation tool; Gray-scaling the first matrix and the second matrix to obtain a first gray-scale matrix and a second gray-scale matrix; Obtain the standard color of the surface of the agricultural product randomly washed for the i-th time, and grayscale the standard color to obtain a reference grayscale value; Calculate the difference between each element in the first grayscale matrix and the second grayscale matrix and the reference grayscale value. If the difference is greater than the preset grayscale threshold, replace the corresponding element in the first grayscale matrix or the second grayscale matrix with 1, otherwise replace it with 0, to obtain a first update matrix and a second update matrix; The cleanliness is calculated for the first update matrix and the second update matrix. The calculation formula for the cleanliness is as follows: ; in, Indicates cleanliness, represents the element in the pth row and qth column in the first update matrix or the second update matrix, represents the number of elements of the first update matrix or the second update matrix, express The index of The difference in cleanliness between the first grayscale matrix and the second grayscale matrix is calculated, and the difference is weighted to obtain the cleanliness score of the i-th group of agricultural products.
5. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 1, characterized in that: Get the clean score of the i-th group of feature data, including: The i-th group of feature data is labeled, specifically including: Obtaining a stirring and cleaning image corresponding to the agricultural products randomly cleaned for the i-th time; wherein the stirring and cleaning image represents a top view of the agricultural products randomly cleaned for the i-th time in the cleaning device; Perform edge detection on the stirring and cleaning image to obtain K feature edges; If there are feature edges in K with a number greater than a preset ratio intersecting at one point, the i-th group of feature data is marked as 1; otherwise, the i-th group of feature data is marked as 0; Establishing a feature vector for the i-th group of feature data includes: The type of agricultural products randomly washed for the ith time is encoded with real numbers to obtain the first element of the corresponding feature vector; the approximate volume of the agricultural products randomly washed for the ith time is used as the second element of the corresponding feature vector; the speed of the stirring device of the agricultural products randomly washed for the ith time is used as the third element of the corresponding feature vector; the first volume in the washing device of the agricultural products randomly washed for the ith time is used as the fourth element of the corresponding feature vector; Normalize the feature vector of the i-th group of feature data to obtain the corresponding standard vector; The standard vector of the i-th group of feature data is used as sample data, the cleaning score of the i-th group of feature data is used as the first sample label, and the annotation of the i-th group of feature data is used as the second sample label. The cleaning prediction model is obtained through loss function training.
6. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 1, characterized in that: The cleaning prediction model includes a hidden layer, which is built based on a convolutional neural network. The hidden layer formula is as follows: ; in, represents the feature state vector of the hidden layer output, express Activation function, represents the average pooling operation, represents the standard vector of the input, represents the convolution operation, represents a one-dimensional convolution vector, represents the bias vector, represents the weight matrix of the fully connected layer, Bias matrix for fully connected layers.
7. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 1, characterized in that: The loss function is calculated as follows: ; in, represents the loss function value, and Represent the first loss weight and the second loss weight respectively, represents the number of sample data, express The index of represents the cleanliness score of the i-th group of feature data, represents the cleaning score predicted by the cleaning prediction model for the i-th set of feature data, represents the label of the i-th group of feature data, Represents the predicted label of the i-th set of feature data.
8. The method for optimizing and deploying a deep learning algorithm model for a smart factory according to claim 1, characterized in that: Plan cleaning plans for target agricultural products, including: Step 81, obtaining the code and approximate volume of the target agricultural product within the target time period to obtain the first element and the second element of the feature vector of the target agricultural product; Step 82, randomly fill the third element and the fourth element of the feature vector to obtain R feature vectors; wherein the third element is within the speed adjustment range of the stirring device, and the fourth element is within the addition range of the cleaning water in the cleaning device; normalize the R feature vectors to obtain R optimization vectors; Step 83, calculating predicted cleaning scores and labels for the R optimized vectors through a cleaning prediction model; Step 84, screening based on the predicted cleanliness scores of the R optimization vectors, specifically includes: The optimization vector marked as 0 is used as the parent for iterative update; The optimization vectors marked as 1 are sorted from large to small to obtain feature sorting; a preset number of optimization vectors in the feature sorting are retained from front to back, and the remaining optimization vectors are used as parents for iterative update; Step 85 , looping step 84 for a preset number of times, outputting the optimization vector with the largest cleaning score marked as 1 as the cleaning solution for the target agricultural product.
Citation Information
Patent Citations
On-line identification apparatus and method for impurities in edible fungi
CN102519971A
Agricultural product future price prediction method and system based on text mining and deep learning model
CN115578137A