Stereoscopic warehouse stacked goods checking method based on improved YOLO11-Seg
The improved YOLO11-Seg model conducts a three-dimensional warehouse cargo inventory, which solves the problem of relying on manual and electronic tags in the existing technology, and achieves high-precision and low-cost cargo quantity statistics, which is suitable for edge server deployment.
Patent Information
- Application Number
- CN202510619191.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-19
AI Technical Summary
The existing technology has problems in inventory management that rely on manual operations, high costs and low accuracy. Especially in three-dimensional warehouses, existing intelligent inventory methods such as RFID and UAV/AGV combined identification codes still rely on electronic tags, and the limited computing resources of edge servers lead to difficulty in deploying high-precision identification models.
The improved YOLO11-Seg model is used to conduct a three-dimensional warehouse stacked cargo inventory. By collecting image data sets, labeling processing, building an improved YOLO11-Seg model, and using the training set for model training, combining the convex hull algorithm and area ratio method to calculate the quantity of goods, reducing the dependence on electronic tags and sensors.
It realizes high-precision cargo counting in complex warehousing environments, reduces inventory costs, is suitable for edge server deployment, with an average accuracy rate of more than 90%, with small parameters and moderate calculation amount, and is suitable for cargo inventory in three-dimensional warehouses.
Smart Images

