Method and apparatus for a picture collection cleaning tool

The image collection and cleaning tool based on the YOLOv5 object detection algorithm solves the problem of time-consuming manual image data collection and cleaning, realizes automated data integration and cleaning, and improves efficiency.

CN116935119BActive Publication Date: 2026-06-05INSPUR QILU SOFTWARE IND
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR QILU SOFTWARE IND
Filing Date
2023-07-20
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In the field of AI visual reasoning, manually collecting and cleaning image data is time-consuming and inefficient.

Method used

This image collection and cleaning tool uses the YOLOv5 object detection algorithm. It interacts in a B/S mode, with front-end and back-end code separation, and integrates four business modules. It provides functions such as model training, image collection and cleaning, and image extraction from video files and real-time video streams. It uses the YOLOv5 module for automated data integration and cleaning.

Benefits of technology

It enables the rapid collection and cleaning of datasets containing specific labels, reducing manual operations and improving data integration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116935119B_ABST
    Figure CN116935119B_ABST
Patent Text Reader

Abstract

The application relates to the field of Python Web application development, and particularly provides a picture collection and cleaning tool method and device, which are based on a yolov5 target detection algorithm, adopt B / S mode interaction, separate front-end and back-end codes, develop a front-end page based on a vue framework, and develop a back-end based on a python-flask framework; an application control layer comprises four business modules of ai_mode, img_clean, video_clean and rtmp_clean, integrates a yolov5 target detection algorithm module, and provides model training, picture collection and cleaning, video file and real-time video stream picture interception functions. Compared with the prior art, the application can quickly and conveniently collect a large amount of high-quality dataset pictures, and reduces the workload of manually collecting and cleaning massive datasets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Python web application development, specifically providing a method and apparatus for image collection and cleaning. Background Technology

[0002] In the development of deep learning models, data is crucial to the effectiveness of the algorithm. This is especially true for high-precision, customized models developed by enterprise users and researchers, which require massive amounts of data for training. However, typically, developers can only collect and clean this large volume of data manually, a time-consuming process that wastes human resources.

[0003] Currently, research on image data collection and cleaning is still limited in the field of artificial intelligence visual reasoning. Therefore, developing intelligent and automated tools for automatic collection and cleaning can significantly improve efficiency.

[0004] How to solve the problem of the time-consuming manual collection and cleaning of image data in the field of artificial intelligence visual reasoning is an urgent issue that needs to be addressed by those skilled in the art. Summary of the Invention

[0005] This invention addresses the shortcomings of the prior art by providing a method for a highly practical image collection and cleaning tool.

[0006] A further technical objective of this invention is to provide a reasonably designed, safe, and applicable device for image collection and cleaning.

[0007] The technical solution adopted by this invention to solve its technical problem is:

[0008] A method for image collection and cleaning tools, based on the YOLOv5 object detection algorithm, adopts a B / S mode interaction, separates front-end and back-end code, with the front-end page developed based on the Vue framework and the back-end developed based on the Python-Flask framework;

[0009] The application control layer includes four business modules: ai_mode, img_clean, video_clean, and rtmp_clean. It integrates the YOLOv5 object detection algorithm module and provides functions for model training, image collection and cleaning, video file processing, and real-time video stream image extraction.

[0010] Furthermore, in ai_mode, a request to upload the training set ZIP package is initiated on the HTML page. After the backend ai_mode module responds, the ZIP sent by the frontend is decompressed to a fixed path on the server.

[0011] Furthermore, on the HTML page, after selecting the uploaded training set, setting the pre-training weights, number of iterations, number of samples selected for one training session, and other parameters, click the "Start Training" button. The backend ai_mode module will create a thread and call train.py in the yolov5 module to train the inference model. After training is complete, an algorithm model capable of inferring fixed labels will be generated.

[0012] Furthermore, in img_clean, after entering keywords and the number of downloads on the HTML page and clicking the OK button, the backend img_clean module calls the crawler() function to search for and download images through the Baidu Image Keyword Query Interface. The images will be saved in a folder named after the keywords in a fixed path on the server.

[0013] Furthermore, after collection is complete, select the keyword folder to be cleaned and the trained algorithm model on the HTML page, check the checkboxes for the label categories to be retained, and click the Start Cleaning button. The backend img_clean module will create a thread and call the image inference program in the yolov5 module to infer each image one by one. If the inferred image does not contain the target label, it will be deleted. Finally, you will get the dataset images containing the specific label.

