A method for redundancy cleaning of image datasets for helmet wearing detection

By combining the YOLO V4 algorithm and FFmpeg, image similarity is determined by the number of people and the distance between the center point coordinates. This solves the problem of cleaning redundant data in the training of the helmet wearing detection model, and improves the accuracy of dataset cleaning and the generalization ability of the model.

CN114067135BActive Publication Date: 2025-11-14SOUTHEAST DIGITAL ECONOMY DEV INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111360409.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-11-14
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

During the training process of existing helmet-wearing detection models, the image datasets contain redundancy, and the cleaning methods are not accurate enough, resulting in insufficient model generalization ability. Furthermore, manual and structural similarity evaluation methods are prone to misjudgment and are difficult to effectively remove redundant data.

Method used

The model was trained using the YOLO V4 algorithm, and the video was parsed into images using FFmpeg. The similarity of the images was judged by detecting the number of people and the distance between the center point coordinates. A threshold was set to delete redundant images, thereby improving the interpretability of the cleaning method.

Benefits of technology

It reduces misjudgments caused by changes in the motion of objects not related to the helmet, improves the accuracy and efficiency of dataset cleaning, reduces labor costs, and enhances the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114067135B_ABST
    Figure CN114067135B_ABST
Patent Text Reader

Abstract

This invention relates to a method for redundancy cleaning of image datasets for helmet wearing detection, comprising the following steps: training the YOLO V4 object detection algorithm on the VOC dataset, and saving the model file with the best result; parsing the video captured by the camera into images using FFmpeg; inputting the parsed images sequentially into the trained object detection model, retaining only the images of detected people; determining whether the number of people detected in two consecutive images is consistent; if inconsistent, saving both images; if consistent, calculating the coordinates of the center points of each person's position in the two images; calculating the sum of the distances between the corresponding center points; determining whether the sum of the calculated distances is greater than a set threshold; if the result is negative, deleting one of the images; if the result is positive, retaining both images. The advantage of this invention is that it improves the interpretability of the helmet wearing detection image data redundancy cleaning method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, specifically to a method for redundancy cleaning of image datasets for safety helmet wearing detection. Background Technology

[0002] Safety helmets, as mandatory work helmets worn during construction operations, have numerous applications, such as construction sites, factory production lines, and underground mining. Wearing safety helmets is not only a standard requirement for safe production operations but also a crucial guarantee of personal safety. Therefore, safety helmet wearing detection models have a very broad application prospect. At the same time, the accuracy of these models needs to reach a certain level. This requires targeted training of the safety helmet wearing detection model on monitoring video data from each specific application scenario.

[0003] With the continuous development of deep learning technology, object detection models, as one of the important directions in machine vision recognition, have also widely adopted deep learning-based detection techniques. Typically, deep learning requires a large number of labeled samples as training sets, and the backpropagation algorithm is used to fine-tune the model parameters to achieve the desired effect. Deep learning not only requires a large number of samples for training, but also that the samples exhibit differences. A large number of similar samples are detrimental to improving the generalization ability of deep learning models and also hinder practical testing applications after model deployment.

[0004] In actual training of a helmet-wearing detection model, the training set is typically acquired through video data from network surveillance cameras or recorders. This video data is then parsed into image data, and image annotation software is used to annotate the areas in the images where no helmet is being worn. However, when video is parsed into images, frames are saved as images at a certain frame rate. If the set frame rate is too low, images of people not wearing helmets may be lost, leading to a longer dataset collection period; if the set frame rate is too high, there may be a large amount of duplicate data. To collect data as quickly as possible, the frame rate is often set too high. Therefore, it is necessary to automatically remove the redundancy that exists after video-to-image conversion.

[0005] The following are some commonly used methods for redundancy removal in image datasets:

[0006] (1) Manual inspection

[0007] While manual inspection, as the most basic method, is relatively accurate in identifying redundant data in image datasets, it is costly. Furthermore, manual inspection is highly subjective, with inconsistencies arising between different annotators. These factors make it difficult to respond promptly to project requirements by relying solely on manual inspection to remove redundancy from image datasets.

[0008] (2) Structural similarity

[0009] Structural similarity, as an indicator of the degree of similarity between two images, is commonly used in image desimilarity tasks. However, applying it to a helmet-wearing monitoring project can lead to a situation where variations in non-helmet areas result in higher structural similarity values, mistakenly identifying the two images as different—a situation we often want to avoid.

