Method and device for identifying safety clothing for electric power workers
By using the lightweight network MobileNet and the optimized SSD target detection algorithm at the power work site to detect the safety helmets and work clothes of power workers, it solves the detection difficulties and heavy calculation problems in the existing technology, and realizes the detection of edge terminal equipment in edge terminal equipment. Real-time high-precision safety attire recognition on the Internet.
Patent Information
- Application Number
- CN202010296917.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-04-15
AI Technical Summary
Existing technology is difficult to effectively detect whether workers are wearing safety helmets and work clothes correctly at electric power work sites. Moreover, traditional target detection algorithms are computationally intensive and cannot be run in real time on edge terminal devices, making them unable to meet the hardware requirements of electric power work sites.
The lightweight network MobileNet combined with the optimized SSD target detection algorithm is used to detect the head and body of the clothing images of power workers. Through the helmet classification and recognition module and the workwear classification and recognition module, the calculation amount is reduced and the recognition accuracy is improved.
Real-time detection of safety attire of electric power workers on edge terminal equipment is achieved, reducing the amount of calculations, improving the accuracy of identification of safety helmets and work clothes, and meeting the real-time and accuracy requirements of electric power work sites.
Smart Images

Figure CN113536842B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a method and device for identifying safety clothing for electric power workers. Background Art
[0002] In the daily operation and construction of the power industry, for the safety of the operators, there are strict requirements on the clothing of the operators entering the work site. Operators must wear safety helmets and work clothes correctly before entering the construction site. Due to the particularity of the industry, safety clothing can protect the personal safety of operators, and video monitoring of operators entering the work site can play a supervisory role, thereby reducing the safety risks of operators.
[0003] In recent years, with the continuous development of artificial intelligence and computer vision, automatic detection and recognition methods for safety clothing based on video surveillance have been continuously proposed, reducing the workload of manual video surveillance. However, most of the solutions that have emerged are aimed at detecting whether a helmet is worn, and there are few detection solutions for whether work clothes are worn and whether work clothes are worn correctly.
[0004] There are many power operation sites and they are widely distributed. The hardware equipment for video intelligent analysis needs to be small in size, low in cost, and high in real time, while still ensuring accuracy. Most existing technical solutions are based on target detection algorithms such as Faster R-CNN and YOLO, which cannot detect safety helmets. Such solutions have single functions, and the algorithms have high hardware requirements due to the large amount of calculation, so they cannot be applied to edge terminal mobile devices. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for identifying safety clothing for electric power workers, which overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present invention provides a method for identifying safety clothing for electric power workers, comprising:
[0007] Collect images of power workers' clothing;
[0008] Input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the worker and classify and recognize the helmet and work clothes, and obtain the helmet recognition result and the work clothes recognition result;
[0009] Among them, the clothing recognition model is pre-trained using the clothing images of power workers as samples and the conditions of people wearing safety helmets and work clothes in the clothing images of power workers as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification and recognition module, and a work clothes classification and recognition module.
[0010] Furthermore, the step of inputting the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the helmet and work clothes, and obtaining the helmet recognition result and the work clothes recognition result specifically includes:
[0011] Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing;
[0012] Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person;
[0013] The basic features corresponding to the predicted target box with the person's head inside are input into the safety helmet classification and recognition module to obtain the safety helmet recognition result, the basic features corresponding to the predicted target box with the person's body inside are used as shallow features, the shallow features are input into multiple convolutional layers to obtain deep features, the shallow features and the deep features are spliced and input into the work clothes classification and recognition module to obtain the work clothes recognition result.
[0014] Furthermore, the step of training and obtaining the clothing recognition model specifically includes:
[0015] Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set;
[0016] The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained;
[0017] The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning;
[0018] The clothing recognition model that has been initially trained is iteratively optimized using the optimized sample set until the test accuracy of the clothing recognition model meets the preset requirements.
[0019] Furthermore, the clothing recognition model is trained using the training sample set, specifically including:
[0020] Inputting the clothing images in the training sample set into the MobileNet network to obtain basic features corresponding to the clothing images;
[0021] Input the basic features into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains a person's head or a person's body based on the predicted target frame position and size;
[0022] For a predicted target frame with a person's head inside, inputting basic features corresponding to the predicted target frame with a person's head inside into the helmet classification and recognition module to obtain a helmet recognition result;
[0023] For a predicted target frame with a human body inside, the basic features corresponding to the predicted target frame with a human body inside are used as shallow features, the shallow features are input into multiple convolutional layers for deeper feature extraction to obtain deep features, the shallow features are spliced with the deep features and then input into the tooling classification and recognition module to obtain a tooling recognition result;
[0024] Based on the label of the person wearing a helmet corresponding to the clothing image and the result of the helmet recognition, the helmet recognition loss is calculated; based on the label of the person wearing work clothes corresponding to the clothing image and the result of the work clothes recognition, the work clothes recognition loss is calculated;
[0025] By means of a back propagation algorithm, various parameters of the clothing recognition model are adjusted so as to move the loss in a direction of minimization;
[0026] It is determined whether the training end condition is met. If so, the parameters of the clothing recognition model of the current iteration are saved to obtain a clothing recognition model that has been initially trained.
[0027] Furthermore, for unlabeled clothing images, automatic labeling is performed by utilizing the prediction results of the clothing recognition model that has been preliminarily trained and combining the threshold comparison and non-maximum suppression calculation results, specifically including:
[0028] Inputting the unlabeled clothing image into the clothing recognition model that has been preliminarily trained to obtain a number of prediction results, each of which includes a position of a predicted target frame, a category to which the predicted target frame belongs, and a score of the predicted target frame;
[0029] Compare the scores of all predicted target boxes with the set score threshold. If the score of a predicted target box is higher than the score threshold, use the position, size and category information corresponding to the predicted target box as the annotation information; or
[0030] A set is constructed using all prediction results whose scores of the predicted target boxes are lower than the score threshold. If there are N predicted target boxes in the set belonging to the same area, and N is less than the set target box number threshold, the prediction result is discarded. Alternatively, if N is greater than the set target box number threshold, the category to which most of the N predicted target boxes belong is taken, recorded as the category to which the M boxes belong, as the category attribute of the unlabeled clothing image, and the position and size information of the M boxes are used to find the optimal predicted target box position and size as the labeling information by adopting the non-maximum suppression (NMS) calculation method.
[0031] In a second aspect, an embodiment of the present invention provides a device for identifying safety clothing for electric power workers, comprising:
[0032] An image acquisition module is used to collect images of clothing worn by power workers;
[0033] The recognition module is used to input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the safety helmet and work clothes, and obtain the safety helmet recognition result and the work clothes recognition result;
[0034] Among them, the clothing recognition model is pre-trained using the clothing images of power workers as samples and the conditions of people wearing safety helmets and work clothes in the clothing images of power workers as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification and recognition module, and a work clothes classification and recognition module.
[0035] Furthermore, the identification module is specifically used for:
[0036] Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing;
[0037] Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person;
[0038] The basic features corresponding to the predicted target box with the person's head inside are input into the safety helmet classification and recognition module to obtain the safety helmet recognition result, the basic features corresponding to the predicted target box with the person's body inside are used as shallow features, the shallow features are input into multiple convolutional layers to obtain deep features, the shallow features and the deep features are spliced and input into the work clothes classification and recognition module to obtain the work clothes recognition result.
[0039] Furthermore, it also includes: a training module, used for training to obtain the clothing recognition model;
[0040] Wherein, the training module is specifically used for:
[0041] Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set;
[0042] The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained;
[0043] The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning;
[0044] The clothing recognition model that has been initially trained is iteratively optimized using the optimized sample set until the test accuracy of the clothing recognition model meets the preset requirements.
[0045] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for identifying safety clothing for electric power workers provided in the first aspect are implemented.
[0046] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for identifying safety clothing for power workers as provided in the first aspect.
[0047] The method and device for identifying safety clothing for power workers provided in the embodiments of the present invention adopt a lightweight network MobileNet as the basic feature extraction network, combined with an optimized SSD target detection algorithm, to make a preliminary judgment on the head and body parts of the personnel, and then apply network features at different levels and splicing features at different scales to different classification and recognition tasks, thereby reducing the amount of calculation and improving the classification and recognition performance of safety clothing. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A schematic diagram of a flow chart of a method for identifying safety clothing for electric power workers provided in an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the structure of a clothing recognition model provided by an embodiment of the present invention;
[0051] Figure 3 A schematic diagram of a process for inputting the clothing image of the power worker into a preset clothing recognition model to obtain a helmet recognition result and a work clothes recognition result provided by an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of a flow chart of training and obtaining the clothing recognition model provided in an embodiment of the invention;
[0053] Figure 5 A schematic diagram of the automatic labeling process provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of the structure of a device for identifying safety clothing for electric power workers provided in an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] The main goal of the embodiment of the present invention is to achieve real-time detection of the safety clothing status of workers in power operation sites through real-time analysis of monitoring videos, taking into account the requirements of efficiency and accuracy in edge terminal mobile devices.
[0058] like Figure 1 As shown, it is a flow chart of a method for identifying safety clothing for electric power workers provided by an embodiment of the present invention, including:
[0059] Step 100: Collecting images of electric power workers wearing clothing;
[0060] Step 101: input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the worker and classify and recognize the helmet and work clothes, and obtain the helmet recognition result and the work clothes recognition result;
[0061] Among them, the clothing recognition model is pre-trained using the clothing images of power workers as samples and the conditions of people wearing safety helmets and work clothes in the clothing images of power workers as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification and recognition module, and a work clothes classification and recognition module.
[0062] Specifically, an embodiment of the present invention proposes a method for identifying safety clothing for power workers based on SSD target detection. First, the head and body of the person in the power worker's clothing image are detected to obtain detection results, including the predicted target frame position and size. Since there are obvious differences in the size, shape, and relative position of the head and body of the same person in the same image, the target category can be preliminarily determined based on the predicted target frame position and size, that is, the target is determined to be the person's head or body.
[0063] Then, based on the detection results, the helmet classification and identification tasks and the work clothes classification and identification tasks are performed, including: if the predicted target frame is a human head, the helmet classification and identification task is performed; if the target frame is a human body part, the work clothes classification and identification task is performed. Among them, the helmet classification task is relatively simple, including: people wearing helmets of different colors or people not wearing helmets; the work clothes classification and identification task is relatively complex, and the detailed features of the target need to be fully extracted, including: people not wearing work clothes, people wearing work clothes correctly, people wearing work clothes but one sleeve / trouser leg is rolled up, etc.
[0064] The original SSD target detection algorithm uses the computationally expensive VGG16 as the basic feature extraction network, and uses 6 feature maps of different scales to perform target detection, which has a poor effect on small target detection. The embodiment of the present invention uses a lightweight network MobileNet as the basic feature extraction network, combined with an optimized SSD target detection algorithm, to splice and fuse the shallow features of the network containing detail information with the deep features containing more semantic features, thereby reducing the model's computational complexity and improving the accuracy of small target detection and the classification and recognition accuracy of detail information such as workwear sleeves and trouser length. Figure 2 As shown, it is a schematic diagram of the structure of the clothing recognition model provided by an embodiment of the present invention. The clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification and recognition module, and a work clothes classification and recognition module. Among them, the MobileNet network is used to extract basic features of the input power worker clothing image to obtain a basic feature vector, the SSD target detection module is used to perform target detection based on the basic feature vector to obtain the position and size of the predicted target box, the safety helmet classification and recognition module is used to perform safety helmet classification and recognition, and the work clothes classification and recognition module is used to perform work clothes classification and recognition.
[0065] The method for identifying safety clothing for power workers provided in an embodiment of the present invention adopts a lightweight network MobileNet as a basic feature extraction network, combined with an optimized SSD target detection algorithm, to make a preliminary judgment on the head and body parts of the personnel, and then applies network features at different levels and splicing features at different scales to different classification and recognition tasks, thereby reducing the amount of calculation and improving the classification and recognition performance of safety clothing.
[0066] Based on the content of the above embodiment, the step of inputting the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the helmet and work clothes, and obtaining the helmet recognition result and the work clothes recognition result specifically includes:
[0067] Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing;
[0068] Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person;
[0069] The basic features corresponding to the predicted target box with the person's head inside are input into the safety helmet classification and recognition module to obtain the safety helmet recognition result, the basic features corresponding to the predicted target box with the person's body inside are used as shallow features, the shallow features are input into multiple convolutional layers to obtain deep features, the shallow features and the deep features are spliced and input into the work clothes classification and recognition module to obtain the work clothes recognition result.
[0070] Specifically, Figure 3 As shown, it is a flowchart of inputting the clothing image of the power worker into a preset clothing recognition model to obtain the helmet recognition result and the work clothes recognition result provided by an embodiment of the present invention.
[0071] First, the MobileNet network is used to extract basic features of the image of the power worker's clothing. Then, the basic features corresponding to the image of the power worker's clothing are input into the SSD target detection module to obtain the predicted target frame position and size, and based on the predicted target frame position and size, it is determined that the predicted target frame contains the head or body of the person.
[0072] If it is determined that the predicted target box contains a person's head, the basic features corresponding to the predicted target box containing the person's head are directly input into the helmet classification and recognition module to determine whether the person is wearing a helmet.
[0073] If it is determined that the predicted target box contains a person's body, the basic features corresponding to the predicted target box with the person's body inside are used as shallow features, and the shallow features are input into 3 to 5 convolutional layers for deeper feature extraction to obtain multiple deep features. The shallow features are concatenated with all the deep features and then input into the work clothes classification and recognition module to make full use of feature information of different scales and improve the accuracy of work clothes classification and recognition.
[0074] Based on the content of the above embodiment, the step of training to obtain the clothing recognition model specifically includes:
[0075] Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set;
[0076] The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained;
[0077] The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning;
[0078] The clothing recognition model that has been initially trained is iteratively optimized using the optimized sample set until the test accuracy of the clothing recognition model meets the preset requirements.
[0079] Specifically, Figure 4 A schematic diagram of a process for training and obtaining the clothing recognition model provided in an embodiment of the present invention.
[0080] The instantiation of the present invention requires first collecting images of different people in different clothing, which can be specifically done in the following way: intercepting and saving every N frames in the surveillance video of different power operation sites as images; having different personnel wear power operation clothes and safety helmets, simulating the correct and incorrect dressing methods of the operators at work to record videos, and also intercepting and saving every N frames in the surveillance video as images.
[0081] The incorrect dressing methods include: not wearing a helmet, not wearing work clothes, wearing work clothes but rolling up any sleeve, wearing work clothes but rolling up any trouser legs, wearing work clothes but not buttoning the work clothes and exposing the inner clothes or skin, etc. The correct dressing method is to wear a helmet and wear the work clothes and trousers completely.
[0082] Based on the above-mentioned saved images, the situations of people wearing helmets, work clothes, etc. in each image are marked with corresponding labels, a sample set is constructed, and the sample set is divided into a training sample set and a test sample set.
[0083] Build as Figure 2 The clothing recognition model shown is trained using the training sample set, and after the training, a clothing recognition model that has been preliminarily trained is obtained. Then, the clothing recognition model that has been preliminarily trained is tested using the test sample set to determine whether the clothing recognition model that has been preliminarily trained meets the accuracy requirement.
[0084] If the test accuracy meets the preset requirements, the final trained clothing recognition model is obtained. The final trained clothing recognition model can be directly applied to the work site to detect the clothing of the workers.
[0085] If the test accuracy does not meet the preset requirements, further clothing images are collected, and for unlabeled clothing images, the prediction results of the clothing recognition model completed by the preliminary training are used, combined with the threshold comparison and non-maximum suppression calculation results, to automatically label them, and the sample set is optimized by combining automatic labeling with manual fine-tuning;
[0086] The clothing recognition model that has been initially trained is iteratively optimized using the optimized sample set until the test accuracy of the clothing recognition model meets the preset requirements.
[0087] Based on the content of the above embodiment, the clothing recognition model is trained using the training sample set, specifically including:
[0088] Inputting the clothing images in the training sample set into the MobileNet network to obtain basic features corresponding to the clothing images;
[0089] Input the basic features into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains a person's head or a person's body based on the predicted target frame position and size;
[0090] For a predicted target frame with a person's head inside, inputting basic features corresponding to the predicted target frame with a person's head inside into the helmet classification and recognition module to obtain a helmet recognition result;
[0091] For a predicted target frame with a human body inside, the basic features corresponding to the predicted target frame with a human body inside are used as shallow features, the shallow features are input into multiple convolutional layers for deeper feature extraction to obtain deep features, the shallow features are spliced with the deep features and then input into the tooling classification and recognition module to obtain a tooling recognition result;
[0092] Based on the label of the person wearing a helmet corresponding to the clothing image and the result of the helmet recognition, the helmet recognition loss is calculated; based on the label of the person wearing work clothes corresponding to the clothing image and the result of the work clothes recognition, the work clothes recognition loss is calculated;
[0093] By means of a back propagation algorithm, various parameters of the clothing recognition model are adjusted so as to move the loss in a direction of minimization;
[0094] It is determined whether the training end condition is met. If so, the parameters of the clothing recognition model of the current iteration are saved to obtain a clothing recognition model that has been initially trained.
[0095] Based on the content of the above embodiment, the step of automatically labeling the unlabeled clothing image by using the prediction result of the clothing recognition model completed by the preliminary training and combining the threshold comparison and non-maximum suppression calculation results specifically includes:
[0096] Inputting the unlabeled clothing image into the clothing recognition model that has been preliminarily trained to obtain a number of prediction results, each of which includes a position of a predicted target frame, a category to which the predicted target frame belongs, and a score of the predicted target frame;
[0097] Compare the scores of all predicted target boxes with the set score threshold. If the score of a predicted target box is higher than the score threshold, use the position, size and category information corresponding to the predicted target box as the annotation information; or
[0098] A set is constructed using all prediction results whose scores of the predicted target boxes are lower than the score threshold. If there are N predicted target boxes in the set belonging to the same area, and N is less than the set target box number threshold, the prediction result is discarded. Alternatively, if N is greater than the set target box number threshold, the category to which most of the N predicted target boxes belong is taken, recorded as the category to which the M boxes belong, as the category attribute of the unlabeled clothing image, and the position and size information of the M boxes are used to find the optimal predicted target box position and size as the labeling information by adopting the non-maximum suppression (NMS) calculation method.
[0099] Figure 5 A schematic diagram of the automatic labeling process provided by an embodiment of the present invention. The embodiment of the present invention proposes an optimized data labeling method, which uses the prediction results of the clothing recognition model that has been preliminarily trained, combined with threshold comparison and non-maximum suppression calculation results, to improve the automatic labeling performance, assist manual labeling, and reduce manual workload.
[0100] Wherein, N and M are both natural numbers greater than 1.
[0101] like Figure 6 As shown, it is a schematic diagram of the structure of the safety clothing identification device for electric power workers provided by an embodiment of the present invention, including: an image acquisition module 610 and a recognition module 620, wherein:
[0102] Image acquisition module 610, used to acquire images of clothing of power workers;
[0103] The recognition module 620 is used to input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the worker and classify and recognize the helmet and work clothes, and obtain the helmet recognition result and the work clothes recognition result;
[0104] Among them, the clothing recognition model is pre-trained using the clothing images of power workers as samples and the conditions of people wearing safety helmets and work clothes in the clothing images of power workers as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification and recognition module, and a work clothes classification and recognition module.
[0105] The device for identifying safety attire for electric workers provided in an embodiment of the present invention is used to implement the aforementioned embodiment of the method for identifying safety attire for electric workers. Therefore, for the understanding of the various functional modules of the device for identifying safety attire for electric workers, reference can be made to the aforementioned embodiment of the method for identifying safety attire for electric workers, which will not be repeated here.
[0106] The device for identifying safety attire for electric power workers provided in an embodiment of the present invention adopts a lightweight network MobileNet as a basic feature extraction network, combined with an optimized SSD target detection algorithm, to make a preliminary judgment on the head and body parts of the personnel, and then applies network features at different levels and splicing features at different scales to different classification and recognition tasks, thereby reducing the amount of calculation and improving the classification and recognition performance of safety attire.
[0107] Based on the content of the above embodiment, the identification module is specifically used for:
[0108] Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing;
[0109] Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person;
[0110] The basic features corresponding to the predicted target box with the person's head inside are input into the safety helmet classification and recognition module to obtain the safety helmet recognition result, the basic features corresponding to the predicted target box with the person's body inside are used as shallow features, the shallow features are input into multiple convolutional layers to obtain deep features, the shallow features and the deep features are spliced and input into the work clothes classification and recognition module to obtain the work clothes recognition result.
[0111] Based on the content of the above embodiment, the safety clothing recognition device for electric power workers further includes: a training module, which is used to train and obtain the clothing recognition model;
[0112] Wherein, the training module is specifically used for:
[0113] Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set;
[0114] The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained;
[0115] The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning;
[0116] The clothing recognition model that has been initially trained is iteratively optimized using the optimized sample set until the test accuracy of the clothing recognition model meets the preset requirements.
[0117] Figure 7 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call a computer program stored in the memory 730 and can be run on the processor 710 to execute the safety clothing recognition method for power workers provided by the above-mentioned method embodiments, for example, including: collecting the clothing image of the power worker; inputting the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the helmet and work clothes, and obtain the helmet recognition result and the work clothes recognition result; wherein the clothing recognition model is pre-trained with the clothing image of the power worker as a sample, and the situation of the person wearing a helmet and work clothes in the clothing image of the power worker as a sample label, and the clothing recognition model includes a MobileNet network, an SSD target detection module, a helmet classification recognition module and a work clothes classification recognition module.
[0118] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0119] An embodiment of the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for identifying the safety clothing of power workers provided in the above-mentioned method embodiments is implemented, for example, including: collecting images of power workers' clothing; inputting the images of power workers' clothing into a preset clothing recognition model to detect the head and body of the person and classify and identify the safety helmet and work clothes, and obtain safety helmet recognition results and work clothes recognition results; wherein the clothing recognition model is pre-trained using the images of power workers' clothing as samples and the situations of people wearing safety helmets and work clothes in the images of power workers' clothing as sample labels, and the clothing recognition model includes a MobileNet network, an SSD target detection module, a safety helmet classification recognition module and a work clothes classification recognition module.
[0120] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying safety clothing for electric power workers, characterized in that: include: Collect images of power workers' clothing; Input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the worker and classify and recognize the helmet and work clothes, and obtain the helmet recognition result and the work clothes recognition result; The clothing recognition model is obtained by pre-training using clothing images of power workers as samples and using the conditions of the power workers wearing helmets and work clothes in the clothing images as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a helmet classification and recognition module, and a work clothes classification and recognition module. The step of inputting the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the helmet and work clothes, and obtaining the helmet recognition result and the work clothes recognition result specifically includes: Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing; Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person; Input the basic features corresponding to the predicted target frame with the person's head inside into the helmet classification and recognition module to obtain the helmet recognition result, use the basic features corresponding to the predicted target frame with the person's body inside as shallow features, input the shallow features into multiple convolutional layers to obtain deep features, splice the shallow features with the deep features and input them into the work clothes classification and recognition module to obtain the work clothes recognition result; The step of training and obtaining the clothing recognition model specifically includes: Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set; The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained; The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning; Using the optimized sample set, iteratively optimize and train the clothing recognition model that has been preliminarily trained until the test accuracy of the clothing recognition model meets the preset requirements; For unlabeled clothing images, automatic labeling is performed by utilizing the prediction results of the clothing recognition model completed by the preliminary training and combining the threshold comparison and non-maximum suppression calculation results, specifically including: Inputting the unlabeled clothing image into the clothing recognition model that has been preliminarily trained to obtain a number of prediction results, each of which includes a position of a predicted target frame, a category to which the predicted target frame belongs, and a score of the predicted target frame; Compare the scores of all predicted target boxes with the set score threshold. If the score of a predicted target box is higher than the score threshold, use the position, size and category information corresponding to the predicted target box as annotation information. A set is constructed using all prediction results whose scores of the predicted target boxes are lower than the score threshold. If there are N predicted target boxes in the set belonging to the same area, and N is less than the set target box number threshold, the prediction result is discarded. If N is greater than the set target box number threshold, the category to which most of the N predicted target boxes belong is taken, recorded as the category to which the M boxes belong, as the category attribute of the unlabeled clothing image, and the position and size information of the M boxes are used to find the optimal predicted target box position and size as the labeling information by adopting the non-maximum suppression (NMS) calculation method.
2. The method for identifying safety clothing for electric power workers according to claim 1, characterized in that: The clothing recognition model is trained using the training sample set, specifically including: Inputting the clothing images in the training sample set into the MobileNet network to obtain basic features corresponding to the clothing images; Input the basic features into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains a person's head or a person's body based on the predicted target frame position and size; For a predicted target frame with a person's head inside, inputting basic features corresponding to the predicted target frame with a person's head inside into the helmet classification and recognition module to obtain a helmet recognition result; For a predicted target frame with a human body inside, the basic features corresponding to the predicted target frame with a human body inside are used as shallow features, the shallow features are input into multiple convolutional layers for deeper feature extraction to obtain deep features, the shallow features are spliced with the deep features and then input into the tooling classification and recognition module to obtain a tooling recognition result; Based on the label of the person wearing a helmet corresponding to the clothing image and the result of the helmet recognition, the helmet recognition loss is calculated; based on the label of the person wearing work clothes corresponding to the clothing image and the result of the work clothes recognition, the work clothes recognition loss is calculated; By means of a back propagation algorithm, various parameters of the clothing recognition model are adjusted so as to move the loss in a direction of minimization; It is determined whether the training end condition is met. If so, the parameters of the clothing recognition model of the current iteration are saved to obtain a clothing recognition model that has been initially trained.
3. A device for identifying safety clothing for electric power workers, characterized in that: include: An image acquisition module is used to collect images of clothing worn by power workers; The recognition module is used to input the clothing image of the power worker into a preset clothing recognition model to detect the head and body of the person and classify and recognize the safety helmet and work clothes, and obtain the safety helmet recognition result and the work clothes recognition result; The clothing recognition model is obtained by pre-training using clothing images of power workers as samples and using the conditions of the power workers wearing helmets and work clothes in the clothing images as sample labels. The clothing recognition model includes a MobileNet network, an SSD target detection module, a helmet classification and recognition module, and a work clothes classification and recognition module. The identification module is specifically used for: Inputting the image of the power worker's clothing into the MobileNet network to obtain basic features corresponding to the image of the power worker's clothing; Input the basic features corresponding to the image of the power worker's clothing into the SSD target detection module to obtain the predicted target frame position and size, and determine that the predicted target frame contains the head or body of the person; Input the basic features corresponding to the predicted target frame with the person's head inside into the helmet classification and recognition module to obtain the helmet recognition result, use the basic features corresponding to the predicted target frame with the person's body inside as shallow features, input the shallow features into multiple convolutional layers to obtain deep features, splice the shallow features with the deep features and input them into the work clothes classification and recognition module to obtain the work clothes recognition result; It also includes: a training module, used for training to obtain the clothing recognition model; Wherein, the training module is specifically used for: Collect different clothing images of different people, label the person wearing a helmet and work clothes in each clothing image accordingly, construct a sample set, and divide the sample set into a training sample set and a test sample set; The clothing recognition model is trained using the training sample set, and after the training is completed, a clothing recognition model that has been preliminarily trained is obtained; The clothing recognition model that has been preliminarily trained is tested using the test sample set. If the test accuracy meets the preset requirements, a clothing recognition model that has been finally trained is obtained; or, if the test accuracy does not meet the preset requirements, the unlabeled clothing images are automatically labeled by using the prediction results of the clothing recognition model that has been preliminarily trained, combined with the threshold comparison and non-maximum suppression calculation results, and the sample set is optimized by combining automatic labeling with manual fine-tuning; Using the optimized sample set, iteratively optimize and train the clothing recognition model that has been preliminarily trained until the test accuracy of the clothing recognition model meets the preset requirements; For unlabeled clothing images, automatic labeling is performed by utilizing the prediction results of the clothing recognition model completed by the preliminary training and combining the threshold comparison and non-maximum suppression calculation results, specifically including: Inputting the unlabeled clothing image into the clothing recognition model that has been preliminarily trained to obtain a number of prediction results, each of which includes a position of a predicted target frame, a category to which the predicted target frame belongs, and a score of the predicted target frame; Compare the scores of all predicted target boxes with the set score threshold. If the score of a predicted target box is higher than the score threshold, use the position, size and category information corresponding to the predicted target box as annotation information. A set is constructed using all prediction results whose scores of the predicted target boxes are lower than the score threshold. If there are N predicted target boxes in the set belonging to the same area, and N is less than the set target box number threshold, the prediction result is discarded. If N is greater than the set target box number threshold, the category to which most of the N predicted target boxes belong is taken, recorded as the category to which the M boxes belong, as the category attribute of the unlabeled clothing image, and the position and size information of the M boxes are used to find the optimal predicted target box position and size as the labeling information by adopting the non-maximum suppression (NMS) calculation method.
4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for identifying safety clothing for electric power workers as described in any one of claims 1 to 2 are implemented.
5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for identifying safety clothing for electric power workers as described in any one of claims 1 to 2 are implemented.