[0014] Furthermore, in video_clean, when a video file upload request is initiated on the front-end HTML page, the video file will be successfully uploaded to a fixed path on the server after the back-end video_clean module responds.

[0015] Furthermore, after successful upload, select the video file to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button on the HTML page. The backend video_clean module will create a thread and call the video inference program in the yolov5 module to perform target category detection inference. If the frame image contains the target label, it will be captured and saved. Finally, the dataset images containing the specific label will be collected.

[0016] Furthermore, in rtmp_clean, after entering the camera name and URL on the front-end HTML page and clicking the OK button, a request to add a device is initiated. After the back-end rtmp_clean module responds, the device is successfully saved.

[0017] Furthermore, after successfully adding a device, select the video device to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button. The backend rtmp_clean module will create a thread and call the real-time video inference program in the yolov5 module to perform target category detection inference. Similarly, if the frame image contains the target label, it will be captured and saved. Finally, a dataset of images containing specific labels will be collected.

[0018] An apparatus for image collection and cleaning tools includes: at least one memory and at least one processor;

[0019] The at least one memory is used to store a machine-readable program;

[0020] The at least one processor is configured to invoke the machine-readable program to execute a method for an image collection and cleaning tool.

[0021] Compared with the prior art, the method and apparatus for image collection and cleaning of the present invention have the following outstanding advantages:

[0022] This invention integrates the YOLOv5 object detection algorithm, which requires only a small number of images to train into an algorithm model. By loading this algorithm model and selecting based on label categories, a large number of images crawled from Baidu Images can be quickly collected into a dataset containing target labels through inference and cleaning. In addition, this invention also provides the function of quickly collecting datasets containing specific labels by inferring and extracting images from video files or real-time video streams through the algorithm model. This can quickly and conveniently collect a large number of high-quality dataset images, reducing the workload of manually collecting and cleaning massive datasets. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Appendix Figure 1 This is a flowchart illustrating a method for image collection and cleaning tools. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] The following is a preferred embodiment:

[0027] like Figure 1 As shown in this embodiment, a method for an image collection and cleaning tool is based on the YOLOv5 object detection algorithm, adopts a B / S mode interaction, separates front-end and back-end code, develops the front-end page based on the Vue framework, and develops the back-end based on the Python-Flask framework.

[0028] The application control layer includes four business modules: ai_mode, img_clean, video_clean, and rtmp_clean. It integrates the YOLOv5 object detection algorithm module and provides functions for model training, image collection and cleaning, video file processing, and real-time video stream image extraction.

[0029] In ai_mode, the HTML page initiates an upload request for a training set (approximately 200 images, containing specific labels) in a ZIP package. After the backend ai_mode module responds, it decompresses the ZIP file sent by the frontend to a fixed path on the server. On the HTML page, the user selects the uploaded training set, sets the pre-training weights, number of iterations, number of samples selected for one training iteration, and other parameters, and then clicks the "Start Training" button. The backend ai_mode module creates a thread and calls the train.py file in the yolov5 module to train the inference model. After training, an algorithm model capable of inferring fixed labels is generated.

[0030] In img_clean, after entering keywords and the number of downloads on the HTML page and clicking the OK button, the backend img_clean module calls the crawler() function to search for and download images through the Baidu Image Keyword Query API. The images will be saved in a folder named after the keywords in a fixed path on the server.

[0031] After collection is complete, select the keyword folder to be cleaned, select the trained algorithm model, check the checkboxes for the label categories to be retained, and click the Start Cleaning button on the HTML page. The backend img_clean module will create a thread and call the image inference program in the yolov5 module to infer each image one by one. If the inferred image does not contain the target label, it will be deleted. Finally, you will get the dataset images containing the specific label.

[0032] In video_clean, when a video file upload request is initiated on the front-end HTML page, the video file will be successfully uploaded to a fixed path on the server after the back-end video_clean module responds.

[0033] After successful upload, select the video file to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button on the HTML page. The backend video_clean module will create a thread and call the video inference program in the yolov5 module to perform target category detection inference. If the frame image contains the target label, it will be captured and saved. Finally, the dataset images containing the specific label will be collected.

[0034] In rtmp_clean, after entering the camera name and URL on the front-end HTML page and clicking the OK button, a request to add a device is initiated. After the back-end rtmp_clean module responds, the device is successfully saved.