[0010] The above methods cannot effectively achieve redundant cleaning of image datasets in the helmet wearing detection project. Summary of the Invention

[0011] The present invention aims to solve the above-mentioned technical problems by providing a method for redundancy cleaning of image datasets applicable to helmet wearing detection.

[0012] To solve the above-mentioned technical problems, the technical solution provided by the present invention is: a method for redundancy cleaning of image datasets for helmet wearing detection, comprising the following steps:

[0013] S1. The YOLO V4 object detection algorithm is used to train the model on the VOC dataset. The parameters are tuned using the backpropagation algorithm, and the model file with the best result is saved.

[0014] S2, use FFmpeg to parse the video captured by the camera into images;

[0015] S3: The parsed images are sequentially input into the target detection model trained in step S1, and the detection results only retain images of people detected.

[0016] S4, determine whether the number of people detected in the two images is consistent;

[0017] S5. If the judgment result in step S4 is inconsistent, then save both images.

[0018] S6. If the judgment result in step S4 is consistent, calculate the coordinates of the center point of each person's position in the two images, and match the two center points with the closest center point coordinates between the two images.

[0019] S7, calculate the sum of the distances between each corresponding center point;

[0020] S8, determine whether the sum of the calculated distances is greater than the set threshold;

[0021] S9. If the result of the judgment in S8 is negative, then delete one of the images.

[0022] S10. If the result of the judgment in S8 is yes, then both images are saved.

[0023] The present invention has the following advantages:

[0024] 1. Reduce non-redundant misjudgments in the safety helmet wearing detection image dataset caused by the movement and changes of objects such as on-site equipment that are not directly related to the safety helmet;

[0025] 2. The target detection model used in this invention does not require a large amount of actual field data from safety helmet inspections for model training;

[0026] 3. Filter out invalid images appearing from the operator's work;

[0027] 4. Improve the interpretability of the image data redundancy cleaning method for helmet wearing detection.

[0028] As an improvement, in step S3, only the result data of detected people is retained in the output, and it is replaced with the result data labeled as person in the VOC dataset.

[0029] As an improvement, step S2 specifically involves using FFmpeg to parse the video file captured by the camera into an image format according to a set frame rate and then saving it.

[0030] As an improvement, step S5 specifically involves determining that if the number of people detected in the two images is inconsistent, the two images are not similar and are not deleted as redundancy.

[0031] As an improvement, step S6 specifically involves calculating the coordinates of the center point of each person's location in the detection results if the number of people detected in the two images is consistent. The coordinates of the center point of each person in the previous image are then matched with the coordinates of the center point of the person closest to them in the next image.

[0032] As an improvement, step S9 specifically means that if the sum of the distances between the center coordinate points is less than or equal to a threshold, it indicates that the two images are similar, and one of the images is redundant and is deleted.

[0033] As an improvement, step S10 specifically means that if the sum of the distances between the center coordinate points is greater than a threshold, it indicates that the two images are not similar and there is no redundancy, and both images are saved. Attached Figure Description

[0034] Figure 1 This is a flowchart illustrating the steps of a method for redundancy cleaning of image datasets for helmet wearing detection according to the present invention. Detailed Implementation

[0035] The present invention will now be described in further detail with reference to the accompanying drawings.

[0036] Combined with appendix Figure 1 ,

[0037] Implementation of List 1

[0038] A method for redundancy cleaning of image datasets for helmet wearing detection includes the following steps:

[0039] S1. The YOLO V4 object detection algorithm is used to train the model on the VOC dataset. The parameters are tuned using the backpropagation algorithm, and the model file with the best result is saved.

[0040] S2, use FFmpeg to parse the video captured by the camera into images;

[0041] S3: The parsed images are sequentially input into the target detection model trained in step S1, and the detection results only retain images of people detected.

[0042] S4, determine whether the number of people detected in the two images is consistent;

[0043] S5. If the judgment result in step S4 is inconsistent, then save both images.

[0044] S6. If the judgment result in step S4 is consistent, calculate the coordinates of the center point of each person's position in the two images, and match the two center points with the closest center point coordinates between the two images.

[0045] S7, calculate the sum of the distances between each corresponding center point;

[0046] S8, determine whether the sum of the calculated distances is greater than the set threshold;

[0047] S9. If the result of the judgment in S8 is negative, then delete one of the images.

