YOLO-based sorting video identification processing method and system
By constructing occlusion mask data and conducting adversarial training with the YOLO-Inpaint algorithm, the problem of low recognition accuracy in occluded scenarios of sorting video recognition technology was solved, achieving efficient recognition and robustness under occlusion conditions, and improving the intelligence level and operational reliability of the sorting system.
Patent Information
- Application Number
- CN202511315368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-11-07
AI Technical Summary
Existing sorting video recognition and processing technologies have low recognition accuracy in occluded scenes, especially when the occlusion exceeds 50%, the recognition failure rate increases significantly. They lack feature repair and compensation mechanisms for occluded areas and cannot recover the complete feature representation of items from incomplete visual information.
Occlusion mask data is constructed by edge detection and connected component analysis. The YOLO-Inpaint algorithm is used to embed the image restoration loss calculation. Adversarial training is used to learn to infer item features from incomplete features. The weighted fusion of item integrity score and detection confidence is combined to generate the sorted item recognition result after occlusion compensation.
It significantly improves recognition accuracy and robustness under occlusion conditions, ensuring optimal recognition results under various occlusion conditions, supporting stable recognition performance of sorting systems in complex environments, and providing full-process tracking and quality monitoring data support for the sorting process.
Smart Images

Figure CN120913131A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a sorting video recognition processing method and system based on YOLO. BACKGROUND
[0002] The existing sorting video recognition processing technology is mainly based on traditional target detection algorithms such as YOLO, SSD, Faster R-CNN, etc. deep learning methods. These algorithms learn the visual features of the items by training a large number of labeled data, and can achieve high recognition accuracy under ideal conditions. The traditional YOLO algorithm uses a single-stage detection architecture to convert the target detection task into a regression problem, and simultaneously predicts the position coordinates and class probability of the item through a convolutional neural network, which has the advantages of fast detection speed and good real-time performance, and is widely used in the field of industrial sorting.
[0003] However, the existing technology has significant shortcomings in handling occlusion scenes in sorting videos. When the sorting items are partially or completely occluded by the operator's hands, mechanical equipment, other items, etc., the traditional YOLO algorithm can only recognize based on the incomplete features of the visible part, resulting in a sharp decline in recognition accuracy, especially when the occlusion degree exceeds 50%, the recognition failure rate increases significantly. The existing algorithm lacks a feature repair and compensation mechanism for the occluded area, and cannot recover the complete feature representation of the item from the incomplete visual information, and also lacks an adaptive processing strategy for different occlusion degrees. SUMMARY
[0004] The present application provides a sorting video recognition processing method and system based on YOLO, which solves the accuracy and robustness problems of item occlusion recognition in sorting videos, and improves the recognition success rate and processing efficiency under occlusion conditions.
[0005] In a first aspect, the present application provides a sorting video recognition processing method based on YOLO, which comprises:
[0006] Step S1, divide each frame of image in the sorting operation video into a visible area and an occlusion area, mark the occlusion boundary through edge detection and connected component analysis, and construct occlusion mask data;
[0007] Step S2, processing the occlusion mask data using YOLO-Inpaint algorithm, YOLO-Inpaint algorithm embeds image repair loss calculation in YOLO detection network, learns the mapping relationship from incomplete features to item features through adversarial training method, and obtains the repair feature map;
[0008] Step S3, calculating the item completeness score based on the repaired feature map output by the YOLO-Inpaint algorithm, the score being calculated by the ratio of the visible pixel area to the predicted total area and the similarity between the repaired area and the real area;
[0009] Step S4, weighting and fusing the item completeness score and the detection confidence, the weight ratio being adaptively adjusted according to the occlusion degree, to generate an occlusion-compensated sorting item recognition result;
[0010] Step S5, constructing a time-sequenced labeled sorting video recognition data stream based on the sorting item recognition result, containing the item category, position coordinates, occlusion state and recognition confidence of each frame, and outputting a sorting video recognition processing report.
[0011] In a second aspect, the present application provides a YOLO-based sorting video recognition processing system, which comprises:
[0012] A segmentation module, configured to segment each frame of image in a sorting job video into a visible area and an occlusion area, mark the occlusion boundary through edge detection and connected domain analysis, and construct occlusion mask data;
[0013] An embedding module, configured to process the occlusion mask data by using a YOLO-Inpaint algorithm, the YOLO-Inpaint algorithm embedding image repair loss calculation in a YOLO detection network, learning the mapping relationship from the incomplete feature to the item feature by an adversarial training method, and obtaining a repaired feature map;
[0014] A calculation module, configured to calculate an item completeness score based on the repaired feature map output by the YOLO-Inpaint algorithm, the score being calculated by the ratio of the visible pixel area to the predicted total area and the similarity between the repaired area and the real area;
[0015] A fusion module, configured to weight and fuse the item completeness score and the detection confidence, the weight ratio being adaptively adjusted according to the occlusion degree, to generate an occlusion-compensated sorting item recognition result;
[0016] An output module, configured to construct a time-sequenced labeled sorting video recognition data stream based on the sorting item recognition result, containing the item category, position coordinates, occlusion state and recognition confidence of each frame, and output a sorting video recognition processing report.
[0017] In a third aspect, a YOLO-based sorting video recognition processing device is provided, comprising a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to enable the YOLO-based sorting video recognition processing device to perform the YOLO-based sorting video recognition processing method described above.
[0018] In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium storing instructions, when executed on a computer, causing the computer to perform the YOLO-based sorting video recognition processing method described above.
[0019] In the technical scheme provided in the present application, the technical features of constructing the occlusion mask data by edge detection and connected component analysis marking the occlusion boundary solve the problem that the traditional method cannot accurately identify and locate the occlusion area. The technical features of the YOLO-Inpaint algorithm embedding image inpainting loss calculation and using the adversarial training method to learn the mapping relationship from the incomplete feature to the complete feature break through the limitation of the existing YOLO algorithm which can only identify based on the visible part, and through the adversarial mechanism of the generator network and the discriminator network, the occluded part of the item feature can be intelligently inferred from the visible features around the occlusion area, which significantly improves the recognition accuracy and robustness under the occlusion condition. The technical features of the item completeness score calculated by the ratio of the visible pixel area to the predicted total area and the similarity of the repaired area to the real area establish a scientific method for quantitatively evaluating the quality of occlusion repair, providing an objective basis for the credibility judgment of the recognition result. The technical features of the weight ratio self-adaptive adjustment and weighted fusion according to the occlusion degree realize the intelligent balance of the detection confidence and the completeness score, fully utilizing the high credibility of the original detection result under light occlusion, and relying more on the completeness score after repair under heavy occlusion, ensuring the optimal recognition effect under various occlusion conditions.
[0020] In the specific application field of sorting video recognition processing, the adversarial training mechanism and the image inpainting loss calculation feature of the YOLO-Inpaint algorithm bring revolutionary improvement to the item recognition under the occlusion condition, and the algorithm learns the mapping relationship from the incomplete feature to the complete feature, so that the sorting system can maintain stable recognition performance in the complex occlusion environment of the industrial site. The technical features of constructing the time sequence labeled sorting video recognition data stream organize the discrete frame recognition results into continuous time sequence data, which not only facilitates the whole tracking and quality monitoring of the sorting process, but also provides complete data support for the performance optimization and fault diagnosis of the sorting equipment. Especially in the practical application of the automatic sorting line, this time sequence data stream can effectively support advanced functions such as sorting efficiency analysis, anomaly detection and predictive maintenance, thereby greatly improving the intelligent level and operation reliability of the entire sorting system. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0022] Figure 1 An embodiment schematic diagram of the sorting video recognition processing method based on YOLO in the embodiments of the present application;
[0023] Figure 2 An embodiment schematic diagram of the adaptive weight distribution mechanism in the embodiments of the present application;
[0024] Figure 3 An embodiment schematic diagram of the sorting video recognition processing system based on YOLO in the embodiments of the present application;
[0025] Figure 4 An embodiment structural schematic diagram of the sorting video recognition processing device based on YOLO in the embodiments of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application provide a sorting video recognition processing method and system based on YOLO. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" or "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] For the convenience of understanding, the specific process of the embodiments of the present application will be described below. Please refer to Figure 1 An embodiment of the sorting video recognition processing method based on YOLO in the embodiments of the present application includes:
[0028] Step S1, each frame of image in the sorting work video is divided into a visible region and an occlusion region, an occlusion boundary is marked through edge detection and connected domain analysis, and an occlusion mask data is constructed;
[0029] Step S2, the occlusion mask data is processed by using a YOLO-Inpaint algorithm, the YOLO-Inpaint algorithm embeds image inpainting loss calculation in a YOLO detection network, learns a mapping relationship from incomplete features to item features through an adversarial training manner, and obtains a repaired feature map;
[0030] Step S3, an item completeness score is calculated based on the repaired feature map output by the YOLO-Inpaint algorithm, and the score is calculated by a ratio of a visible pixel area to a predicted total area and a similarity between a repaired area and an actual area;
[0031] Step S4, the item completeness score and the detection confidence are weighted and fused, a weight ratio is adaptively adjusted according to an occlusion degree, and an occlusion-compensated sorting item recognition result is generated;
[0032] Step S5, a time-series-labeled sorting video recognition data stream is constructed based on the sorting item recognition result, including an item category, a position coordinate, an occlusion state and an identification confidence of each frame, and a sorting video recognition processing report is output.
[0033] It can be understood that the execution subject of the present application can be a YOLO-based sorting video recognition processing system, and can also be a terminal or a server, and the specific implementation is not limited herein. The server is taken as an example for description in the embodiments of the present application.
[0034] Specifically, each frame of image of the sorting operation video is first subjected to a grayscale conversion process to convert an RGB three-channel color image into a single-channel grayscale image, and then subjected to a Gaussian filter preprocessing to remove noise interference. A Canny edge detection algorithm is used to calculate the gradient of the denoised grayscale image, the gradient intensity in the horizontal and vertical directions is calculated by using a Sobel operator, and then a non-maximum suppression process is performed to retain the local maximum value points of the gradient amplitude as edge candidate points. An eight-connected region detection method is used in a connected component analysis algorithm to analyze the pixel connectivity of the edge contour image, and adjacent edge pixels are classified into the same connected component and assigned a unique label. Occlusion discrimination analysis is based on the geometric features of the connected components, and the area, perimeter, aspect ratio and other shape descriptors of each connected component are calculated. When the area of a connected component is less than a set threshold and the shape irregularity exceeds a preset parameter, the region is marked as an occluded region, and the remaining regions are marked as visible regions. Finally, binary mask data containing occlusion information is generated.
[0035] The core of the YOLO-Inpaint algorithm is to integrate the image inpainting technique into the YOLO detection framework. When the occlusion mask data is fused with the original frame image at the pixel level, the occlusion mask is first binarized and encoded, with the pixel values of the occluded area set to 1 and the visible area set to 0. The RGB three-channel data of the original frame image is channel-extended with the binary occlusion mask to form a four-channel fusion data structure, where the first three channels store color information and the fourth channel records the occlusion state. The generator network uses an encoder-decoder architecture, with the encoder part extracting high-dimensional representations of the visible features around the occluded area, and the decoder part inferring the features of the items in the occluded area based on these features. The discriminator network uses a convolutional neural network structure and is responsible for distinguishing the differences between generated features and real features. The feedback signal of the adversarial loss is generated through the game between the generator and the discriminator, and the generator tries to generate realistic restoration features to deceive the discriminator, while the discriminator tries to identify the falsity of the generated features. The image restoration loss value includes two parts: reconstruction error and perceptual error. The reconstruction error is calculated by comparing the generated features with the real features pixel by pixel, and the perceptual error is obtained by measuring the semantic similarity of the deep feature layers. The comprehensive loss gradient is transmitted to the convolutional layers of the YOLO detection network through the backpropagation algorithm, updating the network weight parameters, so that the network learns to recover the complete item features from the incomplete information.
[0036] The calculation of the item completeness score involves multiple geometric and feature analyses. After the restoration feature map is processed by pixel segmentation, a threshold segmentation method is used to divide the pixels into foreground and background, with the foreground pixels representing the item area and the background pixels representing the non-item area. The visible pixel area value is obtained by counting the total number of foreground pixels, with each pixel representing a minimum unit area in the image. The circumscribed rectangle fitting calculation is based on the minimum circumscribed rectangle algorithm of the item contour boundary, which finds the smallest rectangle that can completely enclose the item contour, and the product of its length and width is the predicted total area value. The area completeness coefficient is calculated by the ratio of the visible pixel area to the predicted total area, reflecting the visibility of the item. The structural similarity index algorithm is used to calculate the feature similarity between the restoration area and the real area, which considers the similarity of brightness, contrast, and structure in three dimensions, and obtains the similarity coefficient by comparing the statistical features in the local window. The item completeness score is calculated by the weighted average of the area completeness coefficient and the similarity coefficient, and the weight distribution is determined according to the specific application scenario and data characteristics.
[0037] The weighted fusion mechanism dynamically adjusts the weight distribution according to the occlusion degree. The occlusion degree coefficient is calculated by the ratio of the total number of pixels in the occlusion area to the total number of pixels in the article area, which directly reflects the severity of the occlusion of the article. The adaptive weight distribution algorithm sets two key thresholds. When the occlusion degree coefficient is less than the low threshold, it indicates that the occlusion is slight, and the reliability of the detection confidence is high, so a larger weight is allocated to the detection confidence. When the occlusion degree coefficient is greater than the high threshold, it indicates that the occlusion is serious, and the importance of the article integrity score increases, so the weight proportion is increased accordingly. The dynamic weight distribution scheme is realized by a piecewise linear function, and a linear interpolation method is used for smooth transition between the two thresholds. The comprehensive score value is calculated by weighting and summing the article integrity score and the detection confidence according to the weight. This value comprehensively reflects the recognition reliability under the occlusion condition. The threshold judgment processing determines the optimal recognition threshold based on historical statistical data. When the comprehensive score exceeds the threshold, it is marked as valid recognition, otherwise it is marked as invalid recognition.
[0038] The structured data record organizes the recognition results of each frame into a standardized data format, including four core fields: article category identification, bounding box coordinate value, occlusion state label, and recognition confidence value. The time sequence index mapping table establishes a one-to-one correspondence between the video frame number and the recognition result. The frame number is used as the time axis index, and the recognition result data is recorded as the corresponding numerical value. The sorting video recognition data stream is combined in time sequence, and each time node contains the complete recognition information of the current frame, while recording the time correlation with adjacent frames. Statistical analysis processing calculates the performance indicators of the entire video sequence, including recognition accuracy, occlusion processing success rate, and average confidence, etc. These indicators are obtained by statistical summary of all valid recognition results.
[0039] In a specific embodiment, step S1 comprises:
[0040] The single frame image of the sorting operation video is subjected to gray scale conversion and Gaussian filter pretreatment to obtain a denoised gray scale image;
[0041] The denoised gray scale image is subjected to gradient calculation and non-maximum suppression processing based on the Canny edge detection algorithm to obtain an edge contour image;
[0042] The edge contour image is input into a connected domain analysis algorithm for pixel connectivity detection and region labeling processing to obtain a connected region label map;
[0043] According to the area size and shape features of each connected domain in the connected region label map, occlusion discrimination analysis is performed, and the regions with an area smaller than a preset threshold and irregular shape are marked as occlusion regions, and the remaining regions are marked as visible regions, to obtain occlusion mask data.
[0044] Specifically, the single-frame image gray conversion process of the sorting operation video converts the original RGB three-channel color image into a single-channel gray representation. The conversion method adopts a weighted average algorithm, multiplies the red channel by 0.299, the green channel by 0.587, and the blue channel by 0.114, and adds the three values to obtain a gray pixel value. This weight distribution is based on the physiological characteristics of the human eye in terms of sensitivity to different colors. The Gaussian filter preprocessing adopts a two-dimensional Gaussian kernel to perform convolution operation on the gray image. The size of the Gaussian kernel is usually set to 5x5 or 7x7 pixels. The standard deviation parameter controls the filtering strength. A smaller standard deviation retains more detailed information, and a larger standard deviation produces a stronger smoothing effect. In the filtering process, the new value of each pixel is calculated by weighted average of its neighborhood pixels according to the Gaussian weight. The boundary pixels are processed by mirror extension or zero padding. The noise of the filtered image is significantly reduced, and the edge information is preserved. The Canny edge detection algorithm first performs gradient calculation on the denoised gray image. The Sobel operator is used to calculate the pixel gradient in the horizontal and vertical directions. The horizontal Sobel operator is a 3x3 convolution kernel, and the vertical operator is the transpose of the horizontal operator. The gradient amplitude of each pixel position is calculated by the square root of the sum of the squares of the horizontal and vertical gradients. The gradient direction is obtained by calculating the ratio of the horizontal gradient to the vertical gradient using the arctangent function. The non-maximum suppression process checks the gradient amplitude of each pixel along the gradient direction. If the gradient amplitude of the pixel is not the local maximum in the gradient direction, it is set to zero. This process refines the wide edge region to a single-pixel-width edge line. The double-threshold processing sets two parameters, high threshold and low threshold. The pixels with gradient amplitude higher than the high threshold are directly marked as strong edges. The pixels with gradient amplitude between the two thresholds are marked as weak edges. The pixels below the low threshold are marked as non-edges. The edge connection process connects the weak edge pixels and the strong edge pixels to form complete edge contours through 8-neighbor connectivity analysis.
[0045] The connected component analysis algorithm uses a two-pass scanning method for pixel connectivity detection of the edge contour image. The first pass scans the image from the top-left corner, line by line. When a foreground pixel is encountered, the labels of its left and upper neighbors are checked. If there is no marked pixel in the neighborhood, a new label is assigned. If there is a marked pixel in the neighborhood, the label is inherited. If there are multiple pixels with different labels in the neighborhood, the smallest label is selected and the label equivalence relationship is recorded. The second pass resolves the label equivalence problem by merging equivalent labels into the same connected component. Each connected component finally obtains a unique label identifier. The region labeling process calculates the geometric properties of each connected component, including the number of pixels, the center of gravity coordinates, the bounding rectangle, and the perimeter. The number of pixels is obtained by counting the number of pixels with the same label. The center of gravity coordinates are calculated by averaging all pixel coordinates. The bounding rectangle is determined by the minimum and maximum coordinate values of the pixels in the connected component. The perimeter is calculated by the chain code representation of the boundary pixels. The occlusion discrimination analysis is based on the area size and shape features of the connected component. The area threshold is set according to the typical size of the sorted items and the image resolution. The shape irregularity is measured by multiple shape descriptors, including circularity, rectangularity, and aspect ratio. The circularity is defined as the ratio of the area to the square of the perimeter multiplied by 4π. A value close to 1 indicates a shape close to a circle, and a deviation from 1 indicates an irregular shape. The rectangularity is defined as the ratio of the area of the connected component to the area of its minimum bounding rectangle. The aspect ratio is calculated by the ratio of the long side to the short side of the bounding rectangle. When the area of the connected component is less than the pre-set threshold and any shape descriptor exceeds the normal range, the region is marked as an occluded region. The remaining regions that meet the conditions are marked as visible regions.
[0046] The generation process of the occlusion mask data converts the occlusion discrimination results into a binary image format. The pixel values of the occluded regions are set to 255 (white), and the pixel values of the visible regions are set to 0 (black). This binary representation facilitates subsequent pixel-level fusion processing and algorithm calculation. The mask data has the same spatial resolution and pixel correspondence relationship as the original image. Each mask pixel accurately identifies the occlusion state of the corresponding original image pixel. The boundary of the connected region in the mask is highly consistent with the boundary of the actual occluded object.
[0047] In a specific embodiment, step S2 includes:
[0048] The occlusion mask data is fused with the original frame image at the pixel level to generate an input feature matrix with occlusion markers.
[0049] Based on the input feature matrix, an adversarial training architecture of the generator network and the discriminator network is constructed. The generator network is responsible for inferring the features of the occluded region from the visible features around the occluded region. The discriminator network is responsible for distinguishing between real features and generated features, obtaining an adversarial loss feedback signal.
[0050] The image inpainting loss value is calculated according to the adversarial loss feedback signal, and the loss value is composed of two parts of reconstruction error and perceptual error, the reconstruction error measures the pixel difference between the generated feature and the real feature, and the perceptual error measures the semantic similarity between the generated feature and the real feature, and a comprehensive loss gradient is obtained;
[0051] The comprehensive loss gradient is back propagated to the feature extraction layer of the YOLO detection network for weight updating, and the updated network performs feature repair processing on the occluded area to obtain a repaired feature map.
[0052] Specifically, the pixel-level fusion processing of the occlusion mask data and the original frame image converts the two-dimensional occlusion mask into a four-dimensional feature representation, the occlusion mask data is binary coded, the pixels marked as an occluded area in the mask are assigned a value of 1, and the pixels in the visible area are assigned a value of 0, forming a single-channel binary mask image. The original frame image remains in RGB three-channel format, each pixel contains three color components of red, green and blue, and the numerical range is between 0 and 255. The channel expansion fusion process concatenates the RGB three-channel data and the binary mask image in the channel dimension, the original three-channel image is expanded to four-channel fusion data, and the fourth channel records the occlusion state information of each pixel position. The pixel feature vector construction process organizes the four channel values of each spatial position into a feature vector, the first three elements of the vector represent the color information of the pixel, and the fourth element represents the occlusion state. All pixel feature vectors are normalized to map the numerical range uniformly to 0 to 1, and the normalization method uses the maximum and minimum value scaling, the maximum and minimum values of each channel are calculated respectively, and then the pixel value is subtracted by the minimum value and divided by the difference between the maximum value and the minimum value. The input feature matrix with occlusion markers is organized according to the spatial structure of the image, the number of rows of the matrix is equal to the image height, and the number of columns is equal to the image width, and each matrix element contains complete information of four feature components.
[0053] The adversarial training architecture of the generator network and the discriminator network is constructed based on the principle of generative adversarial network. The generator network adopts an encoder-decoder structure. The encoder part gradually compresses the spatial resolution of the input feature matrix and increases the number of feature channels through multi-layer convolution operation. Each convolution layer is followed by batch normalization and activation function. The down-sampling process gradually compresses the input image from the original resolution to the minimum resolution of the feature map. The decoder part gradually recovers the spatial resolution while reducing the number of feature channels through transposed convolution operation. In the up-sampling process, the features of the corresponding layers of the encoder and the decoder are spliced through the jump connection to maintain the transmission of detail information. The generator network is specially designed to handle the feature inference of the occluded area. By analyzing the texture, color and geometric features of the visible pixels around the occluded area, the possible appearance of the object in the occluded area is learned, and the inference process is based on the context information and the global consistency constraint of the object. The discriminator network adopts a convolutional neural network structure, receives the real feature map and the generated feature map as input, extracts discriminative features through multi-layer convolution and pooling operations, and finally outputs a scalar value representing the authenticity probability of the input feature. The training goal of the discriminator is to maximize the ability to distinguish between real features and generated features. The adversarial loss feedback signal is calculated by the discrimination result of the generated feature by the discriminator. When the discriminator discriminates the generated feature as false, a high loss value is generated. When the discriminator is deceived by the generated feature, a low loss value is generated. This feedback signal guides the update direction of the generator network parameters.
[0054] The calculation of the image inpainting loss value includes two components: reconstruction error and perception error. The reconstruction error is calculated by comparing the numerical difference between the generated feature and the real feature pixel by pixel. L1 loss or L2 loss function is used. L1 loss calculates the absolute value of the difference between the generated pixel value and the real pixel value, and L2 loss calculates the square of the difference. The reconstruction error measures the accuracy of the generated result at the pixel level. The perception error calculates the semantic similarity between the generated feature and the real feature based on the deep feature representation. A pre-trained deep network is used to extract high-level semantic features. The cosine similarity or Euclidean distance of the feature vectors is compared to calculate the perception difference. The perception error focuses on the semantic consistency of the generated result rather than the pixel-level accurate matching. The comprehensive loss gradient is calculated by weighted combination of the reconstruction error, the perception error and the adversarial loss. The weights of each loss are adjusted according to the training stage and the specific task requirements. The gradient calculation adopts automatic differentiation technology, and the weights are updated along the negative gradient direction of the network parameters.
[0055] The back propagation process transmits the comprehensive loss gradient from the network output layer to the input layer layer by layer, and when passing through the feature extraction layer of the YOLO detection network, the gradient information guides the adjustment of the convolution kernel weight and the bias parameter, the weight update adopts the stochastic gradient descent or the Adam optimization algorithm, and the learning rate parameter controls the size of the update step. In the feature repair processing process, the updated YOLO network reprocesses the input feature matrix with the occlusion label, the network applies the learned repair knowledge in the occlusion area, infers the characteristics of the occlusion area according to the feature information of the surrounding visible area, and the repaired feature map presents reasonable appearance and texture information of the object in the occlusion area.
[0056] In a specific embodiment, the execution step of performing pixel-level fusion processing of the occlusion mask data and the original frame image can specifically include the following steps:
[0057] The occlusion mask data is binarized and encoded, the occlusion area pixel value is set to 1, and the visible area pixel value is set to 0, to obtain a binary occlusion label map;
[0058] The RGB three-channel data of the original frame image is fused with the binary occlusion label map through channel expansion, an occlusion label channel is added on the basis of the original three channels, and four-channel fused image data is obtained;
[0059] Based on the four-channel fused image data, a pixel feature vector is constructed, each pixel position contains three color components of red, green and blue and an occlusion state component, the feature vector is normalized to obtain a standardized pixel feature vector;
[0060] The standardized pixel feature vector is reorganized into a matrix form according to the spatial position, the matrix dimension is the product of the image height, the image width and the feature channel number, and an input feature matrix with an occlusion label is obtained.
[0061] Specifically, the binarization encoding process of the occlusion mask data converts the continuous value mask into a standard binary representation, and the encoding rule strictly classifies the pixel attributes. The pixel values in the occlusion region are uniformly set to the value 1, and the pixel values in the visible region are uniformly set to the value 0. This binary representation ensures that each pixel position has only two explicit state identifiers. The data format of the binary occlusion marker map is a single-channel image, and the image size is completely consistent with the original sorting video frame. The value of each pixel position directly corresponds to the occlusion state of the position, and the boundary of the connected region in the marker map accurately corresponds to the boundary of the actual occlusion object. The RGB three-channel data of the original frame image maintains the standard color space format. The red channel records the red component intensity of the pixel, the green channel records the green component intensity, and the blue channel records the blue component intensity. The value range of each channel is between 0 and 255. The channel expansion fusion operation is performed in the data structure layer, which splices the RGB three-channel data and the single-channel binary occlusion marker map in the third dimension. The splicing process maintains the spatial position correspondence of the pixels unchanged. The original three-channel data is retained as the first three channels, and the binary occlusion marker map is added as the fourth channel to the data structure. The dimension structure of the four-channel fusion image data is height x width x 4, where the first three channel dimensions save color information, and the fourth channel dimension saves occlusion state information. Each pixel position contains four independent numerical components.
[0062] The construction process of the pixel feature vector reorganizes the four-channel fusion image data into a vector representation. The four-channel numerical values of each spatial position are combined into a feature vector. The first element of the vector corresponds to the red component, the second element corresponds to the green component, the third element corresponds to the blue component, and the fourth element corresponds to the occlusion state component. The value range of the color component is between 0 and 255, and the value range of the occlusion state component is between 0 and 1. The value range difference of different components needs to be unified through normalization processing. The normalization processing adopts the maximum and minimum value scaling method. The minimum value of the color channel is 0, and the maximum value is 255. The normalization formula is that the new value is equal to the original value divided by 255. The value range of the occlusion state channel is already between 0 and 1, and no additional normalization processing is required. The value range of all elements of the standardized pixel feature vector is unified between 0 and 1, and the vector length is fixed at 4 elements. Each vector completely describes the color and occlusion attributes of a pixel position.
[0063] The matrix reorganization process arranges the normalized pixel feature vectors according to the spatial structure of the image. The reorganized matrix maintains the two-dimensional spatial layout of the original image. The number of rows of the matrix corresponds to the height of the image, and the number of columns corresponds to the width of the image. Each matrix element position stores a four-dimensional feature vector of the corresponding pixel. The complete dimension of the input feature matrix with occlusion labels is height x width x 4. The third dimension has a size of 4, indicating that each pixel position contains four feature components. Each element in the matrix is a normalized value, ranging from 0 to 1. The data access mode of the feature matrix is in row-major order. The first dimension index corresponds to the row coordinate of the image, the second dimension index corresponds to the column coordinate of the image, and the third dimension index corresponds to the type of feature component. Index values 0, 1, and 2 correspond to red, green, and blue color components, respectively, and index value 3 corresponds to the occlusion state component.
[0064] In a specific embodiment, step S3 comprises:
[0065] The repaired feature map is subjected to pixel segmentation processing. The pixels in the repaired object region are marked as foreground, and the pixels in the background region are marked as background. The number of foreground pixels is counted to obtain the visible pixel area value.
[0066] Based on the object contour boundary in the repaired feature map, an enclosing rectangle fitting calculation is performed. The product of the length and width of the enclosing rectangle is calculated to obtain the predicted total area value.
[0067] The visible pixel area value and the predicted total area value are subjected to ratio calculation to obtain the area integrity coefficient.
[0068] The repaired region in the repaired feature map and the corresponding real region are subjected to feature similarity matching calculation. The structural similarity index algorithm is used to calculate the similarity degree of the texture features to obtain the similarity coefficient. The area integrity coefficient and the similarity coefficient are subjected to weighted average processing to obtain the object integrity score.
[0069] Specifically, the pixel segmentation process of the repair feature map adopts a threshold segmentation method to divide the image pixels into two categories of foreground and background. The segmentation process first performs a grayscale conversion on the repair feature map, converting the multi-channel feature data into a single-channel grayscale value. The conversion method calculates the comprehensive feature value of each pixel by weighted averaging the feature intensity of each channel. The threshold segmentation algorithm sets a segmentation threshold, which is automatically calculated according to the histogram distribution of the repair feature map using the Otsu method. The Otsu method finds the segmentation point with the maximum inter-class variance as the optimal threshold by traversing all possible thresholds. The pixel classification process marks the pixels with feature values higher than the threshold as foreground, representing the repaired object area, and marks the pixels with feature values lower than the threshold as background, representing the non-object area. The foreground pixel statistics are calculated by traversing the segmentation result image to count the total number of pixels marked as foreground. Each foreground pixel represents a minimum area unit in the image. The total number of pixels multiplied by the actual area represented by each pixel gives the visible pixel area value. The pixel area unit is determined according to the image resolution and the actual shooting distance. The minimum bounding rectangle fitting calculation is based on the boundary points of the object contour in the repair feature map. The contour extraction uses an edge detection algorithm to find the boundary line between the object and the background. The boundary point set contains the coordinate information of all pixels on the contour. The minimum bounding rectangle algorithm traverses all boundary points to find the smallest rectangle that encloses the contour. The coordinates of the four corners of the rectangle are determined by the minimum and maximum coordinate values of the boundary points. The top-left corner coordinate is the minimum value of the x-coordinate and y-coordinate of the boundary points, and the bottom-right corner coordinate is the maximum value of the x-coordinate and y-coordinate of the boundary points. The length of the bounding rectangle is calculated by subtracting the x-coordinate of the top-left corner from the x-coordinate of the bottom-right corner, and the width is calculated by subtracting the y-coordinate of the top-left corner from the y-coordinate of the bottom-right corner. The product of the length and the width is the predicted total area value.
[0070] The area integrity coefficient is calculated by the ratio of the number of visible pixel area to the predicted total area, and the ratio calculation formula is the visible pixel area divided by the predicted total area. The result value ranges between 0 and 1, and the closer the value is to 1, the higher the visibility of the object, and the closer the value is to 0, the more serious the occlusion. The structural similarity index algorithm is used to calculate the texture feature similarity between the repair area and the real area. The algorithm considers the similarity of three dimensions of brightness, contrast and structure. The brightness similarity is calculated by comparing the average pixel value of the two areas, the contrast similarity is calculated by comparing the standard deviation of the pixel value of the two areas, and the structure similarity is calculated by comparing the normalized pixel value of the two areas after removing the brightness and contrast. The calculation process of the structural similarity index first divides the repair area and the real area into local windows of the same size, and the window size is usually set to 8x8 or 11x11 pixels. Then, three similarity components are calculated for each window, and the final similarity index is calculated by the weighted product of the three components. The similarity coefficient value ranges between -1 and 1, and the closer the value is to 1, the more similar the repair area and the real area, and the closer the value is to -1, the greater the difference.
[0071] The object integrity score is calculated by the weighted average processing of the area integrity coefficient and the similarity coefficient. In the weighted average formula, the weight of the area integrity coefficient is set to 0.6, and the weight of the similarity coefficient is set to 0.4. The weight allocation is determined based on the importance of area information in occlusion identification. The weighted average calculation process multiplies the area integrity coefficient by its weight, multiplies the similarity coefficient by its weight, and then adds the two weighted values to obtain the final object integrity score. The score value ranges between 0 and 1.
[0072] In a specific embodiment, step S4 comprises:
[0073] Based on the occlusion mask data, the occlusion degree coefficient is calculated by calculating the ratio of the total number of occluded area pixels to the total number of object area pixels to obtain the occlusion degree value.
[0074] According to the occlusion degree value, an adaptive weight allocation algorithm is designed. When the occlusion degree value is less than a preset low threshold, the detection confidence weight is set as the dominant weight. When the occlusion degree value is greater than a preset high threshold, the object integrity score weight is set as the dominant weight, and a dynamic weight allocation scheme is obtained.
[0075] The object integrity score and the detection confidence are weighted and summed according to the dynamic weight allocation scheme to calculate the fused comprehensive score value.
[0076] The threshold value judgment processing is performed on the comprehensive score value, and when the comprehensive score value is higher than the recognition threshold value, it is marked as an effective recognition result, and when the comprehensive score value is lower than the recognition threshold value, it is marked as an invalid recognition result, to obtain the sorting article recognition result after occlusion compensation.
[0077] Specifically, the calculation of the occlusion degree coefficient is based on pixel statistical analysis in the occlusion mask data. The calculation process first performs pixel classification statistics on the occlusion mask data. The total number of pixels in the occlusion region is obtained by counting the number of pixels with a value of 1 in the mask image. The total number of pixels in the article region is obtained by counting the number of pixels in the entire article contour range. The article region includes the sum of pixels in the visible region and the occlusion region. The occlusion degree value is calculated by dividing the total number of pixels in the occlusion region by the total number of pixels in the article region. This ratio directly reflects the severity of the occlusion of the article, with a value range of 0 to 1. A value close to 0 indicates slight occlusion, and a value close to 1 indicates severe occlusion. The adaptive weight distribution algorithm designs a segmented weight strategy according to the occlusion degree value. The algorithm presets two key threshold parameters, with a low threshold value of 0.3 and a high threshold value of 0.7. The threshold parameters are determined according to the actual needs and historical data statistics of the sorting scene. The weight distribution logic is realized by conditional judgment. When the occlusion degree value is less than the preset low threshold value, it indicates that the occlusion degree of the article is light, and the original detection result of the YOLO detection network has high credibility. Therefore, the detection confidence weight is set to the dominant weight 0.8, and the article completeness score weight is set to the auxiliary weight 0.2. When the occlusion degree value is greater than the preset high threshold value, it indicates that the occlusion degree of the article is heavy, and the restoration result of the YOLO-Inpaint algorithm and the completeness score have higher reference value. Therefore, the article completeness score weight is set to the dominant weight 0.8, and the detection confidence weight is set to the auxiliary weight 0.2. When the occlusion degree value is between the two threshold values, the linear interpolation method is used to calculate the weight distribution. The interpolation formula maps the occlusion degree value to the weight range, realizing the smooth transition of the weight.
[0078] The generation process of the dynamic weight distribution scheme organizes the weight calculation results into a standardized data structure. The scheme contains two values: detection confidence weight and item completeness score weight. The sum of the two weights is always equal to 1, ensuring the mathematical correctness of the weighted fusion. The weighted summation operation fuses the item completeness score and the detection confidence according to the dynamic weight distribution scheme. The operation formula is the product of the item completeness score and its corresponding weight plus the product of the detection confidence and its corresponding weight. The integrated score value after fusion considers both the quality of the occlusion repair and the original detection reliability. The integrated score value ranges from 0 to 1. The higher the value, the higher the overall reliability of the recognition result. The lower the value, the greater the uncertainty of the recognition. The threshold judgment process classifies the integrated score value based on a pre-set recognition threshold. The recognition threshold is determined according to the accuracy requirements and the tolerance of misrecognition of the sorting task, and is usually set between 0.6 and 0.8. The judgment logic uses simple numerical comparison to achieve the following: when the integrated score value is higher than the recognition threshold, the recognition result is marked as valid recognition, indicating that the recognition result reaches an acceptable confidence level; when the integrated score value is lower than the recognition threshold, the recognition result is marked as invalid recognition, indicating that the recognition result has a high uncertainty and needs further processing or manual confirmation.
[0079] The sorting item recognition result after occlusion compensation contains recognition status markers and related score information. Valid recognition results contain complete information such as item category, position coordinates, occlusion status, and final confidence. Invalid recognition results only retain basic detection information and are marked as pending confirmation status. The data format of the recognition result uses structured representation, which is convenient for subsequent data stream processing and statistical analysis. The confidence information in the result provides a data basis for sorting quality evaluation and equipment performance monitoring.
[0080] Figure 2 An adaptive weight distribution mechanism based on occlusion degree values is shown. The horizontal axis represents the occlusion degree value range from 0 to 1, and the vertical axis represents the weight distribution proportion. The light gray area in the figure represents the detection confidence weight distribution proportion, and the dark gray area represents the item completeness score weight distribution proportion. When the occlusion degree value is less than 0.3 (low threshold), the detection confidence weight dominates at 0.8; when the occlusion degree value is greater than 0.7 (high threshold), the item completeness score weight dominates at 0.8; between 0.3 and 0.7, linear interpolation is used to achieve smooth transition of the weights. This mechanism dynamically adjusts the weight proportion of the two scores according to the actual occlusion situation. In the case of light occlusion, it relies more on the original detection result, and in the case of heavy occlusion, it relies more on the repaired completeness score, thereby achieving optimal fusion of the sorting item recognition result after occlusion compensation.
[0081] In a specific embodiment, step S5 comprises:
[0082] The sorted item recognition results after occlusion compensation are processed into structured data, and the item category, bounding box position coordinates, occlusion status identifier and recognition confidence value of each frame are organized into structured data records.
[0083] A time-series index mapping table is constructed based on structured data records. The video frame number is used as the time index, and the recognition result data of each frame is used as the corresponding data value. A one-to-one correspondence between the frame number and the recognition result is established to obtain the time-series labeled dataset.
[0084] The time-series labeled datasets are concatenated and combined in chronological order to form a continuous sorting video recognition data stream. Each time node in the data stream contains complete recognition information of the current frame and its association with the previous and next frames.
[0085] The sorting video recognition data stream is statistically analyzed and formatted for output. The recognition accuracy, occlusion handling success rate and average confidence are calculated. The analysis results are integrated with the original data stream into a standard format document to obtain the sorting video recognition processing report.
[0086] Specifically, the structuring processing of the sorted item recognition results after occlusion compensation converts the original recognition output into a standardized data format. The process first defines the field specifications for the structured data records. Each record includes an item category field storing the name of the recognized item type, a bounding box position coordinate field storing the rectangular positioning information of the item in the image, an occlusion status identifier field recording the occlusion level of the item, and a recognition confidence score field storing the reliability score of the algorithm output. The data records are organized using a key-value pair structure, with each field name as the key and the corresponding recognition result as the value. All fields are combined to form a complete recognition record. The record format uses standardized data exchange formats such as JSON or XML to ensure cross-system compatibility. The bounding box position coordinates include the coordinate information of the top-left and bottom-right corners, calculated based on the image pixel coordinate system. The occlusion status identifier uses enumerated values, including classification levels such as no occlusion, slight occlusion, moderate occlusion, and severe occlusion. The recognition confidence score ranges from 0 to 1, indicating the reliability of the recognition result. The temporal index mapping table is constructed based on the association between video frame numbers and recognition result data. The mapping table uses a hash table data structure for fast index access. The keys in the table are video frame numbers, and the values are the structured recognition result data for the corresponding frame. Video frame numbers are sequentially incremented from 1, uniquely identifying a point in time within the video. The recognition result data contains complete information about all detected items in that frame. The mapping process iterates through all processed video frames, binding the recognition result of each frame with its corresponding frame number, forming a one-to-one correspondence between frame numbers and recognition data. The mapping table supports quick lookup of the corresponding recognition result based on the frame number and also supports batch extraction of recognition data based on a time range.
[0087] The generation of the time sequence labeling data set forms a complete time sequence data structure by integrating the mapping relationship of all frames. The data set organizes data in time sequence. Each time node corresponds to a video frame. The node data includes the identification result and timestamp information of the frame. The serial combination processing connects discrete frame identification results into continuous data streams. The processing process establishes the correlation between adjacent frames. The continuity of the items is judged by comparing the position coordinates and feature information of the items in adjacent frames. When the position change of the items in adjacent frames is within a reasonable range and the feature similarity is high, the tracking correlation is established to form the motion trajectory of the items in the time sequence. The structure of the sorting video recognition data stream includes two dimensions of time axis and item trajectory. The time axis records the time progress of the video. The item trajectory records the state change of each item at different time points. Each time node in the data stream includes the complete identification information of the current frame, and records the correlation with the previous frame and the next frame. The correlation information includes the corresponding relationship of the item ID, the position change vector, the state transition record and other time sequence features.
[0088] The statistical analysis processing performs performance evaluation and quality analysis on the sorting video recognition data stream. The analysis process calculates multiple key indicators to reflect the overall performance of the algorithm. The recognition accuracy is calculated by the ratio of the number of correctly identified items to the total number of identified items. The correct identification is based on the standard answer marked by artificial labeling or the preset verification rule. The statistical process traverses all identification results in the entire data stream to verify the accuracy. The success rate of the occlusion processing is specifically for items with occlusion. The success rate is calculated by comparing the identification result of the occluded item with the standard answer. This indicator directly reflects the repair effect of the YOLO-Inpaint algorithm and the effectiveness of the occlusion compensation mechanism. The average confidence is calculated by taking the arithmetic mean of the confidence values of all valid identification results. This indicator reflects the overall confidence level and stability of the algorithm output. The formatted output processing integrates the statistical analysis results and the original data stream into a standard format document. The document structure includes data stream overview, statistical indicator summary, detailed identification record, abnormal situation explanation and other parts. The document format adopts standard formats such as PDF or HTML for easy reading and sharing.
[0089] The above describes the sorting video recognition processing method based on YOLO in the embodiments of the present application. The sorting video recognition processing system based on YOLO in the embodiments of the present application is described below. Please refer to Figure 3 , one embodiment of the sorting video recognition processing system based on YOLO in the embodiments of the present application includes:
[0090] The segmentation module is configured to segment each frame of image in the sorting work video into a visible region and an occlusion region, mark the occlusion boundary through edge detection and connected component analysis, and construct occlusion mask data.
[0091] an embedding module configured to process the occlusion mask data by using a YOLO-Inpaint algorithm, the YOLO-Inpaint algorithm embedding an image inpainting loss calculation in a YOLO detection network, learning a mapping relationship from incomplete features to item features by an adversarial training manner, and obtaining a repaired feature map;
[0092] a calculation module configured to calculate an item completeness score based on the repaired feature map output by the YOLO-Inpaint algorithm, the score being calculated by a ratio of visible pixel area to predicted total area and a similarity of a repaired region to a real region;
[0093] a fusion module configured to perform weighted fusion of the item completeness score and a detection confidence, a weight ratio being adaptively adjusted according to an occlusion degree, and generating an occlusion-compensated sorting item recognition result;
[0094] an output module configured to construct a time-series labeled sorting video recognition data stream based on the sorting item recognition result, the data stream including an item category, a position coordinate, an occlusion state and a recognition confidence of each frame, and output a sorting video recognition processing report.
[0095] The above Figure 3 The YOLO-based sorting video recognition processing system in the embodiment of the present application is described in detail from the perspective of modular functional entities, and the YOLO-based sorting video recognition processing device in the embodiment of the present application is described in detail from the perspective of hardware processing.
[0096] Referring to Figure 4 In the embodiment of the present application, a YOLO-based sorting video recognition processing device is also provided, which can be a server, and the internal structure thereof can be as shown in Figure 4 The YOLO-based sorting video recognition processing device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. The processor of the computer is used to provide calculation and control capabilities. The memory of the YOLO-based sorting video recognition processing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the YOLO-based sorting video recognition processing device is used to store the corresponding data in the embodiment. The network interface of the YOLO-based sorting video recognition processing device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement the above method.
[0097] Those skilled in the art can understand that,Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the YOLO-based sorting video recognition processing device to which the scheme of the present application is applied.
[0098] The present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium, and can also be a volatile computer readable storage medium, and the computer readable storage medium stores instructions, and when the instructions run on a computer, the computer executes the steps of the YOLO-based sorting video recognition processing method.
[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, system and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0100] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical scheme of the present application or the whole or part of the technical scheme that essentially contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a YOLO-based sorting video recognition processing device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0101] The above embodiments are only used to illustrate the technical scheme of the present application, rather than limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical scheme recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical scheme deviate from the spirit and scope of the technical scheme of each embodiment of the present application.
Claims
1. A YOLO-based sorting video recognition processing method, characterized in that, The method comprises: Step S1, each frame image in the sorting operation video is segmented into a visible region and an occlusion region, an occlusion boundary is marked through edge detection and connected domain analysis, and occlusion mask data is constructed; Step S2, the occlusion mask data is processed by using a YOLO-Inpaint algorithm, the YOLO-Inpaint algorithm embeds image inpainting loss calculation in a YOLO detection network, learns a mapping relationship from a missing feature to an article feature through an adversarial training mode, and obtains a repaired feature map; Step S3, an article completeness score is calculated based on the repaired feature map output by the YOLO-Inpaint algorithm, the score is calculated through a ratio of a visible pixel area to a predicted total area and a similarity between a repaired region and an actual region; Step S4, the article completeness score and a detection confidence are weighted and fused, a weight ratio is adaptively adjusted according to an occlusion degree, and a sorting article recognition result after occlusion compensation is generated; Step S5, a sorting video recognition data stream labeled in time sequence is constructed based on the sorting article recognition result, contains an article category, a position coordinate, an occlusion state and an identification confidence of each frame, and a sorting video recognition processing report is output. 2.The YOLO-based sorting video recognition processing method of claim 1, wherein, The step S1 comprises: The single frame image of the sorting operation video is preprocessed through gray scale conversion and Gaussian filtering to obtain a denoised gray scale image; Gradient calculation and non-maximum suppression processing are performed on the denoised gray scale image based on a Canny edge detection algorithm to obtain an edge contour image; The edge contour image is input into a connected domain analysis algorithm for pixel connectivity detection and region marking processing to obtain a connected region label image; Occlusion discrimination analysis is performed according to the area size and shape features of each connected domain in the connected region label image, the region with an area smaller than a preset threshold and an irregular shape is marked as an occlusion region, and the remaining regions are marked as visible regions to obtain occlusion mask data. 3.The YOLO-based sorting video recognition processing method of claim 1, wherein, The step S2 comprises: Pixel-level fusion processing is performed on the occlusion mask data and the original frame image to generate an input feature matrix with an occlusion mark; An adversarial training architecture of a generator network and a discriminator network is constructed based on the input feature matrix, the generator network is responsible for inferring the article features in the occlusion region from the visible features around the occlusion region, the discriminator network is responsible for distinguishing the real features from the generated features, and an adversarial loss feedback signal is obtained; An image inpainting loss value is calculated according to the adversarial loss feedback signal, the loss value is composed of a reconstruction error and a perception error, the reconstruction error measures the pixel difference between the generated features and the real features, the perception error measures the semantic similarity between the generated features and the real features, and a comprehensive loss gradient is obtained; The comprehensive loss gradient is back propagated to the feature extraction layer of the YOLO detection network for weight updating, the updated network performs feature repair processing on the occlusion region to obtain a repaired feature map. 4.The YOLO-based sorting video recognition processing method of claim 3, wherein, The pixel-level fusion processing on the occlusion mask data and the original frame image to generate the input feature matrix with the occlusion mark comprises: The occlusion mask data is binarization coded, the pixel value of the occlusion region is set to 1, the pixel value of the visible region is set to 0, and a binary occlusion label map is obtained; The RGB three-channel data of the original frame image is fused with the binary occlusion label map through channel expansion, an occlusion label channel is added on the basis of the original three channels, and four-channel fused image data is obtained; Based on the four-channel fused image data, a pixel feature vector is constructed, each pixel position contains three color components of red, green and blue and an occlusion state component, and the feature vector is normalized to obtain a standardized pixel feature vector; The standardized pixel feature vector is reorganized into a matrix form according to the spatial position, the matrix dimension is the product of the image height, the image width and the feature channel number, and an input feature matrix with an occlusion label is obtained. 5.The YOLO-based sorting video recognition processing method of claim 1, wherein, The step S3 comprises: The repaired feature map is subjected to pixel segmentation processing, the pixel of the repaired article region is marked as foreground, and the pixel of the background region is marked as background, the number of foreground pixels is counted to obtain a visible pixel area value; Based on the article contour boundary in the repaired feature map, an external rectangle fitting calculation is performed, the product of the length and width of the external rectangle is calculated, and a predicted total area value is obtained; The visible pixel area value and the predicted total area value are calculated by ratio, and an area integrity coefficient is obtained; The repaired region in the repaired feature map and the corresponding real region are subjected to feature similarity matching calculation, the structural similarity index algorithm is used to calculate the similarity degree of the texture feature, a similarity coefficient is obtained, and the area integrity coefficient and the similarity coefficient are subjected to weighted average processing to obtain an article integrity score. 6.The YOLO-based sorting video recognition processing method of claim 1, wherein, The step S4 comprises: Based on the occlusion mask data, an occlusion degree coefficient is calculated, the total number of pixels in the occlusion region and the total number of pixels in the article region are calculated by ratio, and an occlusion degree value is obtained; An adaptive weight distribution algorithm is designed according to the occlusion degree value, when the occlusion degree value is less than a preset low threshold, the detection confidence weight is set as the dominant weight, when the occlusion degree value is greater than a preset high threshold, the article integrity score weight is set as the dominant weight, and a dynamic weight distribution scheme is obtained; The article integrity score and the detection confidence are subjected to weighted summation operation according to the dynamic weight distribution scheme, and a fused comprehensive score value is calculated; The comprehensive score value is subjected to threshold judgment processing, when the comprehensive score value is higher than the recognition threshold, it is marked as an effective recognition result, when the comprehensive score value is lower than the recognition threshold, it is marked as an invalid recognition result, and a sorting article recognition result after occlusion compensation is obtained. 7.The YOLO-based sorting video recognition processing method of claim 1, wherein, The step S5 comprises: The sorting article recognition result after occlusion compensation is subjected to data structuring processing, the article category, the bounding box position coordinates, the occlusion state identification and the recognition confidence value of each frame are organized into a structured data record; Based on the structured data record, a time sequence index mapping table is constructed, the video frame number is taken as the time index, the recognition result data of each frame is taken as the corresponding data value, a one-to-one correspondence between the frame number and the recognition result is established, and a time sequence labeling data set is obtained. The time sequence labeling data set is concatenated and combined in time sequence to form a continuous sorting video recognition data stream, and each time node in the data stream contains complete recognition information of the current frame and an association relationship with previous and subsequent frames; The sorting video recognition data stream is statistically analyzed and formatted for output processing, the recognition accuracy, the shielding processing success rate and the average confidence are calculated, the analysis results and the original data stream are integrated into a standard format document, and a sorting video recognition processing report is obtained.
8. A YOLO-based sorting video recognition processing system, characterized in that, The YOLO-based sorting video recognition processing system for implementing the YOLO-based sorting video recognition processing method in any one of claims 1-7 comprises: A segmentation module configured to segment each frame of image in a sorting job video into a visible region and a shielding region, mark a shielding boundary through edge detection and connected domain analysis, and construct shielding mask data; An embedding module configured to process the shielding mask data by using a YOLO-Inpaint algorithm, learn a mapping relationship from a defective feature to an item feature by an adversarial training manner, and obtain a repaired feature map through embedding an image inpainting loss calculation in a YOLO detection network; A calculation module configured to calculate an item completeness score based on the repaired feature map output by the YOLO-Inpaint algorithm, the score being calculated by a ratio of a visible pixel area to a predicted total area and a similarity between a repaired region and an actual region; A fusion module configured to weight and fuse the item completeness score and a detection confidence, a weight proportion being adaptively adjusted according to a shielding degree, and generate a shielding-compensated sorting item recognition result; An output module configured to construct a time sequence labeled sorting video recognition data stream based on the sorting item recognition result, the data stream containing an item category, a position coordinate, a shielding state and a recognition confidence of each frame, and output a sorting video recognition processing report.
9. A YOLO-based sorting video recognition processing device, characterized in that, A computer device comprising a memory and a processor, the memory storing a computer program capable of running on the processor, and the processor implements the YOLO-based sorting video recognition processing method in any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, causes the processor to perform the YOLO-based sorting video recognition processing method in any one of claims 1-7.
Citation Information
Patent Citations
Face registration method and device, and storage medium
CN111382681A
Image processing method and image processing device
CN113538273A
Kitchen garbage shielding object recognition and shielding relation judgment method
CN119027675A
Image perspective conversion display apparatus and method, and storage medium
WO2025161879A1
Cited By
Vortex identification and judgment method and grading early warning mechanism and system
CN121236500A
Warehouse article intelligent identification and classification method and system based on image processing, and related equipment
CN121544968A
