Logistics sorting algorithm based on RCNN
By using an RCNN-based logistics sorting algorithm, image data is processed through center cropping and normalization. Combined with convolutional neural networks and ResNet, the problems of high complexity and poor adaptability in logistics sorting algorithms are solved, achieving efficient and accurate goods identification and classification, and reducing labor costs and error rates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2026-03-24
AI Technical Summary
Existing logistics sorting algorithms are complex and have poor adaptability, making it difficult to accurately identify and classify goods in a short time, resulting in high labor costs and high sorting error rates.
A logistics sorting algorithm based on RCNN is adopted. Image data is processed by center cropping and normalization. A feature extraction module is built by combining convolutional neural networks and ResNet. After feature extraction, a pyramid pooling layer is introduced for model training to improve recognition accuracy and stability.
It enables accurate identification and classification of goods in a short time, reduces labor costs, decreases sorting error rate, and improves logistics processing efficiency and accuracy.
Smart Images

Figure CN120198734B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a logistics sorting algorithm based on RCNN, which combines deep learning with logistics sorting and belongs to the technical field of deep learning application. BACKGROUND
[0002] Logistics sorting is widely used in e-commerce, express delivery, manufacturing and other fields. It can significantly improve the efficiency and accuracy of logistics processing by quickly and accurately classifying and sorting goods. It uses advanced automation technology and equipment to sort items according to certain rules to achieve efficient, accurate and fast logistics transmission.
[0003] Among them, the logistics sorting algorithm is a key technology in the logistics industry for optimizing the sorting process and improving sorting efficiency. It is realized by computer program, which is used to determine a series of rules and calculation methods for sorting order, sorting path and sorting strategy, aiming to improve sorting efficiency, reduce sorting errors and optimize overall logistics operation effect.
[0004] Therefore, an algorithm with low complexity and strong adaptability is needed to replace manual work and continuously, efficiently and accurately complete the sorting task, reducing labor costs. With the continuous progress of technology and the continuous expansion of application scenarios, logistics sorting algorithm will continue to play an important role in promoting the sustainable development and upgrading of the logistics industry. SUMMARY
[0005] The purpose of the present application is to invent an algorithm that can optimize the sorting process, so that goods can be accurately identified and classified in a short time, thereby improving processing speed. The algorithm can extract and classify features such as package size, packaging material and outer package integrity, replacing manual sorting work, reducing labor costs in the logistics industry, and reducing the error rate of manual sorting.
[0006] The technical idea of the present application is as follows: first, collect and integrate large-scale sample data sets containing original package images, and make the image matrix size consistent through center cropping, then normalize the image data matrix. Then build a training model based on CNN and ResNet to extract image features. After feature extraction, a pyramid pooling layer is connected to complete the construction of the RCNN model. Finally, train the RCNN model with large-scale data sets and save the model with the best performance.
[0007] The present application provides a logistics sorting algorithm based on RCNN (Residual Convolutional Neural Network), comprising the following steps:
[0008] Step 1: Image data collection and preprocessing,
[0009] The data set is composed of a large number of samples containing original package images, which present high diversity in size, packaging material and outer package integrity. For images of inconsistent sizes, center cropping is used to make the image matrix size consistent, and then the image data matrix is normalized to make the features between different dimensions have certain comparability in numerical value, preventing the numerical difference from affecting the training model too much;
[0010] Step two: RCNN model structure building;
[0011] Firstly, a feature extraction module is built based on a convolutional neural network structure, which is used for feature extraction of the image data matrix. The module is composed of multiple convolutional layers, pooling layers, batch normalization layers and Sigmoid layers stacked in order, and "ResNet" is introduced in the feature extraction module to solve the problems of gradient disappearance and gradient explosion in the training process of deep convolutional neural network, so that the network can learn the features of the data more easily in the training process, and the performance and stability of the network are improved. Then, a pyramid pooling layer is built after the feature extraction module to output image features and classify them through a Softmax layer,
[0012] Step three: RCNN model training;
[0013] The RCNN model is trained by collecting and integrating a large amount of data sets. During the training process, the model parameter configuration is adjusted systematically, the model is optimized through iteration, and the model version with the best performance is finally saved.
[0014] As a further technical solution of the present application, the center cropping method in step one determines the position and size of the cropped area according to the size of the original image and the target cropped size, and the formula is as follows:
[0015]
[0016] Where (left, top) represents the top-left corner coordinates of the cropped area, (right, bottom) represents the bottom-right corner coordinates of the cropped area, (width, height) and (new_width, new_height) represent the image sizes before and after cropping, respectively.
[0017] Further, in step one, the linear transformation is performed on each pixel value through normalization processing, so that the original data is mapped to the interval [a, b] (usually [0, 1] or [-1, 1]), and the preprocessed data is limited within a certain range, thereby eliminating the adverse effects of singular sample data. The maximum-minimum value normalization method is adopted in the present application, and the formula is as follows:
[0018]
[0019] Where, x i The elements represent the image data matrix, and max(x) and min(x) represent the maximum and minimum values of the data matrix elements, respectively.
[0020] Furthermore, in step two, the convolutional neural network extracts features layer by layer by stacking a series of layers. As the number of network layers increases, it brings about the problems of gradient vanishing and gradient exploding.
[0021] This problem is addressed by introducing residual blocks, which add a skip connection between the input and output.
[0022] The input feature is represented as x, and the output feature of one or more layers is represented as F(x). The formula F(x)+x can be implemented through a feedforward neural network with shortcut connections.
[0023] Furthermore, in step two, the pyramid pooling layer maps the local features extracted from the upper layer to the label space of the samples, forming a global feature representation for subsequent classification. It includes multi-scale max pooling, Flatten, Dropout, and Linear.
[0024] Max pooling significantly reduces the size of the feature map by extracting the maximum data from a specified window. Its formula is as follows:
[0025]
[0026] The input data for max pooling is in the form of (C, H) in W in The output data format is (C,H) out W out ), C represents the number of channels, padding is the padding, diplatin is the dilation, kernel_size is the window size, and stride is the stride.
[0027] The Linear transform applies a linear transformation to the input features using a weight matrix A. The formula is as follows:
[0028] y = xA T +b
[0029] Where x represents the input feature vector, A represents the weight matrix, b represents the bias vector, and y represents the output feature vector.
[0030] Furthermore, in step three, the model is first pre-trained on a large-scale dataset to obtain preliminary weights and feature extraction capabilities. Then, the pre-processed dataset is divided into a training set, a validation set, and a test set in an 8:1:1 ratio. The model is trained using the training set, and its parameters are continuously adjusted based on the data samples in the training set, allowing the model to better learn the features of the data and minimize training error. The validation set is used to select the optimal hyperparameters of the model, such as the number of training iterations, learning rate, and batch size, and to initially evaluate the model's performance. The test set is used to finally evaluate the model's generalization ability to verify its performance on unseen data.
[0031] The model training and testing used cross-entropy loss as the loss function, sigmoid as the activation function, SGD as the optimizer, 100 training iterations, a learning rate of 0.001, and a batch size of 64.
[0032] The parameters mentioned above interact with each other and jointly affect the performance of the model. The optimal parameter configuration can be found through experiments and validation.
[0033] After iterative training, the best-performing model version is saved.
[0034] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the RCNN-based logistics sorting algorithm.
[0035] A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the aforementioned RCNN-based logistics sorting algorithm.
[0036] Compared with the prior art, the technical solution adopted in this invention has the following advantages:
[0037] 1. This invention processes images of inconsistent sizes by center cropping, making their image matrix sizes consistent, thus avoiding errors caused by inconsistent image sizes and enhancing the applicability of the algorithm.
[0038] 2. This invention normalizes the image data matrix to make the features of different dimensions comparable in terms of values, preventing the values from being too large or too small from affecting the subsequent training model.
[0039] 3. This invention introduces "ResNet" into deep convolutional neural networks to solve the gradient vanishing and gradient exploding problems that occur during training, making it easier for the network to learn the features of the data during training and improving the network's performance and stability.
[0040] 4. This invention employs pyramid pooling layers to perform pooling operations on feature maps at different scales, acquiring multi-scale information and increasing the receptive field of neurons. Since packages of different sizes may have different feature scales, pyramid pooling layers can effectively capture these features at different scales, enabling the model to have good representation capabilities for targets of different sizes. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the application of an RCNN-based logistics sorting algorithm disclosed in this invention to a real-world logistics sorting scenario.
[0042] Figure 2 This is a flowchart of a logistics sorting algorithm based on RCNN disclosed in this invention.
[0043] Figure 3 This invention discloses a mathematical model for a logistics sorting algorithm based on RCNN, which incorporates the "ResNet" model.
[0044] Figure 4 This is a model structure diagram of a logistics sorting algorithm based on RCNN disclosed in this invention. Detailed Implementation
[0045] To enhance understanding of the present invention, the embodiments will be described in detail below with reference to the accompanying drawings.
[0046] Example: A logistics sorting algorithm based on RCNN (Residual Convolutional Neural Network) includes the following steps:
[0047] Step 1: Image data collection and preprocessing.
[0048] The dataset consists of a large number of samples containing original package images, which exhibit high diversity in size, packaging material, and outer packaging integrity. For images of inconsistent sizes, center cropping is used to make the image matrix size consistent. Then, the image data matrix is normalized to ensure that the features between different dimensions are numerically comparable, preventing excessive numerical differences from affecting the training model.
[0049] Step 2: Building the RCNN model structure;
[0050] First, a feature extraction module is built based on a convolutional neural network structure. This module is used to extract features from the image data matrix. It consists of multiple convolutional layers, pooling layers, batch normalization layers, and sigmoid layers stacked in an ordered manner. ResNet is introduced into the feature extraction module to solve the vanishing and exploding gradient problems that occur during the training process of deep convolutional neural networks. This makes it easier for the network to learn the features of the data during training, improving the network's performance and stability. Next, a pyramid pooling layer is built after the feature extraction module to output image features, which are then classified using a softmax layer.
[0051] Step 3: RCNN model training;
[0052] The RCNN model was trained by collecting and integrating a large-scale dataset. During training, the model parameters were systematically adjusted, and the model was iteratively optimized. Finally, the best-performing model version was saved.
[0053] As a further technical solution of the present invention, in the center cropping method of step one, the position and size of the cropping area are determined according to the size of the original image and the target cropping size, as shown in the following formula:
[0054]
[0055] Where (left,top) represents the coordinates of the top left corner of the cropping area, (right,bottom) represents the coordinates of the bottom right corner of the cropping area, and (width,height) and (new_width,new_height) represent the image dimensions before and after cropping, respectively.
[0056] Furthermore, in step one, a linear transformation is performed on each pixel value through normalization, mapping the original data to the interval [a,b] (usually [0,1] or [-1,1]), thus limiting the preprocessed data to a certain range and eliminating the adverse effects caused by outlier data. This invention employs a maximum-minimum normalization method, with the following formula:
[0057]
[0058] Where, x i The elements represent the image data matrix, and max(x) and min(x) represent the maximum and minimum values of the data matrix elements, respectively.
[0059] Furthermore, in step two, the convolutional neural network extracts features layer by layer by stacking a series of layers. As the number of network layers increases, it brings about the problems of gradient vanishing and gradient exploding.
[0060] This problem is addressed by introducing residual blocks, which add a skip connection between the input and output.
[0061] The input feature is represented as x, and the output feature of one or more layers is represented as F(x). The formula F(x)+x can be implemented through a feedforward neural network with shortcut connections.
[0062] Furthermore, in step two, the pyramid pooling layer maps the local features extracted from the upper layer to the label space of the samples, forming a global feature representation for subsequent classification. It includes multi-scale max pooling, Flatten, Dropout, and Linear.
[0063] Max pooling significantly reduces the size of the feature map by extracting the maximum data from a specified window. Its formula is as follows:
[0064]
[0065] The input data for max pooling is in the form of (C, H) in W in The output data format is (C,H) out W out ), C represents the number of channels, padding is the padding, diplatin is the dilation, kernel_size is the window size, and stride is the stride.
[0066] The Linear transform applies a linear transformation to the input features using a weight matrix A. The formula is as follows:
[0067] y = xA T +b
[0068] Where x represents the input feature vector, A represents the weight matrix, b represents the bias vector, and y represents the output feature vector.
[0069] Furthermore, in step three, the model is first pre-trained on a large-scale dataset to obtain preliminary weights and feature extraction capabilities. Then, the pre-processed dataset is divided into a training set, a validation set, and a test set in an 8:1:1 ratio. The model is trained using the training set, and its parameters are continuously adjusted based on the data samples in the training set, allowing the model to better learn the features of the data and minimize training error. The validation set is used to select the optimal hyperparameters of the model, such as the number of training iterations, learning rate, and batch size, and to initially evaluate the model's performance. The test set is used to finally evaluate the model's generalization ability to verify its performance on unseen data.
[0070] The model training and testing used cross-entropy loss as the loss function, sigmoid as the activation function, SGD as the optimizer, 100 training iterations, a learning rate of 0.001, and a batch size of 64.
[0071] The parameters mentioned above interact with each other and jointly affect the performance of the model. The optimal parameter configuration can be found through experiments and validation.
[0072] After iterative training, the best-performing model version is saved.
[0073] The RCNN-based logistics sorting algorithm disclosed in this invention is applied to the actual logistics sorting process as follows: First, images of the packages to be sorted are acquired through peripheral devices. Then, the algorithm extracts and classifies the integrity, material, and size features of the package's outer packaging. Packages with severely damaged outer packaging are sent to sorting port 1 and exited the sorting process. After manual processing of the outer packaging, they re-enter the sorting process. For packages whose outer packaging damage does not affect transportation, soft-packaged packages are sent to sorting port 2, and the remaining packages are sent to sorting ports 3 and 4 according to their size, thereby achieving the purpose of rapid package sorting.
[0074] like Figure 2 As shown, the logistics sorting algorithm based on RCNN disclosed in this invention mainly includes three steps: image data collection, preprocessing, RCNN model structure construction, and RCNN model training, and finally saves the model with the best performance.
[0075] like Figure 3 As shown, the logistics sorting algorithm based on RCNN disclosed in this invention addresses the problems of vanishing and exploding gradients by introducing "ResNet". The input feature is represented as x, and the output feature of one or more layers is represented as F(x). The formula F(x) + x is realized through a feedforward neural network with quick connections, that is, the input and output are directly added together.
[0076] like Figure 4 As shown, the logistics sorting algorithm based on RCNN disclosed in this invention consists of multiple convolutional layers, three residual blocks, a pyramid pooling layer, and a softmax layer. Each residual block contains three convolutional layers, three batch normalization layers, and a sigmoid activation function.
[0077] As shown in Table 1, the logistics sorting algorithm based on RCNN disclosed in this invention obtains the optimal model parameter configuration by systematically adjusting parameters during the training process and iteratively optimizing them.
[0078] Table 1: RCNN model parameter configuration and output size of each module
[0079]
[0080] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention. Equivalent transformations or substitutions made based on the above technical solutions all fall within the scope of protection of the claims of the present invention.
Claims
1. A logistics sorting algorithm based on RCNN, characterized in that... This includes the following steps: Step 1: Image data collection and preprocessing. For images of inconsistent sizes, center cropping is used to make the image matrix size consistent. Then, the image data matrix is normalized to ensure that features in different dimensions are numerically comparable, preventing excessive numerical differences from affecting the training model. Step 2: Building the RCNN model structure. First, a feature extraction module is built based on a convolutional neural network structure. This module is used to extract features from the image data matrix. The feature extraction module consists of multiple convolutional layers, pooling layers, batch normalization layers, and sigmoid layers stacked in an ordered manner. ResNet is introduced into the feature extraction module to address the vanishing and exploding gradient problems that occur during the training of deep convolutional neural networks. Next, a pyramid pooling layer is built after the feature extraction module to output image features, which are then classified using a softmax layer. Step 3: RCNN model training. The RCNN model is trained by collecting and integrating large-scale datasets. During the training process, the model parameters are systematically adjusted, the model is optimized iteratively, and finally the optimal model parameters are saved. In step two, Introducing a residual block involves adding a skip connection between the input and output. Input features are represented as One or more layers of output features are represented as The formula is implemented through a feedforward neural network with quick connections; In step two, the pyramid pooling layer maps the local features extracted from the upper layer to the label space of the samples, forming a global feature representation. This representation includes multi-scale max pooling, Flatten, Dropout, and Linear pooling. Max pooling extracts the maximum amount of data from a specified window, and its formula is as follows: The input data for max pooling is in the form of: The output data format is , Indicates the number of channels. For filling, For expansion, For window size, Step size, Linear uses a weight matrix The linear transformation of the input features is given by the following formula: in, This represents the input feature vector. Represents the weight matrix. This represents the bias vector. This indicates the output feature vector; In step one, the center cropping method determines the position and size of the cropping area based on the dimensions of the original image and the target cropping size, as shown in the following formula: in, This indicates the coordinates of the top-left corner of the cropping area. This indicates the coordinates of the bottom right corner of the cropped area. and These represent the image dimensions before and after cropping, respectively. In step one, a linear transformation is performed on each pixel value through normalization, mapping the original data to the interval [a, b]. This limits the preprocessed data to a certain range, thereby eliminating the adverse effects caused by outlier samples. The maximum-minimum normalization method is used, and the formula is as follows: in, Represents the elements of the image data matrix. and These represent the maximum and minimum values of the elements in the data matrix, respectively. In step three, the model is first pre-trained on a large-scale dataset to obtain preliminary weights and feature extraction capabilities. Then, the pre-processed dataset is divided into training, validation, and test sets in an 8:1:1 ratio to prevent overfitting. The model is trained using the training set, and its parameters are continuously adjusted based on the data samples in the training set to help the model better learn the features of the data and minimize training error. The validation set is used to select the optimal hyperparameters and to initially evaluate the model's performance. The test set is used to finally evaluate the model's generalization ability and verify its performance on unseen data. The model training and testing used cross-entropy loss as the loss function, sigmoid as the activation function, SGD as the optimizer, 100 training iterations, a learning rate of 0.001, and a batch size of 64.
2. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the logistics sorting algorithm based on RCNN as described in claim 1 above.
3. A computer-readable storage medium storing computer instructions thereon, characterized in that: When the computer instruction is executed by the processor, it implements the RCNN-based logistics sorting algorithm as described in claim 1.
Citation Information
Patent Citations
Remote traffic sign detection and recognition method based on F-RCNN
CN110163187A
Non-uniform texture small defect detection method based on improved Faster R-CNN model
CN111598861A
Chip defect image classification method based on ResNet network
CN113076989A
Target detection method and device
CN115311742A
Logistics sorting system based on deep learning
CN116511060A