Bagged material breakage real-time detection method and system based on lightweight DF-YOLOV5N

By lightweighting the YOLOV5N model and adopting the Deformer-FasterNet and deformable convolution modules, the speed and accuracy of bag breakage detection for bagged materials are optimized, solving the problem of large number of model parameters and slow speed in existing technologies. The system is suitable for real-time bag breakage detection in automated loading systems.

CN119445098BActive Publication Date: 2025-10-21SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411397453.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-10-21
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

The existing YOLOV5N model has many parameters and a slow detection speed, which makes it difficult to meet the real-time and high-efficiency requirements for broken package detection in automated loading systems.

Method used

A lightweight DF-YOLOV5N model is adopted. By replacing the backbone network of YOLOV5N with Deformer-FasterNet and introducing a deformable convolution module in the neck network, an efficient deformable cross-layer connection module is constructed to optimize the model structure.

Benefits of technology

It achieves fewer parameters and floating-point operations, improves detection speed and performance, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445098B_ABST
    Figure CN119445098B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on lightness DF-YOLOV5N's bagged material broken bag real-time detection method and system, the method includes: real-time acquisition bagged material bag image and cut part edge;The image after cutting is input into DF-YOLOV5N network, and the classification result of bagged material bag is output;The DF-YOLOV5N network is improved to YOLOV5N target detection network, and the improvement includes using Deformer-FatsterNet network to replace the backbone network of YOLOV5N target detection network, the Deformer-FatsterNet network includes the structure before global average pooling layer in FasterNet network, and connect pooling layer SPPF after last partial convolution module;Wherein, the second, third convolution module in FasterNet network with 2x2, step 2 convolution kernel is all replaced into deformable convolution module.The lightweight DF-YOLOV5N network model after improvement has less parameter amount and floating point operation amount by lightweight processing to YOLOV5N backbone network, simultaneously has faster detection speed and higher detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning and computer vision technology, and in particular to a method, system, terminal device, and computer-readable storage medium for real-time detection of bag breakage of bagged materials based on lightweight DF-YOLOV5N. Background Art

[0002] In material production and packaging companies, damage detection of material packages is a necessary step. Products with damaged packaging are considered substandard and require strict quality control by manufacturers. Its importance is also reflected in the following: damaged packaging can directly lead to material shortages, harming customer interests; damaged packages can also cause leakage, altering the thickness and other dimensions of the package, leading to uneven and unstable loading and stacking, and creating safety risks during bumps and sharp turns during transportation.

[0003] In manual loading systems, damaged material bags are discovered by workers loading and palletizing, who then discard them as processed products for recycling. Manual inspection and removal of damaged bags is not difficult, but these bags generate large amounts of dust, posing a significant health risk to workers. With the advancement of automation in material conveying, loading, and palletizing equipment, labor is freed from the harsh, dusty production environment. Without workers needing to palletize materials, manual inspection for damaged bags becomes almost unrealistic. Materials typically leave the factory 24 / 7, loaded as soon as a truck arrives. Because the damaged bag rate must be kept within a few thousandths of a percent, a production line typically sees no more than ten bags broken per day. This means that workers who inspect for damaged bags spend the majority of their time unattended, yet their eyes are constantly glued to the material conveyor, which can lead to fatigue and errors. Furthermore, these workers must be assigned to work in shifts. Therefore, automated identification of damaged bags and removal of substandard bags have become pressing technical challenges in automated loading systems.

[0004] Artificial intelligence detection technology has been researched and applied in packet corruption detection systems. YOLOV5N is a simple, efficient, single-stage object detection model that has become popular in recent years. It consists of an input, a backbone feature extraction network, a neck feature fusion network, and an output. This single network can directly classify and locate objects. However, YOLOV5N's model has a large number of parameters, making it less lightweight, and its detection speed still needs improvement. Summary of the Invention

[0005] In order to solve at least one technical problem in the above-mentioned prior art, the present invention provides a real-time detection method, system, terminal device and computer-readable storage medium for bagged material breakage based on lightweight DF-YOLOV5N.

[0006] The first object of the present invention is to provide a real-time detection method for bag breakage of bagged materials based on lightweight DF-YOLOV5N.

