A smart classification method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]为了解决传统的光幕定位方式对皮带速度的稳定性要求较高,如果皮带速度发生变化,会影响长度信息的准确性;对安装环境的适应性较差,物流车间中充斥着大量的灰尘和不可避免的磕碰,导致传统的光幕定位方式极易积灰和损坏;测量误差是每对传感器之间间距的两倍,若想要更高的精度,需要更多的红外发射管和红外接收管,会极大地增加成本;并且,由于经过光幕后需要停在调速段中间等待空车到来,在不改变机械结构的情况下,加速距离往往无法满足高速供包的要求的技术问题,本发明提供了一种智能分类方法及装置
[0024]在本发明中,通过图像识别的方式,基于物流包裹分类模型,对实时物流包裹图像进行分类识别,进而根据分类识别结果,实现对于物流包裹进行定位,对皮带速度的稳定性要求低,对安装环境的适应性强,成本低廉,稳定性高,无需中途等待,有利于实现高速供包,对于物流包裹的分类定位准确性高。
Smart Images

Figure CN118506056B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an intelligent classification method and apparatus. Background Technology
[0002] The express delivery industry is an important sector in China's current economic development, providing convenient and efficient logistics services to various industries. In particular, with the rise of the Internet and e-commerce, the express delivery industry has also ushered in a period of rapid development.
[0003] In automated sorting, the parcel feeder is a crucial piece of equipment. It's responsible for transferring parcels from the collection section to the sorting trolley, while simultaneously performing operations such as barcode scanning, weighing, and positioning. The parcel feeder typically consists of three parts: the collection section, the speed control section, and the loading section. The collection section is equipped with a barcode reading and weighing system to acquire the parcel's barcode and weight information, and based on this information, determines the drop slot and assigns the parcel to the sorting trolley. At the end of the collection section, a light curtain is installed. As a parcel passes through the light curtain, the system automatically detects its length and width, calculating the parcel's length, width, and the distance from its center point to the short side of the feeder. After passing through the light curtain, the parcel stops at the center of the speed control section, awaiting the arrival of the loading trolley. Based on the parcel's center point and weight information, the system determines the parcel's loading speed, ensuring that the speed of the collection section matches the conveyor belt speed of the loading section, preventing slippage at this stage. The loading section uses a narrow belt conveyor with a fixed conveying speed that matches the speed of the loop line. This controls the precise feeding of packages into the center of the high-speed moving sorting cart belt.
[0004] While this traditional light curtain positioning method is simple and easy to use, it also has some limitations and shortcomings. First, it requires high stability of the belt speed; changes in belt speed will affect the accuracy of length information. Second, it is poorly adaptable to the installation environment; logistics workshops are filled with dust and inevitable bumps, making it prone to dust accumulation and damage. Third, the measurement error of the traditional light curtain positioning method is twice the distance between each pair of sensors; achieving higher accuracy requires more infrared emitters and receivers, significantly increasing costs. Furthermore, because it needs to stop in the middle of the speed adjustment section after passing through the light curtain to wait for an empty vehicle, the acceleration distance of the traditional light curtain positioning method often cannot meet the requirements of high-speed package feeding without changing the mechanical structure. Summary of the Invention
[0005] To address the technical problems of traditional light curtain positioning methods, which require high stability of belt speed (changes in belt speed affect the accuracy of length information), poor adaptability to installation environments (dust-filled logistics workshops and unavoidable bumps make traditional light curtain positioning methods prone to dust accumulation and damage), measurement errors (twice the distance between each pair of sensors), and the need for more infrared emitters and receivers for higher accuracy (significantly increasing costs), and the inability to meet the requirements of high-speed package feeding without changing the mechanical structure, this invention provides an intelligent sorting method and device.
[0006] The technical solutions provided by the embodiments of the present invention are as follows:
[0007] First aspect:
[0008] An intelligent classification method provided in this embodiment of the invention includes:
[0009] S1: Obtain a logistics package dataset, which includes images of logistics packages;
[0010] S2: Construct a logistics parcel classification model based on YOLOv5;
[0011] S3: Combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function of the logistics parcel classification model;
[0012] S4: With the goal of minimizing the ECIoU loss function of the logistics package classification model, the logistics package classification model is trained using the logistics package images;
[0013] S5: Obtain real-time images of logistics packages;
[0014] S6: Using the trained logistics package classification model, classify the logistics packages based on the real-time logistics package images.
[0015] The second aspect:
[0016] This invention provides an intelligent classification device for implementing the intelligent classification method as described in the first aspect, characterized in that the device comprises:
[0017] The first acquisition module is used to acquire a logistics package dataset, which includes images of logistics packages.
[0018] The first building module is used to build a logistics parcel classification model based on YOLOv5;
[0019] The second construction module is used to combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function of the logistics parcel classification model;
[0020] The training module is used to train the logistics package classification model using the logistics package images, with the goal of minimizing the ECIoU loss function of the logistics package classification model.
[0021] The second acquisition module is used to acquire real-time images of logistics packages;
[0022] The classification module is used to classify logistics packages based on the real-time logistics package images using a trained logistics package classification model.
[0023] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following:
[0024] In this invention, image recognition is used to classify and identify real-time logistics package images based on a logistics package classification model. Then, based on the classification and identification results, the logistics packages are located. This method has low requirements for belt speed stability, strong adaptability to the installation environment, low cost, high stability, and eliminates the need for waiting in the middle, which is conducive to achieving high-speed package supply. The classification and positioning accuracy of logistics packages is also high. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart illustrating an intelligent classification method provided in an embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram of an FPN network structure provided in an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of the structure of a deep detection head provided in an embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram of the structure of an intelligent classification device provided in an embodiment of the present invention. Detailed Implementation
[0030] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0031] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0032] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0033] Reference manual attached Figure 1 The diagram shows a flowchart of an intelligent classification method provided by an embodiment of the present invention.
[0034] This invention provides an intelligent sorting method, which can be implemented by a logistics parcel sorting device, which can be a terminal or a server. The processing flow of the intelligent sorting method may include the following steps:
[0035] S1: Obtain the logistics parcel dataset.
[0036] The logistics parcel dataset includes images of logistics parcels.
[0037] It should be noted that, due to the scarcity of public datasets for target detection in logistics parcels, this invention uses a self-built logistics parcel dataset, capturing images of logistics parcels using an image acquisition device. LabelImg is used to annotate the captured logistics parcel images.
[0038] The image acquisition device is the MER2-1220-32U3M industrial camera from Daheng Imaging, with an image pixel size of 4024*3036.
[0039] Optionally, the logistics parcel dataset can be randomly divided into a training set, a validation set, and a test set in a ratio of approximately 4:1:1.
[0040] S2: Construct a logistics parcel classification model based on YOLOv5.
[0041] YOLOv5 (You Only Look Once version 5) is an object detection algorithm, an extension of the YOLO series, and an improvement upon YOLOv3 and YOLOv4. Compared to previous models, YOLOv5 improves detection accuracy while maintaining detection speed. The YOLOv5 model has five architectures: YOLOv5n, YOLOv5s, YOLOv5m, YOLOv5l, and YOLOv5x. The main differences between these five architectures are the number of convolutional kernels and the bottlenecks in specific parts.
[0042] Among them, the logistics parcel classification model is used to classify logistics parcels.
[0043] Furthermore, the classification categories include: bubble wrap, foam, boxes, paper, plastic bags, and woven bags, etc.
[0044] In the scenario of identifying logistics packages, the targets are mainly large objects, which typically possess more internal structure and semantic information. This makes the semantic information provided by deep feature maps have a higher priority than the texture information provided by shallow feature maps in the identification task, because deep features can better capture the overall shape and structure of the target. On the other hand, in well-lit and high-contrast package delivery scenarios, due to the clearer visual conditions, the discriminative power of texture features may be relatively low, as these features are less affected by changes in lighting and contrast. Conversely, deep semantic features may be more prominent in this situation because they are better able to capture the overall shape and structure of the target, which is more important for accurate target detection under good lighting conditions. Furthermore, although traditional vision methods have been used to filter by hands, this filtering may fail due to factors such as ambient lighting, as the logistics package may be obscured by the delivery worker's hands. Deep semantic features can better handle partial occlusion of targets because they have stronger contextual understanding, enabling the model to better infer the integrity of the target. Considering the above three points, this invention redesigns the FPN network structure in YOLOv5.
[0045] Reference manual attached Figure 2 The diagram shows a schematic of an FPN network structure provided by an embodiment of the present invention.
[0046] Reference manual attached Figure 3 The diagram shows a structural schematic of a deep detection head provided in an embodiment of the present invention.
[0047] In one possible implementation, S2 specifically includes sub-steps S201 and S202:
[0048] S201: Modify the FPN network structure of YOLOv5 by adding deep detection heads and deleting some shallow detection heads.
[0049] Among them, the deep detection head is used to focus on the deep semantic features of the image, thereby improving the detection capability of large targets.
[0050] Furthermore, in order to reduce computational burden, lower noise, and focus more on large targets, this invention removes part of the shallow detection head.
[0051] Among them, the shallow detection head is usually responsible for extracting shallow features of the image. These features are usually more sensitive to the detection of small targets because they contain more local detail information.
[0052] Furthermore, while adding a deep detection head improves detection capabilities, it also increases the computational burden to some extent. To reduce computational intensity, this invention introduces the PConv convolution operation.
[0053] S202: Introduce PConv convolution operation to build a logistics parcel classification model based on YOLOv5. PConv convolution operation is used to selectively extract features on some input channels, while the remaining channels remain unchanged.
[0054] It's worth noting that PConv convolution operations leverage the similarity between features from different channels and the redundancy in their feature maps to optimize computational costs and reduce the number of floating-point operations. During transportation, packages may be partially obscured or damaged, making labels or other important information invisible. PConv convolution operations can effectively handle this missing information by learning from surrounding pixel values to fill in the missing parts, thereby improving the accuracy of recognition and detection.
[0055] In one possible implementation, the formula for calculating the number of floating-point operations in PConv convolution operations is:
[0056]
[0057] Where h represents the height of the feature map, w represents the width of the feature map, k represents the size of the convolution kernel, and c p Indicates the number of output channels.
[0058] It can be seen that, at a typical 1:4 ratio, the number of floating-point operations in PConv convolution operations is significantly less than that in ordinary Conv.
[0059] The memory access amount for PConv convolution operations is:
[0060]
[0061] It can be seen that PConv convolution operations also have a smaller memory access volume, which is only a fraction of that of regular convolution.
[0062] In summary, by integrating PConv convolutions with regular convolutions in the YOLOv5 network model, this invention can reduce the number of parameters in the model while maintaining performance.
[0063] S3: Combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function for the logistics parcel classification model.
[0064] The CIoU (Complete Intersection over Union) loss function is the loss function currently used in the YOLOv5 detection model. The CIoU loss function considers three important geometric factors: overlap area, center point distance, and aspect ratio.
[0065] The EIoU (Embedding Intersection over Union) loss function is an improvement on CIoU. It introduces the concept of embedding space and improves the performance of object detection models by calculating the similarity between bounding box embeddings.
[0066] While the CIoU loss function is more effective than IoU in handling aspect ratios and center point differences, it may not be sensitive enough to certain specific situations (such as objects with extreme aspect ratios), leading to poor performance in these cases. Since the shape and size of logistics packages can vary greatly, the robustness of the model is particularly important in logistics scenarios. Therefore, we combine the advantages of the CIoU and EIoU loss functions and introduce the ECIoU loss function.
[0067] In one possible implementation, the specific formula for the ECIoU loss function is as follows:
[0068]
[0069]
[0070]
[0071] Among them, L ECIOU Let ECIoU represent the loss function, IOU represent the intersection-over-union ratio, α represent the weighting coefficient, v represent the consistency of aspect ratio between the predicted box and the ground truth box, and ρ(b,b) represent the average of the predicted and ground truth boxes. gt ρ(h,h) represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. gt) represents the Euclidean distance between the heights of the predicted bounding box and the ground truth bounding box, and c represents the diagonal distance between the minimum closed regions of the predicted bounding box and the ground truth bounding box. h c represents the diagonal distance between the predicted bounding box and the ground truth bounding box in the height direction, representing the minimum closed region. w The distance between the predicted bounding box and the ground truth bounding box is the diagonal distance of the smallest closed region in the width direction, where w represents the width of the predicted bounding box and h represents the height of the predicted bounding box. gt h represents the width of the actual bounding box. gt This represents the height of the actual bounding box.
[0072] In this invention, combining the CIoU loss function and the EIoU loss function can more comprehensively evaluate the difference between the predicted box and the real box, thereby achieving more accurate bounding box localization in logistics package recognition. It can also better adapt to changes in package shape and size, and improve the detection accuracy of different packages.
[0073] S4: With the goal of minimizing the ECIoU loss function of the logistics parcel classification model, the logistics parcel classification model is trained using logistics parcel images.
[0074] S5: Get real-time images of logistics packages.
[0075] S6: Using the trained logistics package classification model, classify logistics packages based on real-time logistics package images.
[0076] In practical applications, hand contact with packages can cause significant interference. Hand obstruction not only severely affects the accuracy of package positioning, but the presence of a hand within the detection area usually indicates that the package is not yet properly positioned and its location may have changed. To effectively eliminate this interference, we employed a filtering method based on average grayscale values.
[0077] In one possible implementation, after S1 and before S2, it further includes:
[0078] S7: Manual filtering is performed on logistics package images using a filtering algorithm based on average grayscale values.
[0079] In one possible implementation, S7 specifically includes sub-steps S701 to S705:
[0080] S701: Determine the supply area in the logistics package image.
[0081] It should be noted that the action of workers feeding packages onto the equipment usually occurs within a package feeding area defined by two right-angled boundaries.
[0082] S702: Divide the package supply area into A horizontal and B vertical sub-areas.
[0083] S703: Calculate the difference between the average gray value and the normal value for each small area.
[0084] The formula for calculating the average grayscale value is as follows:
[0085]
[0086] in, Let m represent the average gray value, n represent the length of the image, and g(i,j) represent the width of the image. g(i,j) is the gray value of the image at position (i,j).
[0087] S704: Count the number of small regions where the difference between the average gray value and the normal value exceeds the threshold.
[0088] S705: Determine whether a hand is in the bag supply area by counting the number of small areas where the difference between the average gray value and the normal value exceeds a threshold. If so, perform hand filtering; otherwise, proceed to the next step.
[0089] In this invention, hand filtering helps eliminate interfering factors in images, such as workers' hands or other irrelevant objects, thereby reducing the possibility of misclassification and improving the accuracy of the classification model. By identifying and filtering out hands in images, the false detection rate can be reduced, that is, the situation of misclassifying workers' hands as logistics packages can be reduced, thereby improving the stability and reliability of the system.
[0090] Next, it's necessary to determine if the package is stationary. This is especially crucial for packages with uneven bottoms. Even when placed on a flat surface, these packages may wobble due to their uneven bottoms, such as being airborne or swinging due to instability. To accurately determine if a package is stationary, this invention employs an average hash algorithm to capture changes between two consecutive image frames.
[0091] In one possible implementation, after S1 and before S2, it further includes:
[0092] S8: Using the average hash algorithm, determine whether the logistics package is stationary based on the image of the package. If so, proceed to the next step.
[0093] In one possible implementation, S8 specifically includes sub-steps S801 to S803:
[0094] S801: Based on the average hash algorithm, map each pixel position in the logistics package image to the corresponding character in the hash string.
[0095] The specific characters in the hash string are:
[0096]
[0097] Here, HashBit represents a character in the hash string.
[0098] S802: Calculate the Hamming distance between the hash strings of two consecutive frames of logistics package images:
[0099]
[0100] Where H represents the Hamming distance, Hash_Code1 represents the hash string of the previous frame of the logistics package image, Hash_Code1[i] represents the i-th character in the hash string of the previous frame of the logistics package image, Hash_Code2 represents the hash string of the next frame of the logistics package image, and Hash_Code2[i] represents the i-th character in the hash string of the next frame of the logistics package image.
[0101] S803: Determine if the Hamming distance is less than the fluctuation threshold. If yes, determine that the package is stationary and proceed to the next step. Otherwise, determine that the package is not stationary.
[0102] In this invention, stationary objects are more easily detected and classified correctly. By determining whether a logistics package is stationary, it can be classified while the object is still, thereby improving classification accuracy. Furthermore, it ensures that the package is stable before processing, thus guaranteeing the accuracy and stability of subsequent operations.
[0103] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following:
[0104] In this invention, image recognition is used to classify and identify real-time logistics package images based on a logistics package classification model. Then, based on the classification and identification results, the logistics packages are located. This method has low requirements for belt speed stability, strong adaptability to the installation environment, low cost, high stability, and eliminates the need for waiting in the middle, which is conducive to achieving high-speed package supply. The classification and positioning accuracy of logistics packages is also high.
[0105] Reference manual attached Figure 4 The diagram shows a structural schematic of an intelligent classification device provided by the present invention.
[0106] The present invention also provides an intelligent classification device 20, which is used to implement any of the intelligent classification methods described above. The intelligent classification device 20 includes:
[0107] The first acquisition module 201 is used to acquire a logistics package dataset, which includes images of logistics packages.
[0108] The first building module 202 is used to build a logistics parcel classification model based on YOLOv5.
[0109] The second construction module 203 is used to combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function of the logistics parcel classification model.
[0110] Training module 204 is used to train the logistics package classification model using logistics package images, with the goal of minimizing the ECIoU loss function of the logistics package classification model.
[0111] The second acquisition module 205 is used to acquire real-time images of logistics packages.
[0112] The classification module 206 is used to classify logistics packages based on real-time logistics package images using a trained logistics package classification model.
[0113] In one possible implementation, the first building module 202 is specifically used for:
[0114] The FPN network structure of YOLOv5 is modified by adding deep detectors and deleting some shallow detectors.
[0115] A logistics parcel classification model based on YOLOv5 is constructed by introducing PConv convolution operations. PConv convolution operations are used to selectively extract features on some input channels.
[0116] In one possible implementation, the formula for calculating the number of floating-point operations in PConv convolution operations is:
[0117]
[0118] Where h represents the height of the feature map, w represents the width of the feature map, k represents the size of the convolution kernel, and c p Indicates the number of output channels.
[0119] The memory access amount for PConv convolution operations is:
[0120]
[0121] In one possible implementation, the specific formula for the ECIoU loss function is as follows:
[0122]
[0123]
[0124]
[0125] Among them, L ECIOULet ECIoU represent the loss function, IOU represent the intersection-over-union ratio, α represent the weighting coefficient, v represent the consistency of aspect ratio between the predicted box and the ground truth box, and ρ(b,b) represent the average of the predicted and ground truth boxes. gt ρ(h,h) represents the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. gt ) represents the Euclidean distance between the heights of the predicted bounding box and the ground truth bounding box, and c represents the diagonal distance between the minimum closed regions of the predicted bounding box and the ground truth bounding box. h c represents the diagonal distance between the predicted bounding box and the ground truth bounding box in the height direction, representing the minimum closed region. w The distance between the predicted bounding box and the ground truth bounding box is the diagonal distance of the smallest closed region in the width direction, where w represents the width of the predicted bounding box and h represents the height of the predicted bounding box. gt h represents the width of the actual bounding box. gt This represents the height of the actual bounding box.
[0126] In one possible implementation, the intelligent sorting device 20 further includes:
[0127] The filtering module is used to manually filter logistics package images using a filtering algorithm based on average grayscale values.
[0128] In one possible implementation, the filtering module is specifically used for:
[0129] Identify the supply area in the logistics package image.
[0130] The package supply area is divided into A horizontal and B vertical sub-areas.
[0131] Calculate the difference between the average gray value and the normal value for each small region.
[0132] The formula for calculating the average grayscale value is as follows:
[0133]
[0134] in, Let m represent the average gray value, n represent the length of the image, and g(i,j) represent the width of the image. g(i,j) is the gray value of the image at position (i,j).
[0135] The number of small regions whose difference between the average gray value and the normal value exceeds the threshold is counted.
[0136] The algorithm determines whether a hand is within the bag supply area by counting the number of small regions where the difference between the average gray value and the normal value exceeds a threshold. If so, hand filtering is performed; otherwise, the next step is initiated.
[0137] In one possible implementation, the intelligent sorting device 20 further includes:
[0138] The judgment module is used to determine whether the logistics package is stationary based on the image of the logistics package using an average hash algorithm. If so, proceed to the next step.
[0139] In one possible implementation, the determination module is specifically used for:
[0140] Based on the average hash algorithm, each pixel position in the logistics package image is mapped to the corresponding character in the hash string.
[0141] The specific characters in the hash string are:
[0142]
[0143] Here, HashBit represents a character in the hash string.
[0144] Calculate the Hamming distance between the hash strings of two consecutive frames of logistics package images:
[0145]
[0146] Where H represents the Hamming distance, Hash_Code1 represents the hash string of the previous frame of the logistics package image, Hash_Code1[i] represents the i-th character in the hash string of the previous frame of the logistics package image, Hash_Code2 represents the hash string of the next frame of the logistics package image, and Hash_Code2[i] represents the i-th character in the hash string of the next frame of the logistics package image.
[0147] Determine if the Hamming distance is less than the fluctuation threshold. If yes, determine that the package is stationary and proceed to the next step. Otherwise, determine that the package is not stationary.
[0148] It should be noted that the intelligent classification device 20 can implement the above-mentioned intelligent classification method and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate further.
[0149] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following:
[0150] In this invention, image recognition is used to classify and identify real-time logistics package images based on a logistics package classification model. Then, based on the classification and identification results, the logistics packages are located. This method has low requirements for belt speed stability, strong adaptability to the installation environment, low cost, high stability, and eliminates the need for waiting in the middle, which is conducive to achieving high-speed package supply. The classification and positioning accuracy of logistics packages is also high.
[0151] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0152] The following points need to be explained:
[0153] (1) The accompanying drawings of the embodiments of the present invention only involve the structures involved in the embodiments of the present invention. Other structures can refer to the general design.
[0154] (2) For clarity, the thickness of layers or regions is enlarged or reduced in the drawings used to describe embodiments of the present invention; that is, these drawings are not drawn to actual scale. It is understood that when an element such as a layer, film, region, or substrate is referred to as being “above” or “below” another element, the element may be “directly” located “above” or “below” the other element, or there may be intermediate elements.
[0155] (3) Where there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.
[0156] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An intelligent classification method, characterized in that, include: S1: Obtain a logistics package dataset, which includes images of logistics packages; S2: Construct a logistics parcel classification model based on YOLOv5; S3: Combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function of the logistics parcel classification model; S4: With the goal of minimizing the ECIoU loss function of the logistics package classification model, the logistics package classification model is trained using the logistics package images; S5: Obtain real-time images of logistics packages; S6: Using the trained logistics package classification model, classify the logistics packages based on the real-time logistics package images; Specifically, S2 includes: S201: Modify the FPN network structure of YOLOv5 by adding deep detection heads and deleting some shallow detection heads; S202: Introduce PConv convolution operation to construct a logistics parcel classification model based on YOLOv5. The PConv convolution operation is used to selectively extract features on some input channels. The formula for calculating the number of floating-point operations in the PConv convolution operation is as follows: in, Indicates the height of the feature map. Indicates the width of the feature map. Indicates the size of the convolution kernel. Indicates the number of output channels; The memory access amount for the PConv convolution operation is: The section following S1 and before S2 includes: S7: The logistics package image is manually filtered using a filtering algorithm based on the average gray value; Specifically, S7 includes: S701: Determine the package supply area in the logistics package image; S702: Divide the package supply area into A horizontal and B vertical small areas; S703: Calculate the difference between the average gray value and the normal value for each small area; The formula for calculating the average grayscale value is as follows: in, Indicates the average gray value. Indicates the length of the image. Indicates the width of the image. Is the image in position grayscale value; S704: Count the number of small regions where the difference between the average gray value and the normal value exceeds the threshold; S705: Determine whether a hand is within the package supply area by counting the number of small areas where the difference between the average gray value and the normal value exceeds a threshold using a filtering algorithm based on the average gray value. If so, perform hand filtering; otherwise, proceed to the next step.
2. The intelligent classification method according to claim 1, characterized in that, The specific formula for the ECIoU loss function is as follows: in, Describes the ECIoU loss function. Indicates intersection, union, and ratio. Indicates the weighting coefficient. This indicates the consistency between the aspect ratios of the predicted bounding box and the ground truth bounding box. This represents the Euclidean distance between the centers of the predicted bounding box and the ground truth bounding box. This represents the Euclidean distance between the heights of the predicted bounding box and the ground truth bounding box. This represents the diagonal distance between the smallest closed region of the predicted bounding box and the ground truth bounding box. This represents the diagonal distance between the predicted bounding box and the ground truth bounding box in the height direction, This represents the diagonal distance between the predicted bounding box and the ground truth bounding box in the width direction, This indicates the width of the prediction box. Indicates the height of the prediction box. This represents the width of the actual bounding box. This represents the height of the actual bounding box.
3. The intelligent classification method according to claim 1, characterized in that, After S1 and before S2, it further includes: S8: Using the average hash algorithm, determine whether the logistics package is stationary based on the image of the logistics package. If so, proceed to the next step.
4. The intelligent classification method according to claim 3, characterized in that, S8 specifically includes: S801: According to the average hash algorithm, map each pixel position in the logistics package image to the corresponding character in the hash string; The specific characters in the hash string are: in, Represents the characters in the hash string; S802: Calculate the Hamming distance between the hash strings of two consecutive frames of logistics package images: in, Indicates Hamming distance, This represents the hash string of the previous frame's logistics package image. The hash string representing the first image of the previous logistics package is... One character, This represents the hash string of the next frame of the logistics package image. The hash string representing the first frame of the logistics package image. One character; S803: Determine whether the Hamming distance is less than the fluctuation threshold; if yes, determine that the logistics package is in a stationary state and proceed to the next step; otherwise, determine that the logistics package is in a non-stationary state.
5. An intelligent classification device, said intelligent classification device being used to implement the intelligent classification method as described in any one of claims 1 to 4, characterized in that, The intelligent sorting device includes: The first acquisition module is used to acquire a logistics package dataset, which includes images of logistics packages. The first building module is used to build a logistics parcel classification model based on YOLOv5; The second construction module is used to combine the CIoU loss function and the EIoU loss function to construct the ECIoU loss function of the logistics parcel classification model; The training module is used to train the logistics package classification model using the logistics package images, with the goal of minimizing the ECIoU loss function of the logistics package classification model. The second acquisition module is used to acquire real-time images of logistics packages; The classification module is used to classify logistics packages based on the real-time logistics package images using a trained logistics package classification model. Specifically, the first construction module is used for: The FPN network structure of YOLOv5 is modified by adding deep detectors and deleting some shallow detectors; A logistics parcel classification model based on YOLOv5 is constructed by introducing PConv convolution operation, which is used to selectively extract features on some input channels; The formula for calculating the number of floating-point operations in the PConv convolution operation is as follows: in, Indicates the height of the feature map. Indicates the width of the feature map. Indicates the size of the convolution kernel. Indicates the number of output channels; The memory access amount for the PConv convolution operation is: The intelligent sorting device further includes: The judgment module is used to perform manual filtering on the logistics package image using a filtering algorithm based on the average gray value; The judgment module is specifically used for: Determine the package supply area in the logistics package image; The package supply area is divided into A horizontal and B vertical sub-areas. Calculate the difference between the average gray value and the normal value for each small region; The formula for calculating the average grayscale value is as follows: in, Indicates the average gray value. Indicates the length of the image. Indicates the width of the image. Is the image in position grayscale value; Count the number of small regions where the difference between the average gray value and the normal value exceeds a threshold. The system determines whether a hand is within the package supply area by counting the number of small regions where the difference between the average grayscale value and the normal value exceeds a threshold. If so, hand filtering is performed; otherwise, the next step is initiated.