A yolobased unsafe behavior intelligent identification method
By using a YOLO-based intelligent identification method for unsafe behaviors, combined with a decision tree model, the level of unsafe behaviors of personnel in production operation scenarios can be quickly and accurately identified. This solves the problems of high manpower consumption and low accuracy of manual monitoring, and achieves efficient identification of unsafe behaviors.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INST OF COMP TECH & APPL
- Filing Date
- 2022-10-26
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, manually monitoring personnel behavior in production operation scenarios consumes a lot of manpower, and the accuracy and speed of identifying unsafe behaviors are insufficient.
An intelligent identification method for unsafe behavior based on YOLO is adopted, combined with a decision tree hazard area discrimination model. YOLOv7 is used to detect the position and wearing status of personnel, high and low lens algorithms are used to determine the lens type, and a hazard area decision tree model is used to determine whether personnel are in a hazard area. Finally, the integrated results are output as a behavior level.
It achieves rapid and accurate identification of unsafe behavior levels in production operation scenarios, with an inference speed of 71fps and an identification accuracy of 99.38%.
Smart Images

Figure CN115620340B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition, specifically relating to an intelligent recognition method for unsafe behaviors based on YOLO. Background Technology
[0002] Safety in production has always been a guiding principle consistently upheld by the state in production and construction, and it is a crucial policy in my country. Safety in production is of great significance to individuals, enterprises, and the nation. In scientific research and production, there are often production operation scenarios with a certain degree of risk. These scenarios have specific requirements for personnel safety protection measures, and when production workers do not follow these requirements, there is a high risk factor. On-site video surveillance equipment can monitor on-site workers. However, manually monitoring personnel behavior in production operation scenarios consumes a significant amount of manpower. With the development of image recognition technology, using object detection algorithms to detect video surveillance images in real time can greatly reduce manpower costs. Intelligent identification technology for unsafe behaviors has high requirements for accuracy and operating speed. The unsafe behavior intelligent identification algorithm proposed in this invention is based on a single-stage YOLO object detection algorithm combined with a decision tree hazard area discrimination model, which can quickly and accurately determine the level of unsafe behavior of personnel in production operation scenarios. Summary of the Invention
[0003] (a) Technical problems to be solved
[0004] The technical problem this invention aims to solve is how to provide a YOLO-based intelligent identification method for unsafe behaviors, in order to address the issue of high manpower costs associated with manually monitoring personnel behavior in production operation scenarios.
[0005] (II) Technical Solution
[0006] To address the aforementioned technical problems, this invention proposes a YOLO-based intelligent identification method for unsafe behaviors, which includes the following steps:
[0007] S1. For the input scene image, use YOLOv7 to perform object detection on the image and output the location information of people in the scene, whether they are wearing safety helmets, and whether they are wearing work clothes.
[0008] S2. Use the high / low shot algorithm to determine whether the input scene image belongs to a high shot or a low shot.
[0009] S3. Select the corresponding danger zone discrimination decision tree model based on the input scene image;
[0010] S4. Input the personnel area location obtained from YOLOv7 in step S1 and the high / low camera parameters obtained in step S2 into the danger zone discrimination decision tree model. The data format of the input decision tree model is [xmin, ymin, xmax, ymax, camera_position], where (xmin, ymax) are the coordinates of the lower left corner of the human body area box, (xmax, ymin) are the coordinates of the upper right corner of the human body area box, and camera_position is the high / low camera parameter obtained in step S2, which takes a value of 0 or 1, where 0 represents a low-angle scene and 1 represents a high / low angle scene. The decision tree model determines whether the human body corresponding to the data is in a danger zone based on the five input parameters, and the output is either safe_area or dangerous_area. safe_area indicates that the human body is in a safe zone, and dangerous_area indicates that the human body is in a danger zone.
[0011] S5. Integrate the results of personnel location, whether they are wearing work clothes, whether they are wearing safety helmets, and whether they are in dangerous areas output in steps S1 and S4, and output the level of unsafe behavior of personnel in the scene according to the requirements of the label.
[0012] Furthermore, this method is applied to hoisting operations, equipment operation, and assembly scenarios. Regulations are set for whether personnel should wear work clothes, safety helmets, and enter hazardous areas in different scenarios, and different hazard levels are defined.
[0013] Further, step S2 specifically includes: cropping the input scene image and the scene image pre-reserved in the algorithm that can identify high and low angle shots using a high / low angle shot algorithm; then using a Gamma correction algorithm to remove the influence of lighting; and finally using the Imagehash function to calculate the hash value of the input scene image after Gamma correction. The hash value of the high and low angle images reserved in the algorithm is and The similarity of hash values is calculated, and the similarity is used to determine whether the input scene image belongs to a high shot or a low shot.
[0014] Furthermore, the process of calculating the similarity of hash values is as follows:
[0015]
[0016]
[0017]
[0018] .
[0019] Furthermore, in step S3, each fixed scenario corresponds to a hazard area discrimination decision tree model. Different scenarios correspond to different hazard area discrimination decision tree models. The corresponding hazard area decision tree model is loaded according to the scenario number.
[0020] Furthermore, in step S4, the decision tree model judges the input data according to its internal discrimination rules to obtain information on whether the personnel in the scene are in a dangerous area.
[0021] Furthermore, in step S5, the safety level corresponding to wearing a safety helmet and work clothes is safe; the safety level corresponding to not wearing a safety helmet and work clothes is danger I; the safety level corresponding to wearing a safety helmet and not wearing work clothes is danger I; and the safety level corresponding to not wearing a safety helmet and not wearing work clothes is danger II.
[0022] Furthermore, the YOLOv7 model is used to identify whether personnel are wearing work clothes and safety helmets, and the dataset labels are set as follows:
[0023] helmet, smock: 0
[0024] no_helmet, smock: 1
[0025] helmet, no_smock: 2
[0026] no_helmet, no_smock:3
[0027] The pre-trained YOLOv7 model was used to perform 300 rounds of transfer training on the training set to obtain the trained YOLOv7 model.
[0028] Furthermore, the trained YOLOv7 model was tested on the test set using an RTX 3090 graphics card.
[0029] Furthermore, the dangerous area discrimination decision tree model is trained using a dataset with dangerous area scenes. The decision tree model adopts the decision tree classifier in the tree package of the machine learning toolkit scikit-learn, and uses the CART algorithm with Gini coefficient. The input of the decision tree model is [xmin, ymin, xmax, ymax, camera_position], and the output is [safe_area, dangerous_area].
[0030] (III) Beneficial Effects
[0031] This invention proposes an intelligent identification method for unsafe behaviors based on YOLO. Compared with existing technologies, the algorithm proposed in this invention can quickly and accurately identify the level of unsafe behaviors in video surveillance scenes, achieving an inference speed of 71fps and an accuracy of 99.38% mAP on the test set. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the unsafe behavior intelligent recognition method based on YOLO of the present invention;
[0033] Figure 2 This is a schematic diagram of the high / low lens judgment algorithm of the present invention;
[0034] Figure 3 This is a schematic diagram of the hazardous area discrimination decision tree model of the present invention;
[0035] Figure 4 This diagram illustrates the methods for determining the level of unsafe behavior in different scenarios. Detailed Implementation
[0036] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0037] The purpose of this invention is to provide a method for quickly and accurately identifying the level of unsafe behavior by personnel.
[0038] The YOLO-based intelligent unsafe behavior recognition method identifies scenarios including hoisting operations, equipment operation, assembly and other hazardous areas, and production line scenarios. Different scenarios specify whether personnel are wearing work clothes, safety helmets, or have entered hazardous areas, and define different hazard levels. The YOLO-based intelligent unsafe behavior recognition method identifies personnel in the scenario, provides their location coordinates, and assigns an unsafe behavior level based on whether the personnel are wearing work clothes, safety helmets, or have entered hazardous areas. Figure 4 As shown. The flowchart of the unsafe behavior intelligent recognition algorithm proposed in this invention is as follows. Figure 1 As shown.
[0039] The present invention provides a YOLO-based intelligent identification method for unsafe behaviors, comprising the following steps:
[0040] S1. For the input scene image, use YOLOv7 to perform object detection on the image and output the location information of people in the scene, whether they are wearing safety helmets, and whether they are wearing work clothes.
[0041] S2. Use a high / low shot algorithm to determine whether the input scene image is a high shot or a low shot: The high / low shot algorithm is used to crop the input scene image and pre-reserved scene images that can identify high / low shots. Then, a Gamma correction algorithm is used to remove the influence of lighting. Finally, the Imagehash function is used to calculate the hash value of the input scene image after Gamma correction. The hash value of the high and low angle images reserved in the algorithm is and Then, the similarity of the hash values is calculated using the following formula. Based on the similarity level, it is determined whether the input scene image belongs to a high shot or a low shot. The high / low shot algorithm process is as follows: Figure 2 As shown.
[0042]
[0043]
[0044]
[0045]
[0046] S3. Select the corresponding hazard area discrimination decision tree model based on the input scene image. Each fixed scene corresponds to one hazard area discrimination decision tree model. Different scenes correspond to different hazard area discrimination decision tree models. Load the corresponding hazard area decision tree model according to the scene number.
[0047] S4. Input the personnel area location obtained from YOLOv7 in step S1 and the high / low camera parameters obtained in step S2 into the danger zone discrimination decision tree model. The data format input to the decision tree model is [xmin, ymin, xmax, ymax, camera_position], where (xmin, ymax) are the coordinates of the lower left corner of the human body area bounding box, (xmax, ymin) are the coordinates of the upper right corner of the human body area bounding box, and camera_position is the high / low camera parameter obtained in step S2, with a value of 0 or 1, where 0 represents a low-angle scene and 1 represents a high / low angle scene. The decision tree model determines whether the corresponding human body is in a danger zone based on the five input parameters, and outputs either safe_area or dangerous_area. safe_area indicates that the human body is in a safe area, and dangerous_area indicates that the human body is in a danger zone. The decision tree model judges the input data according to its internal discrimination rules to obtain information on whether the personnel in the scene are in a danger zone. The internal discrimination rules of the decision tree model are as follows: Figure 3 As shown.
[0048] S5. Integrate the results output in steps S1 and S4, such as personnel location, whether they are wearing work clothes, whether they are wearing safety helmets, and whether they are in dangerous areas, and output the level of unsafe behavior of personnel in the scene according to the requirements of the label.
[0049] like Figure 4 As shown, wearing a safety helmet and work clothes corresponds to a safe safety level; not wearing a safety helmet and work clothes corresponds to a danger level I; wearing a safety helmet but not wearing work clothes corresponds to a danger level I; and not wearing a safety helmet and not wearing work clothes corresponds to a danger level II.
[0050] The above describes the execution process of the unsafe behavior intelligent recognition algorithm. The steps described above utilize the YOLOv7 algorithm model and the hazardous area decision tree discrimination model, both of which need to be trained in advance using data from the training set.
[0051] The YOLOv7 model is used to identify whether people are wearing work clothes and safety helmets. The dataset labels are set as follows:
[0052] helmet (safety helmet), smock (work clothes): 0
[0053] no_helmet, smock: 1
[0054] helmet, no_smock: 2
[0055] no_helmet, no_smock:3
[0056] The pre-trained YOLOv7 model was used for 300 epochs of transfer training on the training set to obtain the trained YOLOv7 model. Using an RTX 3090 graphics card, a mAP value of 99.8% was achieved on the test set. mAP, or average accuracy across all classes, is a commonly used metric for measuring model accuracy in the field of object detection.
[0057] The hazardous area discrimination decision tree model is trained using a dataset containing hazardous area scenes. Decision tree modeling is a non-parametric supervised learning method. This invention employs the decision tree classifier from the `tree` package of the machine learning toolkit scikit-learn, using the CART algorithm with the Gini coefficient. The input to the decision tree model is [xmin, ymin, xmax, ymax, camera_position], and the output is [safe_area, dangerous_area]. The resulting hazardous area decision tree model is as follows: Figure 3 As shown, the decision tree model for identifying dangerous areas can achieve an accuracy of 99% on the test set.
[0058] The above describes the implementation of the unsafe behavior intelligent recognition algorithm proposed in this invention. The technical route of the unsafe behavior intelligent recognition algorithm and the algorithm execution steps are within the scope of protection of this invention.
[0059] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for intelligent identification of unsafe behaviors based on YOLO, characterized in that, The method includes the following steps: S1. For the input scene image, use YOLOv7 to perform object detection on the image and output the location information of people in the scene, whether they are wearing safety helmets, and whether they are wearing work clothes. S2. Use the high / low shot algorithm to determine whether the input scene image belongs to a high shot or a low shot. S3. Select the corresponding danger zone discrimination decision tree model based on the input scene image; S4. Input the personnel area location obtained from YOLOv7 in step S1 and the high / low camera parameters obtained in step S2 into the danger zone discrimination decision tree model. The data format of the input decision tree model is [xmin, ymin, xmax, ymax, camera_position], where (xmin, ymax) are the coordinates of the lower left corner of the human body area box, (xmax, ymin) are the coordinates of the upper right corner of the human body area box, and camera_position is the high / low camera parameter obtained in step S2, which takes a value of 0 or 1, where 0 represents a low-angle scene and 1 represents a high-angle scene. The decision tree model determines whether the human body corresponding to the data is in a danger zone based on the five input parameters, and the output is either safe_area or dangerous_area. safe_area indicates that the human body is in a safe zone, and dangerous_area indicates that the human body is in a danger zone. S5. Integrate the results from S1 and S4 regarding personnel location, whether they are wearing work clothes, whether they are wearing safety helmets, and whether they are in dangerous areas, and output the level of unsafe behavior of personnel in the scene according to the label requirements. in, S2 specifically includes: cropping the input scene image and the scene image pre-reserved in the algorithm that can identify high and low angle shots using a high / low angle shot algorithm; then using a Gamma correction algorithm to remove the influence of lighting; and finally using the Imagehash function to calculate the hash value of the input scene image after Gamma correction. The hash value of the high and low angle images reserved in the algorithm is and The similarity of hash values is calculated, and the similarity is used to determine whether the input scene image belongs to a high shot or a low shot.
2. The YOLO-based intelligent recognition method for unsafe behavior as described in claim 1, characterized in that, This method is applied to hoisting operations, equipment operation, and assembly scenarios. It specifies whether personnel should wear work clothes, safety helmets, and enter hazardous areas in different scenarios, and defines different levels of danger.
3. The unsafe behavior intelligent recognition method based on YOLO as described in claim 1, characterized in that, The process of calculating the similarity of hash values is as follows: 。 4. The YOLO-based intelligent recognition method for unsafe behavior as described in claim 1, characterized in that, In S3, each fixed scenario corresponds to a dangerous area discrimination decision tree model. Different scenarios correspond to different dangerous area discrimination decision tree models. The corresponding dangerous area decision tree model is loaded according to the scenario number.
5. The YOLO-based intelligent recognition method for unsafe behavior as described in claim 1, characterized in that, In step S4, the decision tree model judges the input data according to its internal discrimination rules to obtain information on whether people in the scene are in a dangerous area.
6. The YOLO-based intelligent recognition method for unsafe behavior as described in claim 1, characterized in that, In S5, the safety level corresponding to wearing a safety helmet and work clothes is safe; the safety level corresponding to not wearing a safety helmet and work clothes is danger I; the safety level corresponding to wearing a safety helmet but not wearing work clothes is danger I; and the safety level corresponding to not wearing a safety helmet and not wearing work clothes is danger II.
7. The YOLO-based intelligent recognition method for unsafe behavior as described in any one of claims 1-6, characterized in that, The YOLOv7 model is used to identify whether people are wearing work clothes and safety helmets, and the dataset labels are set as follows: helmet, smock: 0 no_helmet, smock: 1 helmet, no_smock: 2 no_helmet, no_smock:3 The pre-trained YOLOv7 model was used to perform 300 rounds of transfer training on the training set to obtain the trained YOLOv7 model.
8. The YOLO-based intelligent recognition method for unsafe behavior as described in claim 7, characterized in that, The trained YOLOv7 model was tested on the test set using an RTX 3090 graphics card.
9. The method for intelligent identification of unsafe behaviors based on YOLO as described in any one of claims 1-6, characterized in that, The dangerous area discrimination decision tree model is trained using a dataset with dangerous area scenes. The decision tree model uses the decision tree classifier in the tree package of the machine learning toolkit scikit-learn and uses the CART algorithm with Gini coefficient. The input of the decision tree model is [xmin, ymin, xmax, ymax, camera_position], and the output is [safe_area, dangerous_area].