[0007] The second object of the present invention is to provide a real-time detection system for bagged material breakage based on the lightweight DF-YOLOV5N.

[0008] The third object of the present invention is to provide a terminal device.

[0009] A fourth object of the present invention is to provide a computer-readable storage medium.

[0010] The first object of the present invention can be achieved by adopting the following technical solutions:

[0011] A real-time detection method for bagged material breakage based on lightweight DF-YOLOV5N, the method comprising:

[0012] Acquire bagged material images in real time and crop some edges;

[0013] The cropped image is input into the DF-YOLOV5N network, and the classification result of the bagged material package is output; the DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network, and the improvement includes replacing the backbone network of the YOLOV5N target detection network with the Deformer-FasterNet network, and the Deformer-FasterNet network includes the structure before the global average pooling layer in the FasterNet network, and the pooling layer SPPF is connected after the last partial convolution module; wherein, the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced with deformable convolution modules.

[0014] Furthermore, the improvement also includes reconstructing the neck network in the YOLOV5N target detection network. The reconstructed neck network includes a convolution module, an upsampling module, and a deformable cross-hierarchical connection module. The deformable cross-hierarchical connection module is a module obtained by replacing the standard convolution with a 3×3 convolution kernel in the cross-hierarchical connection module of the original YOLOV5N neck with a deformable convolution.

[0015] The data processing flow of the reconstructed neck network is as follows:

[0016] The feature map output by the pooling layer SPPF in the Deformer-FasterNet network is processed using a convolution module with a convolution kernel of 1×1 to obtain the feature map T1;

[0017] Use the upsampling module to process the feature map T1 to obtain the feature map T2;

[0018] The feature map T2 is concatenated with the feature map output by the penultimate partial convolution module in the Deformer-FasterNet network and then fed into the deformable cross-layer connection module to obtain the feature map T3.

[0019] The feature map T3 is processed using a 3×3 convolution module with a convolution kernel to obtain a feature map T4;

[0020] The feature map T4 is concatenated with the feature map T1 and fed into the deformable cross-level connection module to obtain the feature map T5.

[0021] Output feature map T3 and feature map T5 to the head network.

[0022] Furthermore, before the cropped image is input into the DF-YOLOV5N network, the DF-YOLOV5N network is trained to detect the cropped image using the trained DF-YOLOV5N network.

[0023] Furthermore, the training of the DF-YOLOV5N network includes:

[0024] Get a dataset of bagged material images;

[0025] Label the samples in the dataset;

[0026] Perform data augmentation on the samples in the labeled dataset to make the number of sample labels in each category close;

[0027] The DF-YOLOV5N network is trained using data-enhanced samples.

[0028] Furthermore, the data enhancement includes at least one method of rotation transformation, noise addition, brightness adjustment, mosaic, copy and paste, and contrast-limited adaptive histogram equalization.

[0029] Furthermore, the marked categories are divided into four categories: normal package, there is only one package in the marked box, and the shape of the package is relatively full without holes; empty package, there is only one package in the marked box, and the shape of the package is flat; stacked package, there are two packages in the marked box, one of which is pressed underneath or squeezed to the side; broken package, there is only one package in the marked box, and the package has holes and is smaller than a normal package.

[0030] Furthermore, the acquisition of a data set of bagged material package images includes:

[0031] Take a video of the bagged material packages;

[0032] Extract frames from the video and extract images of bagged materials as samples in the dataset.

[0033] The second object of the present invention can be achieved by adopting the following technical solutions:

[0034] A real-time detection system for bagged material breakage based on the lightweight DF-YOLOV5N, the system comprising:

[0035] The acquisition module is used to acquire the bagged material package image in real time and crop some edges;

[0036] A detection module is configured to input the cropped image into a DF-YOLOV5N network and output a classification result of the bagged material package; the DF-YOLOV5N network is an improvement of the YOLOV5N target detection network, wherein the improvement includes replacing the backbone network of the YOLOV5N target detection network with a Deformer-FasterNet network, wherein the Deformer-FasterNet network includes a structure before the global average pooling layer in the FasterNet network, and a pooling layer SPPF is connected after the last partial convolution module; wherein the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced with deformable convolution modules.