[0035] After successfully adding a device, select the video device to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button on the HTML page. The backend rtmp_clean module will create a thread and call the real-time video inference program in the yolov5 module to perform target category detection inference. Similarly, if the frame image contains the target label, it will be captured and saved. Finally, a dataset of images containing specific labels will be collected.

[0036] like:

[0037] The collected images of smoking were labeled as a training set (labeled as smoke and no_smoke) and uploaded to the application server via an HTML page.

[0038] On the HTML page, select the uploaded training set, set the pre-training weights, number of iterations, number of samples selected for one training session, and other parameters, then click the "Start Training" button to train and generate the smoking inference algorithm model.

[0039] After entering the keyword "smoking" and the download quantity of 10,000 on the HTML page, click the "OK" button to download the smoking image.

[0040] On the HTML page, select the smoking folder to be cleaned, select the smoking inference algorithm model, check the smoke tag checkbox, and click the start cleaning button to clean the images. Finally, you can collect a dataset of images containing only smoking images.

[0041] Users select the smoking video file or the camera device pointing at the smoking location on the HTML page, choose the algorithm model, check the "smoke" tag checkbox, and click the "Start Capture" button to infer the video file. In the end, a dataset of images containing only smoking images can be collected.

[0042] Based on the above method, an apparatus for an image collection and cleaning tool in this embodiment includes: at least one memory and at least one processor;

[0043] The at least one memory is used to store a machine-readable program;

[0044] The at least one processor is configured to invoke the machine-readable program to execute a method for an image collection and cleaning tool.

[0045] The above-described specific embodiments are merely specific examples of the present invention. The patent protection scope of the present invention includes, but is not limited to, the above-described specific embodiments. Any technical solution that conforms to the claims of the present invention and any appropriate changes or substitutions made by a person skilled in the art should fall within the patent protection scope of the present invention.

[0046] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for image collection and cleaning tools, characterized in that, Based on the YOLOv5 object detection algorithm, it adopts a B / S mode interaction, with front-end and back-end code separation. The front-end page is developed based on the Vue framework, and the back-end is developed based on the Python-Flask framework. The application control layer includes four business modules: ai_mode, img_clean, video_clean, and rtmp_clean. It integrates the YOLOv5 object detection algorithm module and provides functions for model training, image collection and cleaning, video files, and real-time video stream image extraction. In ai_mode, a request to upload the training set ZIP package is initiated on the HTML page. After the backend ai_mode module responds, the ZIP sent by the frontend is decompressed to a fixed path on the server. On the HTML page, select the uploaded training set, set the pre-training weights, number of iterations, number of samples selected for one training session, and other parameters, then click the "Start Training" button. The backend ai_mode module will create a thread and call train.py in the yolov5 module to train the inference model. After training is complete, an algorithm model that can infer fixed label labels will be generated. In img_clean, after entering keywords and download quantity on the HTML page and clicking the OK button, the backend img_clean module calls the crawler() function to search for and download images through the Baidu Image Keyword Query Interface. The images will be saved in a folder named after the keywords in a fixed path on the server. After collection, select the keyword folder to be cleaned and the trained algorithm model on the HTML page, check the checkboxes for the label categories to be retained, and click the Start Cleaning button. The backend img_clean module will create a thread and call the image inference program in the yolov5 module to infer each image one by one. If the inferred image does not contain the target label, it will be deleted. Finally, you will get the dataset images containing the specific label. In video_clean, a video file upload request is initiated on the front-end HTML page. After the back-end video_clean module responds, the video file will be successfully uploaded to a fixed path on the server. After successful upload, select the video file to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button on the HTML page. The backend video_clean module will create a thread and call the video inference program in the yolov5 module to perform target category detection inference. If the frame image contains the target label, it will be captured and saved. Finally, the dataset images containing the specific label will be collected. In rtmp_clean, after entering the camera name and URL on the front-end HTML page and clicking the OK button, a request to add a device is initiated. After the back-end rtmp_clean module responds, the device is successfully saved. After successfully adding a device, select the video device to be inferred, select the algorithm model, check the checkboxes for the labels to be retained, and click the Start Capture button on the HTML page. The backend rtmp_clean module will create a thread and call the real-time video inference program in the yolov5 module to perform target category detection inference. Similarly, if the frame image contains the target label, it will be captured and saved. Finally, a dataset of images containing specific labels will be collected.

2. A device for image collection and cleaning, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to execute the method of claim 1.

Citation Information

Patent Citations

  • Intelligent labeling method based on yov5 target detection algorithm

    CN115761413A