[0048] S10. If the result of the judgment in S8 is yes, then both images are saved.

[0049] Implementation of Column 2

[0050] A method for redundancy cleaning of image datasets for helmet wearing detection includes the following steps:

[0051] S1. The YOLO V4 object detection algorithm is used to train the model on the VOC dataset. The parameters are tuned using the backpropagation algorithm, and the model file with the best result is saved.

[0052] S2, using FFmpeg to parse the video file captured by the camera into an image format according to the set frame rate and save it;

[0053] S3: The parsed images are sequentially input into the target detection model trained in step S1. The detection results retain only the images of people detected, and the output only retains the result data of people detected, replacing it with the result data labeled as person in the VOC dataset.

[0054] S4, determine whether the number of people detected in the two images is consistent;

[0055] S5. If the number of people detected in the two images in step S4 is inconsistent, the two images are determined to be dissimilar and will not be deleted as redundancy.

[0056] S6. If the number of people detected in the two images in step S4 is consistent, then calculate the coordinates of the center point of each person's position in the detection result. The coordinates of the center point of each person in the previous image are respectively matched with the coordinates of the center point of the person closest to the previous image in the next image.

[0057] S7, calculate the sum of the distances between each corresponding center point;

[0058] S8, determine whether the sum of the calculated distances is greater than the set threshold;

[0059] S9. If the result of the judgment in S8 is negative, then the sum of the distances between the center coordinates is less than or equal to the threshold, indicating that the two images are similar, and one of the images is redundant and is deleted.

[0060] S10. If the judgment result in S8 is yes, then the sum of the distances between the center coordinates is greater than the threshold, indicating that the two images are not similar and there is no redundancy, and both images are saved.

[0061] The working principle of this invention is as follows: the output of the target detection model is used as the standard for evaluating the similarity between images, and the personnel detection model is used as the redundancy analysis model for the safety helmet wearing detection scene dataset. This will prevent the safety helmet wearing detection image dataset from being misjudged due to the movement of objects such as on-site equipment that are not directly related to the safety helmet.

[0062] The present invention and its embodiments have been described above. This description is not restrictive, and the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and, without departing from the spirit of the invention, design similar structures and embodiments without creative effort, all such designs should fall within the protection scope of the present invention.

Claims

1. A method for redundancy cleaning of image datasets for helmet wearing detection, characterized in that: Includes the following steps: S1. The YOLO V4 object detection algorithm is used to train the model on the VOC dataset. The parameters are tuned using the backpropagation algorithm, and the model file with the best result is saved. S2, use FFmpeg to parse the video captured by the camera into images; S3: The parsed images are sequentially input into the target detection model trained in step S1, and the detection results only retain images of people detected. S4, determine whether the number of people detected in the two images is consistent; S5. If the judgment result in step S4 is inconsistent, then save both images. S6. If the judgment result in step S4 is consistent, calculate the coordinates of the center point of each person's position in the two images, and match the two center points with the closest center point coordinates between the two images. S7, calculate the sum of the distances between each corresponding center point; S8, determine whether the sum of the calculated distances is greater than the set threshold; S9. If the result of the judgment in S8 is negative, then delete one of the images. S10. If the result of the judgment in S8 is yes, then both images are saved.

2. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: In step S3, the output only retains the result data of detected people and replaces it with the result data labeled as person in the VOC dataset.

3. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: Step S2 specifically involves using FFmpeg to parse the video file captured by the camera into an image format according to a set frame rate and then saving it.

4. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: Specifically, step S5 involves determining that if the number of people detected in the two images is inconsistent, the two images are not similar and are not deleted as redundancy.

5. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: Specifically, step S6 involves calculating the coordinates of the center point of each person in the detection results if the number of people detected in the two images is consistent. The coordinates of the center point of each person in the first image are then matched with the coordinates of the center point of the person closest to them in the second image.

6. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: Specifically, step S9 involves determining that if the sum of the distances between the center coordinate points is less than or equal to a threshold, it indicates that the two images are similar, and one of the images is redundant and is deleted.

7. The image dataset redundancy cleaning method for helmet wearing detection according to claim 1, characterized in that: Specifically, step S10 involves saving both images if the sum of the distances between the center coordinates is greater than a threshold.

Citation Information

Patent Citations

  • Similar image matching method based on deep learning

    CN111353538A

  • Video object detection method and device capable of reducing redundant data

    CN113657218A