[0037] The third object of the present invention can be achieved by adopting the following technical solutions:

[0038] A terminal device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the above-mentioned real-time detection method for bag breakage of bagged materials based on the lightweight DF-YOLOV5N is implemented.

[0039] The fourth object of the present invention can be achieved by adopting the following technical solutions:

[0040] A computer-readable storage medium stores a program, which, when executed by a processor, implements the above-mentioned real-time detection method for bag breakage of bagged materials based on the lightweight DF-YOLOV5N.

[0041] The present invention has the following beneficial effects compared to the prior art:

[0042] 1. By lightweighting the YOLOV5N backbone network, the improved model has fewer parameters and floating-point operations, while having faster detection speed and higher detection performance;

[0043] 2. The present invention uses deformable convolution in the neck network of the DF-YOLOV5N network to construct a more efficient deformable cross-layer connection module, which has stronger feature extraction capabilities and better model detection effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0045] Figure 1 This is a flow chart of a method for real-time detection of bag breakage of bagged materials based on lightweight DF-YOLOV5N according to Example 1 of the present invention;

[0046] Figure 2 This is a schematic diagram of a method for real-time detection of bag breakage of bagged materials based on lightweight DF-YOLOV5N according to Example 1 of the present invention;

[0047] Figure 3 This is the DF-YOLOV5N network structure diagram of this embodiment 1;

[0048] Figure 4 This is the FasterNet network structure diagram of this embodiment 1;

[0049] Figure 5 Schematic diagram of partial convolution operation in Example 1;

[0050] Figure 6 Schematic diagram of deformable convolution operation in Example 1;

[0051] Figure 7 This is a structural diagram of the deformable cross-layer connection module of Example 1;

[0052] Figure 8 : are sample images of each category of the data set used in Example 1;

[0053] Figure 9 is a new sample image obtained by each enhancement method used in Example 1;

[0054] Figure 10 This is a structural block diagram of a real-time detection system for bagged material breakage based on lightweight DF-YOLOV5N according to Example 2 of the present invention;

[0055] Figure 11 This is a structural block diagram of the terminal device of embodiment 3 of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. It should be understood that the specific embodiments described are only used to explain this application and are not used to limit this application. It is understandable that some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product.

[0057] Example 1:

[0058] like Figure 1 、 2 As shown, this embodiment provides a real-time detection method for bagged material breakage based on lightweight DF-YOLOV5N, comprising the following steps:

[0059] S101: Acquire an image of a bagged material package in real time and crop part of its edges.

[0060] After acquiring the image of the bagged material package in real time through the industrial camera, some edges and areas irrelevant to the detection are cropped according to the actual situation, so that the area of ​​the bagged material package in the image is increased, thereby improving the accuracy of the detection.

[0061] In this embodiment, 10% of the upper and lower edges and 15% of the left and right edges of the image are cropped respectively.

[0062] S102: Input the cropped image into the DF-YOLOV5N network and output the classification result of the bagged material package.

[0063] The cropped image is used as the input of the DF-YOLOV5N network, and the model performs forward inference and outputs the detection results.

[0064] The DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network.

[0065] The structure of DF-YOLOV5N network can be referred to Figure 3 Specific improvements include:

[0066] (1) Replace the backbone network of YOLOV5N with Deformer-FasterNet.

[0067] (1-1) Introduced the lighter and more efficient FasterNet.

[0068] The specific structure of FasterNet is as follows Figure 4As shown in the figure, it mainly consists of a convolution module with a convolution kernel size of 4×4 and a stride of 2, three convolution kernels with a stride of 2×2 and four partial convolution modules, and finally outputs through a global average pooling layer, a convolution layer with a convolution kernel size of 1×1, and a fully connected layer. The principle of partial convolution is as follows Figure 5 As shown, it only applies to some channels ( c p , which defaults to 1 / 4 of the input channels) for convolution, and the remaining channels are directly spliced ​​with the channels after the partial convolution, thus reducing computational complexity and improving feature extraction efficiency. This paper replaces all modules before the spatial pyramid pooling module in the YOLOV5N backbone network with all modules before the global average pooling layer in FasterNet.

