Power plant personnel safety equipment wearing detection method based on YOLO v5
Through the YOLO v5-based method of wearing safety equipment for power plant personnel, the problem of poor accuracy and occlusion of small and medium-sized target wearing inspection of safety equipment for power plant personnel is solved, and high-precision and real-time monitoring of wearing safety equipment for power plant personnel is achieved, ensuring the safety of power plant personnel.
Patent Information
- Application Number
- CN202411786118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art has poor small target detection accuracy and occlusion problems in the wear detection of safety equipment for power plant personnel, making it difficult to accurately detect the wear of safety equipment in complex environments.
The YOLO v5-based method of wearing safety equipment for power plant personnel is adopted. By collecting and marking data sets of wearing safety helmets and not wearing safety helmets, the YOLO v5 model is trained to improve the model's ability to identify small targets and occlusion situations.
It realizes high-precision and real-time detection of the wear of safety equipment for power plant personnel, effectively improves the accuracy and reliability of inspection, and meets the needs of safety equipment wearing monitoring in complex environments of power plants.
Smart Images

Figure CN119723446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of safety equipment wearing detection, and in particular to a method for detecting safety equipment wearing by power plant personnel based on YOLO v5. Background Art
[0002] Power plants are of irreplaceable importance in modern society. They are one of the key infrastructures supporting economic development. Electricity is the basic energy source in various fields such as modern industry, commerce, life and transportation, and power plants are the core of energy production. The normal operation of power plants is closely related to the behavioral norms of employees, because the safe, stable and efficient operation of power plants depends on all employees complying with strict behavioral norms. Power plants are not only technologically complex and system-intensive industrial facilities, but also involve a large number of high-risk equipment and operations. The behavioral norms of employees directly affect the safety, production efficiency, equipment operation status, environmental protection and compliance of power plants. In detail, it mainly includes the following points:
[0003] 1. Ensure safe operation
[0004] Power plants involve many dangerous factors such as high-voltage electrical equipment, high-temperature and high-pressure equipment, and chemicals. The behavioral norms of employees are the prerequisite for ensuring safe operation. If employees do not strictly abide by the operating specifications, it may cause equipment failure, casualties or environmental pollution accidents. Employees need to follow strict operating procedures when operating boilers, high-voltage equipment, and electrical equipment. Illegal operations may cause equipment damage, fire, explosion and other safety accidents. Employees must wear personal protective equipment such as hard hats, gloves, goggles, and respiratory protection when entering high-risk areas (such as boiler rooms, chemical storage areas, electrical equipment rooms, etc.). Failure to comply with these specifications will increase the risk of accidents.
[0005] 2. Prevent human errors
[0006] The equipment and production processes of power plants are usually highly complex and sophisticated. Any human error may have a serious impact on the equipment, production or environment. Employee behavioral norms help avoid human errors and ensure the smooth operation of the production process. The startup, shutdown, maintenance and commissioning of power plant equipment have a complete set of standardized operating procedures that employees must strictly follow. These norms help avoid misoperation of equipment during operation and ensure the normal operation of equipment.
[0007] 3. Ensure healthy operation of equipment
[0008] Power plant equipment is often expensive and technically complex, and proper operation requires careful and cautious behavior from operators. Employees strictly follow the code of conduct in equipment operation, maintenance and management, which helps to extend the service life of the equipment and reduce the probability of failure. Each equipment has specific operating requirements, and employees must operate in accordance with the regulations of the equipment manufacturer or power plant. For example, when starting and stopping equipment, steps must be followed to prevent damage or failure of the equipment.
[0009] 4. Improve production efficiency and stability
[0010] The normal operation of a power plant must not only ensure safety, but also operate efficiently and stably. The behavioral norms of employees directly affect production efficiency. Standardized operations and efficient work processes can reduce waste and increase output value. Employees can improve work efficiency and reduce time wasted due to misoperation or improper operation by operating in accordance with the behavioral norms. For example, the correct start and stop of equipment, correct load management, and reasonable energy scheduling can all improve power generation efficiency. The behavioral norms require employees to work in accordance with standard procedures, reduce errors and confusion during operations, and ensure that each operation is completed under the most optimized conditions, thereby improving overall production efficiency.
[0011] The normal operation of a power plant is closely related to the behavioral norms of its employees. The behavioral norms of employees in operation, maintenance, inspection and emergency response directly affect the safety, equipment operation, production efficiency, environmental protection and compliance of the power plant. Standardized behavior can not only effectively prevent accidents and equipment failures, but also improve the production efficiency of the power plant and ensure the continuous and stable energy supply. Therefore, power plants must strengthen the formulation and implementation of employee behavioral norms, and ensure that employees always follow the norms through training, supervision, management and other means to ensure the safe, stable and efficient operation of the power plant.
[0012] Today’s safety equipment detection systems for staff still have the following deficiencies:
[0013] 1. Poor detection accuracy of small targets: In equipment wear detection, due to the complex environment of the construction site, the distance between people and cameras is usually far, the safety equipment to be detected is small, and the features are not obvious, resulting in poor detection accuracy of small targets. Therefore, it is necessary to improve the existing image detection network and reasonably optimize its algorithm so that the improved algorithm can improve the recognition effect of small targets.
[0014] 2. Occlusion problem: When testing the wearing of safety equipment at the construction site, there are a lot of obstructions, such as steel pipes and soil piles, which make the target of the worker to be tested incomplete, making the detection more difficult. The occlusion problem is a common problem in target detection, especially for helmet detection in complex environments. Therefore, it is necessary to improve the model's ability to solve occlusion problems. Summary of the invention
[0015] In view of the above situation, in order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a power plant personnel safety equipment wearing detection method based on YOLO v5, which can effectively solve the problem of accurate, efficient and real-time detection of power plant personnel's safety helmet wearing.
[0016] The technical solution adopted by the present invention is:
[0017] A method for detecting the wearing of safety equipment by power plant personnel based on YOLO v5, comprising the following steps:
[0018] S1. Collect data sets of people wearing helmets and people not wearing helmets, label the data and divide them into training sets, validation sets and test sets:
[0019] A. Collecting Datasets
[0020] Self-photographed datasets or public datasets are used as training sets for this model. The datasets include people wearing helmets and people not wearing helmets, including different angles, different distances, different scenes, and different helmet colors.
[0021] B. Label the data
[0022] Use labelimg to label the data, use the bounding box to circle the shape of the helmet, select the corresponding category, save the annotation, and save the image in the format of a txt file;
[0023] C. Divide the training set, validation set, and test set
[0024] The labeled data is divided into training set, validation set and test set, with 80% for training set, 10% for validation set and 10% for test set;
[0025] S2. Train the YOLO v5 model
[0026] Use Python code for training. After the training is completed, the trained YOLO v5 model is obtained and the model results are evaluated. In the field of target detection, the mean average precision (mAP) is used as an indicator to evaluate the performance and reliability of the training algorithm to evaluate the performance of the model's helmet wearing detection algorithm. The specific steps include:
[0027] A. Apply the above evaluation indicators to the performance test of the helmet detection algorithm
[0028] Two types of result images can be obtained, including construction workers wearing helmets and construction workers not wearing helmets. The accuracy is described by four indicators: true positive examples, false positive examples, true negative examples, and false negative examples. Specifically, TP hatTo represent the number of people who are not wearing helmets within the monitoring range of the construction site, and the detection result is correct, that is, a true positive; FP hat TN represents the number of people who actually wear helmets but are detected as not wearing helmets, i.e., false positives; hat Indicates that the algorithm detects correctly, that is, a true counterexample; FN hat It represents the number of people who are not wearing helmets but are mistakenly detected, that is, false negative examples. The calculation formula is as follows:
[0029]
[0030] Among them, AP hat Indicates the recognition accuracy of the security device;
[0031] B. Calculate the average precision
[0032] The average precision calculation formula is as follows:
[0033]
[0034] Among them: Q is the total number of categories, q is the qth category;
[0035] When the average accuracy reaches above 90%, the detection requirements can be met and the model construction is completed;
[0036] S3. Real-time detection and early warning
[0037] There are two ways to detect whether a person is wearing a helmet: local media file detection and camera real-time detection;
[0038] The system reads the video to be detected frame by frame, converts each frame into a matrix format, and then inputs it into the neural network of the YOLOv5 model for processing. It finally outputs a vector containing classification information and issues an alarm when an abnormal situation (not wearing a helmet) is detected.
[0039] The present invention adopts the YOLO (You Only Look Once) method in combination with a monitor to regulate and supervise the behavior of the staff in the power plant. The YOLO network is a neural network based on convolutional neural networks (CNN). The network has strong real-time performance and fast detection speed. It divides the entire image into grids for one-time target detection, avoiding the complex process of multiple convolutions, thereby achieving efficient target detection, and is suitable for applications that require real-time target detection. Compared with other currently popular detection systems, the method of the present invention can effectively improve the detection accuracy of safety equipment and construction personnel who are not wearing safety equipment; at the same time, it responds at the fastest speed, and can meet the detection requirements for the wearing of safety equipment in complex situations in power plants; effectively protects the safety of power plant staff, and promptly warns of violations; reduces the cost of manual inspections, reduces equipment maintenance costs; and ensures the normal production and operation of power plants. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The figure is a schematic diagram of the real-time video flow of the method of the present invention.
[0041] Figure 2 The overall framework diagram of the system of an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The specific implementation modes of the present invention are further described in detail below in conjunction with the embodiments.
[0043] The embodiment of the present invention provides 1. A method for detecting the wearing of safety equipment for power plant personnel based on YOLO v5, characterized in that it includes the following steps:
[0044] S1. Collect data sets of people wearing helmets and people not wearing helmets, label the data and divide them into training sets, validation sets and test sets:
[0045] A. Collecting Datasets
[0046] Use self-photographed data sets or public data sets as training sets for this model.
[0047] The self-photographed datasets are pictures and videos of real scenes taken in power plant environments using cameras or mobile phones;
[0048] This example uses the Pascal VOC public dataset as the dataset for this experiment. The dataset includes people wearing helmets and people not wearing helmets, including different angles of people (front, side, back), different distances (long shot, mid-shot, close shot), different scenes (indoor, outdoor, complex background), and different helmet colors (red, yellow, blue, etc.);
[0049] B. Label the data
[0050] Use labelimg to label the data, use a bounding box to circle the shape of the helmet, select the corresponding category (helmet or no-helmet), save the annotation, and save the image in the format of a txt file;
[0051] The format of this embodiment is: class_id x_center y_center width height,
[0052] class_id: target category ID, helmet=0, no_helmet=1.
[0053] x_center and y_center: The relative coordinates of the center point of the bounding box (normalized to the range [0,1]).
[0054] width and height: The width and height of the bounding box (normalized to the range [0,1]).
[0055] Then the images are cleaned, and the labeled images are cleaned and verified to check whether there are any wrong or missing labels, and blurry, too dark, and irrelevant images are eliminated;
[0056] C. Divide the training set, validation set, and test set
[0057] The labeled data is divided into a training set, a validation set, and a test set, with 80% for the training set, 10% for the validation set, and 10% for the test set, to ensure that each category is evenly distributed in different data sets; then save the labeled files and pictures. In this embodiment, the pictures and labeled files are saved in the following directory structure to facilitate YOLO v5 reading:
[0058]
[0059] S2. Train the YOLO v5 model
[0060] Determine the operating environment. YOLO v5 supports Python 3.7 and above, and then use Python code for training;
[0061] This embodiment uses the following code to implement the training of the data set:
[0062] python train.py --img 640 --batch 16 --epochs 50 --data data.yaml --weights yolov5s.pt --project helmet_detection --name yolov5_helmet
[0063] During the training process, YOLO v5 will display the training progress, including indicators such as loss function (Loss), precision (mAP), recall rate (Recall), etc. After the training is completed, these indicators will be saved in the folder;
[0064] YOLO v5 can use TensorBoard to monitor the training process. If you need to view the accuracy, loss, etc. during the training process, you can enable the TensorBoard program: tensorboard --logdir = runs / train / helmet_detection
[0065] After the training is completed, the trained YOLO v5 model is obtained.
[0066] YOLO v5 is a more advanced detection network based on CNN. It integrates the algorithms of YOLO v3 and YOLO v4 to achieve algorithm innovation.
[0067] The YOLO v5 architecture consists of a backbone (feature extraction network) and a head (detection head). Numbers 0-9 represent the backbone and 10-23 represent the head. The outputs of the 17th, 20th, and 23rd layers are connected to the input of the Detect module.
[0068] YOLO v5 has a detection speed of up to 140fps, which is a significant improvement over YOLO v4. The model size is only 27MB, while the YOLO v4 model size is 244MB, a reduction of nearly 90%. It has faster computing speed and lighter files, and can achieve real-time monitoring of safety equipment. However, v6, v7 and v8 have no significant improvements compared to v5. V5 is more suitable for detecting the wearing of safety equipment by workers in power plants.
[0069] The results of the YOLO v5 model are evaluated. In the field of object detection, the mean average precision (mAP) is used as an indicator to evaluate the performance and reliability of the training algorithm to evaluate the performance of the model's helmet wearing detection algorithm. The specific steps include:
[0070] A. Apply the above evaluation indicators to the performance test of the helmet detection algorithm
[0071] Two types of result images can be obtained, including construction workers wearing helmets and construction workers not wearing helmets. The accuracy is described by four indicators: true positive (TP), false positive (FP), true negative (TN) and false negative (FN). Specifically, TP is used to describe the accuracy of the image. hat To represent the number of people who are not wearing helmets within the monitoring range of the construction site, and the detection result is correct, that is, a true positive; FP hat TN represents the number of people who actually wear helmets but are detected as not wearing helmets, i.e., false positives; hat Indicates that the algorithm detects correctly, that is, a true counterexample; FN hat It represents the number of people who are not wearing helmets but are mistakenly detected, that is, false negative examples. The calculation formula is as follows:
[0072]
[0073] Among them, recall hat Recall, or true positive rate hat The sum of true positive examples and false negative examples (TP hat +FN hat ), the sum of true positive examples and false negative examples is the number of actual security devices; precision hat Represents accuracy, i.e., true positive TP hat The sum of true positives and false positives (TP hat +FP hat ), the sum of true positive cases and false positive cases is the number detected by the security device; AP hat Indicates the recognition accuracy of the security device;
[0074] B. Calculate the average precision
[0075] Average precision refers to the average of all precisions obtained under all possible recall values; AP50 is the AP value corresponding to the IOU (Intersection Over Union, IOU) threshold of 0.5; IOU refers to the overlap between the prior box and the marked box, and is also used to calculate the overlap between the predicted box and the true box to evaluate the performance of the target detection model; mean average precision (mAP) is the average of AP values under all categories. It is one of the most commonly used evaluation indicators in target detection models. It measures the detection accuracy of the model for all categories. The formula for calculating average precision is as follows:
[0076]
[0077] Among them: Q is the total number of categories, q is the qth category;
[0078] In order to verify the greater advantages of this method, the Pascal VOC dataset is used for training and compared with several existing popular detection systems. The experimental results are evaluated using the two evaluation indicators AP50 and mAP. The results are shown in Table 1:
[0079] Table 1 Results of various detection algorithms
[0080]
[0081] YOLOv5 has higher accuracy and shorter response time.
[0082] In this embodiment, the thresholds of AP50 (wearing safety equipment), AP50 (not wearing safety equipment), and mAP are set to 91%, 89%, and 90% respectively. If the thresholds are lower than these values, the performance of the detection system may not meet the strict requirements of the power plant for helmet wearing monitoring. This is because the lower mAP value means that the model may not be able to accurately identify all personnel who are not wearing helmets in actual applications, and there is a risk of missed detection or false detection, which poses a hidden danger to personnel safety and the execution of operating specifications. Therefore, in order to ensure that the helmet wearing detection system can provide stable and efficient monitoring services, it is necessary to keep the values of AP50 (wearing safety equipment), AP50 (not wearing safety equipment), and mAP above 90%. As shown in the table above, the average accuracy of Faster R-CNN, SSD, and YOLO v3 are all below 90%, and after training, the values of AP50 (wearing safety equipment), AP50 (not wearing safety equipment), and mAP in this embodiment can reach 93.2%, 91.8%, and 92.6%, which meet the requirements of the detection system and complete the construction of the model. Only at this level of accuracy can the system demonstrate sufficient reliability and robustness in a complex working environment, detect violations in a timely manner, and ensure the safety of power plant operations.
[0083] S3. Real-time detection and early warning
[0084] Model deployment is to apply the trained model to the actual production environment for inference in real-time or batch processing. The YOLOv5 model can be deployed on multiple platforms, including local computers, cloud servers, embedded devices, etc. The system requires the user to input the source to be detected and the weight file obtained. There are two ways to detect the wearing of helmets: local media file detection and real-time camera detection;
[0085] When testing local media files, users can input pictures or videos into the model for testing. The system will display the testing process in real time and output the testing information. When testing local files, users can select pictures or video files in the storage folder for testing in the file management software. At the same time, the system also supports saving the test results for users to view later.
[0086] During real-time video detection, the power plant site is tested in real time. The user needs to click the corresponding function button to open the monitoring window to detect in real time whether the staff are wearing safety equipment. The accuracy of inference is affected by the training parameters and data set. After the user logs in to the system, he can select the detection method and enter the required information to detect the wearing of safety equipment;
[0087] The system reads the video to be detected frame by frame, converts each frame into a matrix format, and then inputs it into the neural network of the YOLOv5 model for processing, and finally outputs a vector containing classification information;
[0088] During real-time video detection, the video is framed. The camera inside the power plant can be used to obtain the video stream in real time, and OpenCV is used to frame the video. Each frame of the image after framing is sent to the detection module for processing. Figure 1 As shown:
[0089] This embodiment uses OpenCV for real-time video processing. OpenCV is a powerful computer vision library that supports real-time video processing. In OpenCV, you can use cv2.VideoCapture() to capture video streams, process each frame, and perform real-time analysis. OpenCV also provides some functions to get and set the properties of the video stream, such as the frame rate (FPS) and resolution of the video. You can use the following code to get basic information:
[0090] frame_rate = cap.get(cv2.CAP_PROP_FPS) #frame rate
[0091] frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) #Total number of frames
[0092] print(f"Frame rate:{frame_rate},Total frames:{frame_count}")
[0093] Then save the video file. This embodiment uses the cv2.imshow() function. Using cv2.imshow(), each frame can be displayed in a window. You can also save the video stream to a file to generate a video file. After obtaining the basic information, process and save each frame of the saved image. The following code is implemented:
[0094]
[0095] When an abnormal situation is detected (not wearing a helmet), an alarm is sent by sending an email. The smtplib module of python can be used to send emails, and the target is highlighted on the video screen through OpenCV; the overall framework of the system of the embodiment of the present invention is shown in the figure Figure 2 shown.
Claims
1. A method for detecting the wearing of safety equipment by power plant personnel based on YOLO v5, characterized in that: The following steps are involved: S1. Collect data sets of people wearing helmets and people not wearing helmets, label the data and divide them into training sets, validation sets and test sets: A. Collecting Datasets Self-photographed datasets or public datasets are used as training sets for this model. The datasets include people wearing helmets and people not wearing helmets, including different angles, different distances, different scenes, and different helmet colors. B. Label the data Use labelimg to label the data, use the bounding box to circle the shape of the helmet, select the corresponding category, save the annotation, and save the image in the format of a txt file; C. Divide the training set, validation set, and test set The labeled data is divided into training set, validation set and test set, with 80% for training set, 10% for validation set and 10% for test set; S2. Train the YOLO v5 model Use Python code for training. After the training is completed, the trained YOLO v5 model is obtained and the model results are evaluated. In the field of target detection, the average precision is used as an indicator to evaluate the performance and reliability of the training algorithm to evaluate the performance of the model's helmet wearing detection algorithm. The specific steps include: A. Apply the above evaluation indicators to the performance test of the helmet detection algorithm Two types of result images can be obtained, including construction workers wearing helmets and construction workers not wearing helmets. The accuracy is described by four indicators: true positive examples, false positive examples, true negative examples, and false negative examples. Specifically, TP hat To represent the number of people who are not wearing helmets within the monitoring range of the construction site, and the detection result is correct, that is, a true positive; FP hat TN represents the number of people who actually wear helmets but are detected as not wearing helmets, i.e., false positives; hat Indicates that the algorithm detects correctly, that is, a true counterexample; FN hat It represents the number of people who are not wearing helmets but are mistakenly detected, that is, false negative examples. The calculation formula is as follows: Among them, AP hat Indicates the recognition accuracy of the security device; B. Calculate the average precision The average precision calculation formula is as follows: Among them: Q is the total number of categories, q is the qth category; When the average accuracy reaches above 90%, the detection requirements can be met and the model construction is completed; S3. Real-time detection and early warning There are two ways to detect whether a person is wearing a helmet: local media file detection and camera real-time detection; The system reads the video to be detected frame by frame, converts each frame into a matrix format, and then inputs it into the neural network of the YOLO v5 model for processing. Finally, it outputs a vector containing classification information. When an abnormal situation is detected, an alarm is issued.
Citation Information
Cited By
Fire fighting helmet chin strap standard wearing detection method and device
CN120599553A