CN-116229053-B - Dynamic adjustment method for red date machine striker plate based on neural network
Abstract
The invention discloses a method for dynamically adjusting a blanking plate of a red jujube machine based on a neural network, which relates to the technical field of sorting equipment and comprises the steps of collecting images shot in the running process of the red jujube machine, carrying out background segmentation algorithm processing on the collected color images, and removing a background area; the method comprises the steps of classifying collected images, giving different tag numbers to each type, constructing a training data sample, conducting neural network training, designing a multi-branch convolutional neural network structure for classification, conducting training by using a data set, obtaining a neural network model after training, inputting images collected in real time by a camera into the neural network model, giving corresponding tag values, storing the tag values to the same position, updating the tag values in real time, calculating the tag values which are updated in real time and are fixed in length, counting the duty ratio of each type, determining the adjustment direction of a striker plate, and controlling a motor according to a determined striker plate adjustment scheme to finish adjustment. The invention can improve the feeding and sorting efficiency of the red date machine.
Inventors
- WEI FANGKUN
- QIAN TAO
- LI WENBAO
- LIU HESHAN
Assignees
- 安徽唯嵩光电科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221207
Claims (5)
- 1. A method for dynamically adjusting a red date machine striker plate based on a neural network is characterized by comprising the following steps: S1, acquiring RGB images shot in the running process of a red date machine by using a camera, performing background segmentation algorithm processing on the acquired color images, and removing a background area; Step S2, classifying the acquired images, giving different label numbers to each type, constructing a training data sample, and training a neural network; Step S3, designing a multi-branch convolutional neural network structure for classification, training by using the data set in the step S2, and acquiring a neural network model after training is completed; s4, inputting the image acquired by the camera in real time into a neural network model through the step S1, giving out a corresponding tag value, storing the tag value to the same position, and updating in real time; S5, calculating a label value which is updated in real time and has a fixed length, and counting the duty ratio of each type, so as to determine the adjustment direction of the striker plate and improve the effective filling rate of materials on the red date machine; Step S6, according to the striker plate adjusting scheme determined in the step S5, the striker plate is issued to a servo motor through a control unit, so that the striker plate is adjusted; In the step S1, after removing the background from the collected original RGB image, equally dividing the image to ensure that each image has the same size and only has one groove for storing materials; The step S5 of calculating the different label value duty ratios comprises the following steps: step S501, data stored in a storage unit are A1, A2, A3, and An, wherein n is the number of machine rollers, A1, A2, A3, and An represent predicted tag values, the number of data with the tag value of 0 is accumulated and recorded as S0, the number of data with the tag value of 1 is accumulated and recorded as S1, and the number of data with the tag value of 2 is accumulated and recorded as S2; step S502 of calculating the probability of each class, , , Among the three probabilities, firstly comparing whether P2 exceeds a set threshold M2, wherein the threshold M2 is set in advance, if the set threshold M2 is reached, sending down a signal for adjusting the angle of the large baffle plate, if the set threshold M2 is not reached, comparing whether the value of P0 reaches the set threshold M0, if the set threshold M0 is exceeded, sending down a signal for adjusting the angle of the small baffle plate, and if the set threshold M2 is not exceeded, not adjusting; In step S503, in the dynamic updating of the stored tag value data, P0, P1 and P2 are continuously updated, and whether the striker plate needs to be adjusted is judged in real time according to the sequence of step S502.
- 2. The method according to claim 1, wherein said step S2 comprises the steps of: Step 201, uniformly adjusting the image size to 224 x 224 pixels; Step S202, manually classifying the images and giving different labels, wherein 0 represents no date, 1 represents single date, and 2 represents multiple dates; And step 203, dividing the image endowed with the label into a training set, a verification set and a test set, wherein the training set, the verification set and the test set are divided into random divisions, the training set accounts for 80%, and the verification set and the test set respectively account for 10%.
- 3. The method according to claim 1, wherein the designing the convolutional neural network of step S3 comprises the steps of: Step 301, designing a convolutional neural network consisting of 8 convolutional layers, 4 batch normalization layers, 8 ReLU activation function layers, 1 global average pooling layer and 1 Softmax multi-classification layer, wherein the convolutional neural network comprises 8 convolutional unit blocks, and each unit block comprises a feature extraction layer and a feature superposition layer; step S302, inputting a trained sample into an input layer of a double-branch convolutional neural network, adopting AdamW optimization algorithm to replace the traditional SGD algorithm and Adam algorithm to train the double-branch convolutional neural network, adopting cross entropy to train the network until the loss function of the multi-branch convolutional neural network reaches the minimum value; And step S303, completing model convergence, and obtaining a trained network weight coefficient which can be used for subsequent prediction.
- 4. The method of claim 3, wherein in step S301, each of the 8 convolution unit blocks is configured to perform convolution with a convolution kernel of 3*3 and a convolution kernel of 1*1 to extract features, then send the features to a feature-stack layer to perform information stacking, and add a batch normalization layer to an even unit block to directly perform stacking output with the feature-stack layer, output the results to a next unit block through a ReLU activation function layer, and after passing through 8 convolution unit blocks, flattening the data through a global average pooling layer, and finally output the corresponding results through a Softmax classification layer.
- 5. The method according to claim 1, wherein the storing of the pair of prediction results of step S4 comprises the steps of: Step S401, scaling the image to 224 x 224 pixels, inputting the image to a trained convolutional neural network model, and sequentially giving a label value corresponding to each image by the model; Step S402, sequentially storing the tag values in a storage unit, and storing every k images, wherein k is the number of the images in the step S1, and then continuously updating and increasing the length of the tag values; Step S403, when the label value length is consistent with the number of rollers corresponding to the machine chain, the result of the follow-up prediction is continuously stored, and meanwhile, the label data stored in the storage unit at the beginning is deleted.
Description
Dynamic adjustment method for red date machine striker plate based on neural network Technical Field The invention belongs to the technical field of sorting equipment, and particularly relates to a method for dynamically adjusting a material baffle plate of a red date machine based on a neural network, so that the feeding and sorting efficiency of the red date machine is improved. Background With the rise of artificial intelligence, the machine letter sorting has replaced artifical letter sorting gradually, and the standard of artifical letter sorting is different and have stronger subjectivity, can't satisfy the demand in market. Since the market competition of the red date sorting apparatus is intense, in order to improve the market competitiveness of the apparatus, it is necessary to further improve the sorting efficiency and usability of the apparatus. The angle of the baffle plate of the existing equipment is preset, and cannot be dynamically adjusted in real time according to the condition of full distribution of the rollers and the accumulation condition of materials. Disclosure of Invention (1) The invention aims to solve the technical problems The red date sorting machine can not automatically adjust the angle of the baffle plate to adapt to material sorting in the operation process, and solves the problems that the roller is low in full rate or materials are piled up to return materials due to the angle of the baffle plate. (2) The invention adopts the technical proposal that Aiming at the technical problems, the invention aims to provide a method for dynamically adjusting the angle of a baffle plate of a red date machine based on a neural network, so that the sorting efficiency and stability of the red date machine are improved, and the secondary sorting of materials is reduced. The method specifically comprises the following steps: S1, acquiring RGB images shot in the running process of a red date machine by using a camera, performing background segmentation algorithm processing on the acquired color images, and removing a background area; Step S2, classifying the acquired images, giving different label numbers to each type, constructing a training data sample, and training a neural network; Step S3, designing a multi-branch convolutional neural network structure for classification, training by using the data set in the step S2, and acquiring a neural network model after training is completed; s4, inputting the image acquired by the camera in real time into a neural network model through the step S1, giving out a corresponding tag value, storing the tag value to the same position, and updating in real time; S5, calculating a label value which is updated in real time and has a fixed length, and counting the duty ratio of each type, so as to determine the adjustment direction of the striker plate and improve the effective filling rate of materials on the red date machine; and S6, according to the striker plate adjusting scheme determined in the step S5, the striker plate is issued to the servo motor through the control unit, so that the striker plate is adjusted. Further, in the step S1, after the background of the collected original RGB image is removed, the image is equally divided, so that the size of each image is ensured to be the same and only one groove for storing materials is provided. Further, the step S2 includes the steps of: Step 201, uniformly adjusting the image size to 224 x 224 pixels; Step S202, manually classifying the images and giving different labels, wherein 0 represents no date, 1 represents single date, and 2 represents multiple dates; And step 203, dividing the image endowed with the label into a training set, a verification set and a test set, wherein the training set, the verification set and the test set are divided into random divisions, the training set accounts for 80%, and the verification set and the test set respectively account for 10%. Further, the design convolutional neural network of the step S3 includes the following steps: Step 301, designing a convolutional neural network consisting of 8 convolutional layers, 4 batch normalization layers, 8 ReLU activation function layers, 1 global average pooling layer and 1 Softmax multi-classification layer, wherein the convolutional neural network comprises 8 convolutional unit blocks, and each unit block comprises a feature extraction layer and a feature superposition layer; step S302, inputting a trained sample into an input layer of a double-branch convolutional neural network, adopting AdamW optimization algorithm to replace the traditional SGD algorithm and Adam algorithm to train the double-branch convolutional neural network, adopting cross entropy to train the network until the loss function of the multi-branch convolutional neural network reaches the minimum value; And step S303, completing model convergence, and obtaining a trained network weight coefficient which can be used for subsequent prediction. Furth