[0069] (1-2) A more efficient deformable convolution is introduced.

[0070] The principle of deformable convolution is as follows Figure 6 As shown in the figure, deformable convolutions additionally learn sampling offsets based on standard convolutions, resulting in a more diverse sampling range and stronger feature extraction capabilities than standard convolutions. This paper uses deformable convolutions to replace the second and third convolution modules in FasterNet, which have a kernel size of 2×2 and a stride of 2, to achieve a trade-off between model complexity and detection accuracy. The improved backbone network is called Deformer-FasterNet.

[0071] (2) Reconstruction of the neck structure.

[0072] The data processing flow of the reconstructed neck network is as follows:

[0073] (2-1) The feature map of size 20×20×80 output by the SPPF layer in Deformer-FasterNet is fed into a 1×1 convolution module to obtain a feature map T1 of size 20×20×128.

[0074] (2-2) Send T1 to the upsampling module to obtain a feature map T2 of size 40×40×128.

[0075] (2-3) T2 is concatenated with the 40×40×40 feature map output by the penultimate convolutional module of Deformer-FasterNet and then fed into a deformable cross-level connection module to obtain a feature map T3 of size 40×40×128. The deformable cross-level connection module used in this embodiment is a module obtained by replacing the standard convolution kernel size of 3×3 in the cross-level connection module of the original YOLOV5N neck with a deformable convolution. Figure 7 .

[0076] (2-4) Feed T3 into a 3×3 convolution module to obtain a feature map T4 of size 20×20×64.

[0077] (2-5) T4 and T1 are concatenated and fed into a deformable cross-level connection module to obtain a feature map T5 of size 20×20×128.

[0078] (2-6) Output T3 and T5 to the detection head module of the head network.

[0079] The detection head module retains the original YOLOV5N network structure. Based on the obtained T3 and T5 feature maps, it obtains the target category through the classifier, and calculates the category and confidence loss at the same time. Then, it uses the regression loss to calculate and generate the prediction box according to the coordinates of the bounding box to achieve the output of target positioning and classification results.

[0080] Among them, the classification results are divided into four categories: normal package, empty package, overlapped package and broken package.

[0081] It is understandable that before the cropped image is input into the DF-YOLOV5N network, the DF-YOLOV5N network is trained. The cropped image is detected using the trained DF-YOLOV5N network.

[0082] Furthermore, the DF-YOLOV5N network is trained, including:

[0083] (1) Obtain a dataset of bagged material package images.

[0084] Frames are extracted from the video of bagged material packages shot by the camera on the bagged material conveyor belt, and the original bagged material package images are extracted as samples in the dataset.

[0085] (2) Label the samples in the dataset.

[0086] In this embodiment, the labels are divided into four categories according to the status of the bagged materials: normal bag, which has only one bag in the marked box and is relatively full without holes; empty bag, which has only one bag in the marked box and is flat; overlapped bag, which has two bags in the marked box, one of which is pressed underneath or squeezed next to it; broken bag, which has only one bag in the marked box and has holes in it, and is smaller than a normal bag. Some image samples can be referenced. Figure 8 .

[0087] (3) Perform data augmentation on samples in the labeled dataset.

[0088] The purpose of data augmentation is to alleviate the problem of sample imbalance.

[0089] In addition to conventional data enhancement methods such as rotation transformation, noise addition, brightness adjustment, mosaic, copy and paste, this embodiment also introduces a contrast-limited adaptive histogram equalization method. The image is first divided into many small blocks, and then the histogram of each small block is equalized.

[0090] Randomly use one or more of the above data augmentation methods to enhance the data set, focusing on enhancing the non-normal bag samples, so that the ratio of the number of sample labels of the above four categories is close to 1:1:1:1, and the number of images is expanded from 8777 to 33168. Some image samples after data augmentation can be referred to Figure 9 .

[0091] (4) Use the data-enhanced samples to train the DF-YOLOV5N network.

[0092] In this embodiment, the number of training rounds is set to 40, the batch size is 8, the image input size is 640×640 pixels, the optimizer used is stochastic gradient descent, and the learning rate is set to 0.01.

[0093] Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium.