Figure CN120510488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of cargo inventory, computer vision, and deep learning technology, and in particular to a method for inventorying stacked cargo in a stereoscopic warehouse based on improved YOLO11-Seg. Background Art
[0002] Warehousing plays a vital role in the modern logistics supply chain, and inventory management is the foundation of inbound and outbound operations and other warehousing processes. However, traditional inventory counting relies primarily on manual labor, which is not only labor-intensive but also prone to errors. In contrast, precise and automated inventory management technology can significantly improve efficiency and bring significant economic benefits. With the rapid development of artificial intelligence and 5G communication technologies, the automation of inventory management has become an inevitable trend.
[0003] Currently, there are two main approaches to smart inventory management. The first, based on RFID (radio frequency identification), allows for rapid batch scanning and offers excellent durability. However, the high cost of implementing and replacing RFID tags is a major barrier to widespread adoption, especially as warehouse throughput increases and capacity is limited. The second approach utilizes UAVs (unmanned aerial vehicles) / AGVs (automated guided vehicles) combined with identification codes. While the UAV approach is less expensive than RFID, it still relies heavily on electronic tags, making it difficult to meet the demands of innovation and improvement.
[0004] In addition to these two methods, some factories use sensor-based measurements, such as visual perception and weight comparison, to compare the state of stacked goods before and after storage. If a certain threshold is exceeded, the stacked goods are handed over to workers for manual adjustment. However, this method is extremely sensitive to data noise and still relies heavily on human resources.
[0005] With the advancement of computer vision and deep learning, the introduction of artificial intelligence into the field of smart inventory is a natural progression. From a computer vision perspective, inventory tasks involve counting items using computer algorithms based on digital images of stacked items. Currently, warehouse management typically relies on end-to-end transmission. Transmitting large quantities of high-definition images end-to-end can cause network congestion, hindering the transmission of critical instructions within the logistics system. High-definition images captured by terminals are transmitted to edge servers deployed on-site for processing. Edge servers with computing power recognize the images and output information such as item batch and quantity. Finally, the edge servers transmit the recognition results to the warehouse inventory management system, which performs inventory counts and updates by comparing them against a database. However, the limited computing resources of edge servers can lead to a conflict between the large number of parameters required for high-precision recognition models and the lightweight nature of edge model deployment. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the present invention provides an inventory method for stacked goods in a stereoscopic warehouse based on improved YOLO11-Seg.
[0007] The technical solution of the present invention is: a method for counting stacked goods in a stereoscopic warehouse based on an improved YOLO11-Seg, comprising the following steps:
[0008] S1) Collect cargo image datasets, label them, and divide them into training and test sets;
[0009] S2), build an improved YOLO11-Seg model and train it using the training set;
[0010] S3) Use the trained improved YOLO11-Seg model to segment and identify the cargo image to obtain the segmentation mask and mask category information of the cargo image;
[0011] S4) Preliminarily determine whether it is legal based on the segmentation mask and mask category information. If illegal, report the data, otherwise enter S5);
[0012] S5) Calculate the mask convex hull, and determine whether the top layer of the cargo is fully loaded based on the geometric relationship of the convex hull points. If it is fully loaded, directly calculate the quantity of cargo; otherwise, proceed to step S6);
[0013] S6) Calculate the number of boxes on the second top layer according to the estimation algorithm, and then calculate the total number of cargo boxes.
[0014] Preferably, in step S1), the labeling process is to label each box on the top layer in each cargo image as up_box and as category 1; each layer other than the top layer is labeled as down_box and as category 0.
[0015] Preferably, in step S2), an improved YOLO11-Seg model is constructed, specifically comprising the following steps:
[0016] S21) Introducing a channel-split attention module CSSA into the backbone network of YOLO11-Seg. The channel-split attention module CSSA inherits the original C2PSA module and introduces a selective activation suppression attention mechanism;
[0017] S22) In the Neck network part of YOLO11-Seg, the rearranged group convolution module SSConv is used to replace the original convolution downsampling module. The rearranged group convolution module SSConv combines the branch fusion design with the lightweight convolution strategy;
[0018] S23) In the Neck network part of YOLO11-Seg, when C3k=False, the C3-K2 four-way convolution module C3-K2_QDConv is introduced to replace C3k2.
[0019] Preferably, in step S21), the C2PSA module realizes feature attention enhancement and feedforward processing by stacking multiple PSABlocks, and builds information interaction based on position-sensitive Attention; the channel-split attention module CSSA is embedded in PSABlock to construct a new PSABlock_SASA module.
[0020] Preferably, in step S3), the mask category information is up_box and down_box; and the value of the mask matrix is 1 or 0, 0 indicates that the pixel point has no mask, and 1 indicates that the pixel point has a mask.
[0021] Preferably, in step S5), if there is only a mask with the mask type of up_box, it is determined that the top layer is fully loaded;
[0022] In other cases, the determination of whether the top floor is fully loaded includes the following steps:
[0023] S51), performing contour extraction based on the mask and mask type of the goods, and fitting the convex hull boundary corner point set HM corresponding to all masks through the convex hull algorithm of OpenCV;
[0024] S52), using the model predicted labels 1 and 0 to divide all masks into the “upper layer” and “lower layer” goods sets;
[0025] S53), select the instance with the smallest y coordinate from the lower cargo set as the target lower cargo, and select the instance with the largest y coordinate from the upper cargo set as the target upper cargo;
[0026] S54) If the y coordinate of the highest point of the lower target cargo is lower than the y coordinate of the center point of the convex hull of the upper target cargo, it means that the upper layer does not completely cover the top of the lower layer, and it is determined to be partially loaded; otherwise, it is fully loaded.
[0027] Preferably, in step S5), if the top floor of the cargo is fully loaded, the cargo quantity is calculated as follows:
[0028] N total =N up_box ×(N down_box +1);
[0029] Where N total is the total quantity of goods; N up_box The number of masks with category 1; N down_boxis the number of masks with class 0.
[0030] Preferably, in step S6), the number of boxes in the second top layer is calculated according to the area estimation algorithm, which specifically includes the following steps:
[0031] S61), according to the type of mask, the convex hull boundary corner point set HM of all masks is divided into UH and DH, where UH is the convex hull set of mask up_box and DH is the convex hull set of mask down_box;
[0032] S62), for a single top box, estimate its upper surface area S1;
[0033] S63), estimating the upper surface area S2 of any entire layer of cargo boxes in the non-top layer;
[0034] S64) Based on the ratio of the upper surface area S2 of the entire layer of boxes to the upper surface area S1 of the single top box, and then rounded down, the estimated value N of the number of cargo boxes in the entire layer is obtained. layer ;
[0035] S65) Calculate the total quantity of goods N total ,Right now:
[0036] N total =N down_box *N layer +N up_box
[0037] Where N down_box 、N up_box are the number of masks for category 0 and category 1 respectively.
[0038] The beneficial effects of the present invention are:
[0039] 1. This paper uses the improved YOLO11-Seg model to recognize stacked goods, generate goods segmentation masks and mask types, and calculate the total number of goods by identifying and distinguishing goods boxes on different layers;
[0040] 2. The present invention calculates the quantity of goods based on the area ratio method for different stacking situations. It is not only applicable to the situation where the goods on the top floor are scattered, but also can directly perform accurate quantity counting when the goods on the top floor are fully stacked.
[0041] 3. The mask-based area ratio estimation method of the present invention has high cargo counting accuracy in complex storage environments, does not rely on electronic tags or sensor data, reduces inventory counting costs, and is particularly suitable for cargo inventory counting in high-bay warehouses.
[0042] 4. By adopting the improved YOLO11-Seg model, the present invention improves the average mAP to 84.5% and the average inventory accuracy exceeds 90%. The parameter volume is only 9.4M and the computational workload is 34.9GFLOPs. It is suitable for deployment on edge servers and has the advantages of strong generalization, low deployment cost and high inventory efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Schematic diagram of the process of the present invention;
[0044] Figure 2 This is a structural framework diagram of the improved YOLO11-Seg model of the present invention;
[0045] Figure 3 This is a structural framework diagram of the channel-split attention module CSSA of the present invention;
[0046] Figure 4 This is a structural framework diagram of the rearranged group convolution module SSConv of the present invention;
[0047] Figure 5 This is a structural framework diagram of the C3-K2 four-way convolution module of the present invention;
[0048] Figure 6 Schematic diagram of the present invention estimating the upper surface area of a single top-level box; (a) is a schematic diagram of the mask combination of a real image in an actual scene, and (b) is a schematic diagram of the selected upbox mask;
[0049] Figure 7 Schematic diagram of the present invention estimating the upper surface area of a whole layer of goods, where (a) is a schematic diagram of the mask combination of a real image in an actual scene, and (b) is a schematic diagram of the selected downbox mask. DETAILED DESCRIPTION
[0050] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings:
[0051] like Figure 1 As shown, this embodiment provides a method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg, including the following steps:
[0052] S1) Collect cargo image datasets, label them, and divide them into training and test sets;
[0053] The labeling process is to label each box on the top layer of each cargo image as up_box and as category 1; each layer other than the top layer is labeled as down_box and as category 0.
[0054] S2), build an improved YOLO11-Seg model and train it using the training set;
[0055] like Figure 2 As shown, in this embodiment, the improved YOLO11-Seg model is constructed, which specifically includes the following steps:
[0056] S21) Introducing a channel-split attention module CSSA into the backbone network of YOLO11-Seg. The channel-split attention module CSSA inherits the original C2PSA module and introduces a selective activation suppression attention mechanism;
[0057] S22) In the Neck network part of YOLO11-Seg, the rearranged group convolution module SSConv is used to replace the original convolution downsampling module. The rearranged group convolution module SSConv combines the branch fusion design with the lightweight convolution strategy;
[0058] S23) In the Neck network part of YOLO11-Seg, when C3k=False, the C3-K2 four-way convolution module C3-K2_QDConv is introduced to replace C3k2.
[0059] As a preferred embodiment of this invention, in step S21), if Figure 3 As shown in the figure, the C2PSA module realizes feature attention enhancement and feedforward processing by stacking multiple PSABlocks, and builds information interaction based on position-sensitive Attention; the channel-split attention module CSSA is embedded in PSABlock to construct a new PSABlock_SASA module.
[0060] The channel split attention module CSSA first compresses the number of input feature map channels to half of the original through a 1×1 convolution and divides it into two sub-channel branches; the first channel is retained as residual information to maintain the original features, and the second channel inputs multiple stacked PSABlock_SASA modules for feature transformation and attention enhancement; finally, the original channel dimension is restored through channel splicing and 1×1 convolution to achieve the fusion and complementarity of the two types of feature information. Suppose the input tensor is N = H W In each PSABlock_SASA module, the original Attention is replaced by a PSABlock_SASA module, which uses linear layers instead of convolutions and simplifies the construction of q, k, v:
[0061]
[0062] Where q, k, and v represent the tensors of query, key, and value, respectively, used for attention calculation; reshape represents the dimension rearrangement of the linear projection result according to the multi-head attention structure; W qkv Represents the shared linear projection weight matrix for generating q, k, and v; x′ represents the representation of the input feature x after normalization and preprocessing; B represents the batch size; h represents the number of attention heads (multi-head number); d represents the channel dimension of each attention head (i.e., d = C / h); C represents the number of input channels; H and W represent the height and width of the input feature map, respectively.
[0063] L2 normalization is introduced to unit vectorize the query matrix Q and the key matrix K:
[0064]
[0065] Where q′ represents the query vector after L2 normalization; k′ represents the key vector after L2 normalization; ‖q‖2 and ‖k‖2 represent the L2 norms of the query vector and key vector in the last dimension, respectively, which are used to normalize the vector to unit length, thereby enhancing the stability and robustness of the similarity calculation.
[0066] A learnable temperature scaling factor Temp is introduced for each attention head to adaptively adjust the sharpness of the attention distribution of different heads and calculate the similarity sim:
[0067] sim=Temp·q′k′ T ;
[0068] Where: T represents the transpose operation, which swaps the last two dimensions of the key vector for dot product similarity calculation with the query vector; Temp is used to control the “sharpness” or “smoothness” of the attention distribution;
[0069] Use the Dropout suppression mechanism to suppress invalid activations, namely:
[0070] α=Dropout(softmax(sim));
[0071] In the formula, α represents the normalized and Dropout-suppressed attention weight matrix; softmax is the activation function;
[0072] Weighted sum output:
[0073] y = proj(α·v);
[0074] Where y represents the feature representation of the current attention head output; proj represents the linear projection function used for output transformation (usually a fully connected layer); v represents the value vector (Value), which participates in the weighted summation to generate the output representation.
[0075] In this embodiment, in step S22), if Figure 4 As shown, the reordered group convolution module SSConv integrates pixel reordering, branch convolution, group convolution, and point-by-point convolution; assuming the input feature map is X, the reordered group convolution module SSConv first uses the PixelShuffle operation to convert part of the spatial dimension into a channel dimension of X';
[0076] Then the feature map is divided into two sub-branches X1 and X2 according to the channel direction; the first sub-branch X1 adopts a parallel structure of group convolution and point-by-point convolution; the second sub-branch X2 adopts a 3×3 convolution operation with a stride of 2;
[0077] Finally, the feature maps Y1 and Y2 of the two sub-branches X1 and X2 are spliced along the channel dimension, and BatchNormalization and SiLU activation function processing are performed in sequence, that is:
[0078] X1,X2=Split(PixelShuffle(X),dim=1);
[0079] Y1=GC(X1)+PWC(X1);
[0080] Y2=conv2d 3×3 (X2);
[0081] Y=SiLU(BN(Concat(Y1,Y2)));
[0082] In the formula, Split represents the channel splitting operation on the feature map according to the specified dimension; dim represents the dimension of splitting, which is the channel dimension (the first dimension) here; Y1 represents the feature output after the first sub-branch processing, including the sum of the group convolution and point-by-point convolution results; Y2 represents the feature output after the second sub-branch convolution processing; Y represents the final fused output feature map, which is the output of the SSConv module; GC represents group convolution; PWC represents point-by-point convolution; conv2d 3×3 Represents a 3×3 convolution operation with a stride of 2; Concat is a concatenation operation.
[0083] In this embodiment, in step S23), if Figure 5 As shown, the C3-K2 four-way convolution module first performs ZeroPadding in four asymmetric directions on the input feature map to obtain
[0084] Secondly, the standard convolution is decomposed into a combination of horizontal and vertical directions; Input to the horizontal direction, Input to vertical direction;
[0085] Again, spatial displacement is performed on the outputs of different directions to produce an explicit position offset of the directional information. Finally, the four directional features are concatenated and the fused convolution output result with a convolution kernel of 2×2 is used to integrate the information of multiple directions. That is:
[0086]
[0087] Where, Conv (2,2) Represents a fused convolution operation with a convolution kernel of 2×2; Concat represents a splicing operation; F represents the final output feature map of the C3-K2 module, which contains multi-directional convolution fusion information; They represent the displacement operation of the feature map to the right and left by one pixel in the horizontal direction (H); They represent the displacement operation of the feature map in the vertical direction (W) by one pixel downward and upward respectively; Conv 1×k 、Conv k×1 They represent convolution operations with a kernel size of 1×k, which are used for feature extraction in the horizontal and vertical directions respectively.
[0088] S3) Use the trained improved YOLO11-Seg model to segment and identify the cargo image to obtain the segmentation mask and mask category information of the cargo image;
[0089] The mask category information is up_box and down_box; and the value of the mask matrix is 1 or 0, 0 indicates that the pixel point has no mask, and 1 indicates that the pixel point has a mask.
[0090] S4) Preliminarily determine whether it is legal based on the segmentation mask and mask category information. If illegal, report the data, otherwise enter S5);
[0091] When the number of masks with the mask category of down_box is 0, it is considered an illegal situation.
[0092] The algorithm also checks whether the length of the predicted mask label list matches the length of the true label list. If the number of labels is inconsistent, it indicates that the model has missed or misdetected an image, and the image detection result is invalid. The image number is recorded and subsequent evaluation is skipped. If the number of labels is consistent, the algorithm further compares the number of up_boxes and down_boxes predicted by the model to ensure they are equal to the number of up_boxes and down_boxes in the true labels, respectively. If the number of objects in any category deviates, the image detection result is also invalidated.
[0093] S5) Calculate the mask convex hull, and determine whether the top layer of the cargo is fully loaded based on the geometric relationship of the convex hull points. If it is fully loaded, directly calculate the quantity of cargo; otherwise, proceed to step S6);
[0094] If only masks with the mask type of up_box exist, the top layer is considered fully loaded;
[0095] In other cases, the determination of whether the top floor is fully loaded includes the following steps:
[0096] S51), performing contour extraction based on the mask and mask type of the goods, and fitting the convex hull boundary corner point set HM corresponding to all masks through the convex hull algorithm of OpenCV;
[0097] S52), using the model predicted labels 1 and 0 to divide all masks into the “upper layer” and “lower layer” goods sets;
[0098] S53), select the instance with the smallest y coordinate from the lower cargo set as the target lower cargo, and select the instance with the largest y coordinate from the upper cargo set as the target upper cargo;
[0099] S54) If the y coordinate of the highest point of the lower target cargo is lower than the y coordinate of the center point of the convex hull of the upper target cargo, it means that the upper layer does not completely cover the top of the lower layer, and it is determined to be partially loaded; otherwise, it is fully loaded.
[0100] If the top floor of the cargo is fully loaded, the cargo quantity is calculated as follows:
[0101] N total =N up_box ×(N down_box +1);
[0102] Where N total is the total quantity of goods; N up_box The number of masks with category 1; N down_box is the number of masks with class 0.
[0103] S6) Calculate the number of boxes on the second top layer according to the estimation algorithm, and then calculate the total number of cargo boxes; specifically, the steps include:
[0104] S61), according to the type of mask, the convex hull boundary corner point set HM of all masks is divided into UH and DH, where UH is the convex hull set of mask up_box and DH is the convex hull set of mask down_box;
[0105] S62) For a single top-level box, estimate its upper surface area S1; specifically, the steps include:
[0106] S621) Find the convex hull y with the maximum y value in the convex hull set UH m_HU , and the convex hull y m_HU Sort all points in ascending order by the x-axis value. If the x-values are the same, sort them by the y-axis value and give priority to the point with the smaller y-value. Mark the first-ranked point as point A.
[0107] S622) Calculate the convex hull y using the Euclidean distance m_HU The point closest to the lower left corner of the product image is marked as B; the points closest to the lower right corner and upper right corner of the product image are marked as C and E respectively; at the same time, in the convex hull y m_HU Find the point with the smallest y value and the smallest x value and mark it as D;
[0108] S623), calculate the convex hull y m_HU The center point of y; and filter out the convex hull y m_HU The points whose y value is greater than the y value of the center point are filtered out and put into the set below_center;
[0109] S624), sort the points in the set below_center in descending order according to the x-axis value. If the x-values are the same, sort them according to the y-axis value, and then mark the first-ranked point as point F;
[0110] S625), calculating multiple intersection points based on the slope relationship between the points, and taking the average position of the multiple intersection points as the final intersection point O;
[0111] First, determine a first straight line, which passes through points D and E. The slope of the first straight line is determined by the line connecting points A and C.
[0112] Next, determine a second straight line, which passes through points F and E, and whose slope is determined by the line connecting points A and E.
[0113] Furthermore, a third straight line is determined, the third straight line passing through points E and F, and the slope of the third straight line is determined by the line formed by points C and F;
[0114] The intersection points of the three straight lines are O1, O2 and O3 respectively; the average position of O1, O2 and O3 is taken as the final intersection point O.
[0115] S626) Estimate the upper surface area S1 of a single top box by calculating the product of the lengths of line segments OA and OE. Figure 6 (a) in the figure is the mask combination of the real picture in the actual scene. Figure 6(b) shows the selected upbox mask; L1, L2, and L3 are lines calculated from the convex hull points. Line L1 is constructed through points D, E, and A by calculating the slope of segment DE while passing through point A. This determines line L1. Lines L2 and L3 are constructed similarly.
[0116] S63), estimate the upper surface area S2 of any whole layer of cargo boxes in the non-top layer; Figure 7 As shown, Figure 7 (a) in the figure is the mask combination of the real picture in the actual scene. Figure 7 (b) in the figure is the selected downbox mask;
[0117] The specific steps include:
[0118] S631), calculate the convex hull y with the maximum y value and the minimum y value in the convex hull set DH m_hull 、y n_hull ;
[0119] S632), calculate the points A', B', C', E' in the convex hull set DH according to the method of steps S621)-S622); and when the convex hull y m_hull 、y n_hull When the convex hulls are different, calculate the convex hull y n_hull The point closest to the lower right corner of the image is recorded as point D′;
[0120] S633) Determine the intersection of the key straight lines based on the slope relationship between the points, and calculate the total intersection point O; then estimate the upper surface area S2 of the entire layer of boxes by calculating the product of the lengths of line segments OA and OE.
[0121] S64) Based on the ratio of the upper surface area S2 of the entire layer of boxes to the upper surface area S1 of the single top box, and then rounded down, the estimated value N of the number of cargo boxes in the entire layer is obtained. layer ;
[0122] S65) Calculate the total quantity of goods N total ,Right now:
[0123] N total =N down_box *N layer +N up_box
[0124] Where N down_box 、N up_box are the number of masks for category 0 and category 1 respectively.
[0125] The evaluation metrics for this embodiment include the inventory counting accuracy (Acc), which measures the proportion of images with the correct number of boxes detected, mean average precision (mAP), the number of model parameters (Params) in millions (M), and the computational complexity of the model (Giga Floating-point Operations per Second (GFLOPs). Table 1 shows the average results of 5-fold cross-validation, demonstrating the feasibility of the improved YOLO11-Seg-based inventory counting method for stacked warehouses proposed in this embodiment.
[0126]
[0127] The above embodiments and descriptions are only for explaining the principles and best embodiments of the present invention. Without departing from the spirit and scope of the present invention, the present invention may be subject to various changes and improvements, which shall fall within the scope of the invention to be protected.
Claims
1. A method for counting stacked goods in a stereoscopic warehouse based on improved YOLO11-Seg, characterized by: The steps include: S1) Collect cargo image datasets, label them, and divide them into training and test sets; S2) Build an improved YOLO11-Seg model and train it using the training set; S3) Use the trained improved YOLO11-Seg model to segment and identify the cargo image to obtain the segmentation mask and mask category information of the cargo image; S4) Preliminarily determine whether it is legal based on the segmentation mask and mask category information. If illegal, report the data, otherwise enter S5); S5) Calculate the mask convex hull, and determine whether the top layer of the cargo is fully loaded based on the geometric relationship of the convex hull points. If it is fully loaded, directly calculate the quantity of cargo; otherwise, proceed to step S6); S6) Calculate the number of boxes on the second top layer according to the estimation algorithm, and then calculate the total number of cargo boxes.
2. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 1 is characterized in that: In step S2), an improved YOLO11-Seg model is constructed, which specifically includes the following steps: S21) Introducing a channel-split attention module CSSA into the backbone network of YOLO11-Seg. The channel-split attention module CSSA inherits the original C2PSA module and introduces a selective activation suppression attention mechanism; S22) In the Neck network part of YOLO11-Seg, the rearranged group convolution module SSConv is used to replace the original convolution downsampling module. The rearranged group convolution module SSConv combines the branch fusion design with the lightweight convolution strategy; S23) In the Neck network part of YOLO11-Seg, when C3k=False, the C3-K2 four-way convolution module C3-K2_QDConv is introduced to replace C3k2.
3. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 2 is characterized in that: In step S21), the C2PSA module realizes feature attention enhancement and feedforward processing by stacking multiple PSABlocks, and builds information interaction based on position-sensitive Attention; the channel-split attention module CSSA is embedded in PSABlock to construct a new PSABlock_SASA module.
4. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 3 is characterized by: The described channel-split attention module CSSA first compresses the number of input feature map channels to half of the original through a 1×1 convolution and divides it into two sub-channel branches; the first channel is retained as residual information to maintain the original features, and the second channel inputs multiple stacked PSABlock_SASA modules for feature transformation and attention enhancement; finally, the original channel dimension is restored through channel splicing and 1×1 convolution, realizing the fusion and complementarity of the two types of feature information.
5. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 4 is characterized in that: Let the input tensor be N = H W In each PSABlock_SASA module, the original Attention is replaced by a PSABlock_SASA module, which uses linear layers instead of convolutions and simplifies the construction of q, k, v: Where q, k, and v represent the tensors of query, key, and value, respectively, used for attention calculation; reshape represents the dimension rearrangement of the linear projection result according to the multi-head attention structure; W qkv Represents the shared linear projection weight matrix for generating q, k, and v; x′ represents the normalized and preprocessed representation of the input feature x; B represents the batch size; h represents the number of attention heads; d represents the channel dimension of each attention head; C represents the number of input channels; H and W represent the height and width of the input feature map, respectively.
6. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 5, characterized in that: L2 normalization is introduced to unit vectorize the query matrix Q and the key matrix K: Where q′ represents the query vector after L2 normalization; k′ represents the key vector after L2 normalization; ‖q‖2 and ‖k‖2 represent the L2 norms of the query vector and key vector in the last dimension, respectively, which are used to normalize the vector to unit length, thereby enhancing the stability and robustness of the similarity calculation; A learnable temperature scaling factor Temp is introduced for each attention head to adaptively adjust the sharpness of the attention distribution of different heads and calculate the similarity sim: sim=Temp·q′k′T; Where: T represents the transpose operation, which swaps the last two dimensions of the key vector for dot product similarity calculation with the query vector; Temp is the learnable temperature scaling factor introduced by each attention head to control the "sharpness" or "smoothness" of the attention distribution; Use the Dropout suppression mechanism to suppress invalid activations, namely: α=Dropout(softmax(sim)); Where α represents the normalized and Dropout-suppressed attention weight matrix; softmax is the activation function; Weighted sum output: y = proj(α·v); Where y represents the feature representation of the current attention head output; proj represents the linear projection function used for output transformation; v represents the value vector that participates in the weighted summation to generate the output representation.
7. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 2, characterized in that: In step S22), the reordered grouped convolution module SSConv integrates pixel reordering, branched convolution, group convolution, and point-by-point convolution; assuming the input feature map is X, the reordered grouped convolution module SSConv first uses the PixelShuffle operation to convert part of the spatial dimension into a channel dimension of X'; Then the feature map is divided into two sub-branches X1 and X2 according to the channel direction; the first sub-branch X1 adopts a parallel structure of group convolution and point-by-point convolution; the second sub-branch x2 adopts a 3×3 convolution operation with a stride of 2; Finally, the feature maps y1 and y2 of the two sub-branches x1 and x2 are spliced along the channel dimension, and are processed by BatchNormalization and SiLU activation function in sequence, that is: X1,X2=Split(PixelShuffle(X),dim=1); y1=GC(X1)+PWC(X1); <h2 style=";text-align:left;direction:ltr">Y2=conv2d<h2 style=";text-align:left;direction:ltr"> 3×3 <h2 style=";text-align:left;direction:ltr"> (X2); Y=SiLU(BN(Concat(y1,y2))); Where Split represents the channel splitting operation on the feature map according to the specified dimension; dim represents the dimension of splitting; Y1 represents the feature output after the first sub-branch processing, including the sum of the group convolution and point-by-point convolution results; Y2 represents the feature output after the second sub-branch convolution processing; Y represents the final fused output feature map, which is the output of the SSConv module; GC represents group convolution; PWC represents point-by-point convolution; conv2d 3×3 Represents a 3×3 convolution operation with a stride of 2; Concat is a concatenation operation.
8. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 2, characterized in that: In step S23), the C3-K2 four-way convolution module first performs zero padding in four asymmetric directions on the input feature map to obtain Secondly, the standard convolution is decomposed into a combination of horizontal and vertical directions; Input to the horizontal direction, Input to vertical direction; Again, spatial displacement is performed on the outputs of different directions to produce an explicit position offset of the directional information. Finally, the four directional features are concatenated and the fused convolution output result with a convolution kernel of 2×2 is used to integrate the information of multiple directions. That is: Where, Conv (2,2) Represents a fused convolution operation with a convolution kernel of 2×2; Concat represents a splicing operation; F represents the final output feature map of the C3-K2 module, which contains multi-directional convolution fusion information; Respectively represent the horizontal displacement operation of the feature map to the right and left by one pixel; Respectively represent the vertical displacement operation of the feature map downward and upward by one pixel; Conv 1×k 、Conv k×1 They represent convolution operations with a kernel size of 1×k, which are used for feature extraction in the horizontal and vertical directions respectively.
9. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 1, characterized in that: In step S5), if there is only a mask with the mask type of up_box, it is determined that the top layer is fully loaded; In other cases, the determination of whether the top floor is fully loaded includes the following steps: S51), performing contour extraction based on the mask and mask type of the goods, and fitting the convex hull boundary corner point set HM corresponding to all masks through the convex hull algorithm of OpenCV; S52) Use the model predicted labels 1 and 0 to divide all masks into the "upper layer" and "lower layer" goods sets; S53), select the instance with the smallest y coordinate from the lower cargo set as the target lower cargo, and select the instance with the largest y coordinate from the upper cargo set as the target upper cargo; S54), if the y coordinate of the highest point of the lower target cargo is lower than the y coordinate of the center point of the convex hull of the upper target cargo, it means that the upper layer does not completely cover the top of the lower layer, and it is determined to be partially loaded; otherwise, it is fully loaded; If the top floor of the cargo is fully loaded, the cargo quantity is calculated as follows: N total =N up_box ×(N down_box +1); Where N total is the total quantity of goods; N up_box The number of masks with category 1; N down_box is the number of masks with class 0.
10. The method for counting stacked goods in a three-dimensional warehouse based on improved YOLO11-Seg according to claim 9, characterized in that: In step S6), the number of boxes in the second top layer is calculated according to the area estimation algorithm, which specifically includes the following steps: S61), according to the type of mask, divide the convex hull boundary corner point set HM of all masks into UH and DH, where UH is the convex hull set of mask up_box and DH is the convex hull set of mask down_box; S62), for a single top box, estimate its upper surface area S1; S63), estimating the upper surface area S2 of any entire layer of cargo boxes other than the top layer; S64) Based on the ratio of the upper surface area S2 of the entire layer of boxes to the upper surface area S1 of the single top box, and then rounded down, the estimated value N of the number of cargo boxes in the entire layer is obtained. layer ; S65) Calculate the total quantity of goods N total ,Right now: N total =N down_box *N layer +N up_box Where N down_box 、N up_box The number of masks for category 0 and category 1 respectively.
Citation Information
Cited By
Intelligent warehouse material identification method and system based on deep learning
CN121415220A
Lightweight lithium mineral microscopic image real-time detection and instance segmentation method
CN121437530A