[0094] It should be noted that although the method operations of the above embodiments are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed to achieve the desired results. Rather, the depicted steps may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.

[0095] Example 2:

[0096] like Figure 10 As shown, this embodiment provides a real-time detection system for bagged material breakage based on the lightweight DF-YOLOV5N. The system includes an acquisition module 1001 and a detection module 1002, wherein:

[0097] An acquisition module 1001 is used to acquire an image of a bagged material package in real time and crop part of the edges;

[0098] The detection module 1002 is used to input the cropped image into the DF-YOLOV5N network and output the classification result of the bagged material package; the DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network, and the improvement includes using the Deformer-FasterNet network to replace the backbone network of the YOLOV5N target detection network. The Deformer-FasterNet network includes the structure before the global average pooling layer in the FasterNet network, and the pooling layer SPPF is connected after the last partial convolution module; wherein the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced by deformable convolution modules.

[0099] The specific implementation of each module in this embodiment can be found in the above-mentioned embodiment 1, and will not be described one by one here; it should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.

[0100] Example 3:

[0101] This embodiment provides a terminal device, which can be a computer, such as Figure 11 As shown, it comprises a processor 1102, a memory, an input device 1103, a display 1104, and a network interface 1105 connected via a system bus 1101. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 1106 and an internal memory 1107. The non-volatile storage medium 1106 stores an operating system, a computer program, and a database. The internal memory 1107 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the processor 1102 executes the computer program stored in the memory, the real-time detection method for bagged material breakage based on the lightweight DF-YOLOV5N of the above-mentioned embodiment 1 is implemented as follows:

[0102] Acquire bagged material images in real time and crop some edges;

[0103] The cropped image is input into the DF-YOLOV5N network, and the classification result of the bagged material package is output; the DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network, and the improvement includes replacing the backbone network of the YOLOV5N target detection network with the Deformer-FasterNet network, and the Deformer-FasterNet network includes the structure before the global average pooling layer in the FasterNet network, and the pooling layer SPPF is connected after the last partial convolution module; wherein, the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced with deformable convolution modules.

[0104] Example 4:

[0105] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for detecting bag breakage of bagged materials based on the lightweight DF-YOLOV5N in the above embodiment 1 is implemented as follows:

[0106] Acquire bagged material images in real time and crop some edges;

[0107] The cropped image is input into the DF-YOLOV5N network, and the classification result of the bagged material package is output; the DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network, and the improvement includes replacing the backbone network of the YOLOV5N target detection network with the Deformer-FasterNet network, and the Deformer-FasterNet network includes the structure before the global average pooling layer in the FasterNet network, and the pooling layer SPPF is connected after the last partial convolution module; wherein, the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced with deformable convolution modules.

[0108] It should be noted that the computer-readable storage medium of this embodiment may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0109] The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes based on the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which falls within the scope of protection of the present invention.

Claims

1. A real-time detection method for bagged material breakage based on lightweight DF-YOLOV5N, characterized in that: The method comprises: Acquire bagged material images in real time and crop some edges; The cropped image is input into the DF-YOLOV5N network, and the classification result of the bagged material package is output; the DF-YOLOV5N network is obtained by improving the YOLOV5N target detection network. The improvement includes replacing the backbone network of the YOLOV5N target detection network with the Deformer-FasterNet network. The Deformer-FasterNet network includes the structure before the global average pooling layer in the FasterNet network, and the pooling layer SPPF is connected after the last partial convolution module; wherein the second and third convolution modules with a convolution kernel of 2×2 and a stride of 2 in the FasterNet network are replaced with deformable convolution modules; The improvement also includes reconstructing the neck network in the YOLOV5N target detection network. The reconstructed neck network includes a convolution module, an upsampling module, and a deformable cross-hierarchical connection module. The deformable cross-hierarchical connection module is a module obtained by replacing the standard convolution with a 3×3 convolution kernel in the cross-hierarchical connection module of the original YOLOV5N neck with a deformable convolution. The data processing flow of the reconstructed neck network is as follows: The feature map output by the pooling layer SPPF in the Deformer-FasterNet network is processed using a convolution module with a convolution kernel of 1×1 to obtain the feature map T1; Use the upsampling module to process the feature map T1 to obtain the feature map T2; The feature map T2 is concatenated with the feature map output by the penultimate partial convolution module in the Deformer-FasterNet network and then fed into the deformable cross-layer connection module to obtain the feature map T3. The feature map T3 is processed using a 3×3 convolution module with a convolution kernel to obtain a feature map T4; The feature map T4 is concatenated with the feature map T1 and fed into the deformable cross-level connection module to obtain the feature map T5. Output feature map T3 and feature map T5 to the head network.

2. The method for real-time detection of bagged material breakage according to claim 1, characterized in that: Before the cropped image is input into the DF-YOLOV5N network, the DF-YOLOV5N network is also trained to detect the cropped image using the trained DF-YOLOV5N network.

3. The method for real-time detection of bag breakage of bagged materials according to claim 2, characterized in that: The training of the DF-YOLOV5N network includes: Get a dataset of bagged material images; Label the samples in the dataset; Perform data augmentation on the samples in the labeled dataset to make the number of sample labels in each category close; The DF-YOLOV5N network is trained using data-enhanced samples.

4. The method for real-time detection of bagged material breakage according to claim 3, characterized in that: The data enhancement includes at least one method selected from the group consisting of rotation transformation, noise addition, brightness adjustment, mosaic, copy-paste, and contrast-limited adaptive histogram equalization.

5. The method for real-time detection of bagged material breakage according to claim 3, characterized in that: There are four types of marked packages: normal package, which means there is only one package in the marked box and the package is full and has no holes; empty package, which means there is only one package in the marked box and the package is flat; For stacked packages, there are two packages in the marked box, one of which is pressed underneath or squeezed to the side; for broken packages, there is only one package in the marked box, and there is a hole in the package, and the shape is smaller than a normal package.

6. The method for real-time detection of bagged material breakage according to claim 3, characterized in that: The data set of bagged material package images is obtained, including: Take a video of the bagged material packages; Extract frames from the video and extract images of bagged materials as samples in the dataset.

7. A real-time detection system for bagged materials broken based on lightweight DF-YOLOV5N, characterized by: The system comprises: The acquisition module is used to acquire the bagged material package image in real time and crop some edges; A detection module is configured to input the cropped image into a DF-YOLOV5N network and output a classification result for the bagged material package; the DF-YOLOV5N network is an improvement of the YOLOV5N target detection network, wherein the improvement includes replacing the backbone network of the YOLOV5N target detection network with a Deformer-FasterNet network, wherein the Deformer-FasterNet network includes a structure before the global average pooling layer in the FasterNet network, and a pooling layer SPPF is connected after the last partial convolution module; wherein the second and third convolution modules in the FasterNet network with a convolution kernel of 2×2 and a stride of 2 are replaced with deformable convolution modules; Among them, the improvement in the detection module also includes reconstructing the neck network in the YOLOV5N target detection network. The reconstructed neck network includes a convolution module, an upsampling module, and a deformable cross-hierarchical connection module; the deformable cross-hierarchical connection module is a module obtained by replacing the standard convolution with a 3×3 convolution kernel in the cross-hierarchical connection module of the original YOLOV5N neck with a deformable convolution; the data processing flow of the reconstructed neck network is as follows: The feature map output by the pooling layer SPPF in the Deformer-FasterNet network is processed using a convolution module with a convolution kernel of 1×1 to obtain the feature map T1; Use the upsampling module to process the feature map T1 to obtain the feature map T2; The feature map T2 is concatenated with the feature map output by the penultimate partial convolution module in the Deformer-FasterNet network and then fed into the deformable cross-layer connection module to obtain the feature map T3. The feature map T3 is processed using a 3×3 convolution module with a convolution kernel to obtain a feature map T4; The feature map T4 is concatenated with the feature map T1 and fed into the deformable cross-level connection module to obtain the feature map T5. Output feature map T3 and feature map T5 to the head network.

8. A terminal device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the real-time detection method for bagged material breakage according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the real-time detection method for bagged material breakage according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Target detection method and city violation event monitoring method using same

    CN114529873A

  • Light indoor service robot target identification method based on deformable convolution

    CN117115592A