A method, apparatus, device and storage medium for detecting hair

By combining deep learning technology with the YOLOv5 and A-CE2P frameworks, and through object detection and human body parsing networks, a method for obtaining the center of a pedestrian's neck is developed. This method solves the problems of low accuracy, high cost, and high power consumption in traditional image detection techniques, achieving real-time and omnidirectional detection.

CN115761792BActive Publication Date: 2025-12-05CHINA ORDNANCE EQUIP GRP AUTOMATION RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211284269.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-12-05
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency, low accuracy, high cost, and high power consumption when detecting employees' disheveled hair, and cannot achieve real-time and comprehensive detection.

Method used

Using deep learning image processing technology, combined with KAPAO's YOLOV5 framework and SCHP self-correcting algorithm's A-CE2P framework, the system uses target detection and human body analysis networks to determine whether employees have disheveled hair and uses audible and visual alarms to issue real-time alerts.

Benefits of technology

It achieves real-time, accurate, and low-cost hair loss detection in different scenarios, avoids manual intervention, has 24-hour uninterrupted monitoring capability, and is suitable for nighttime working scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761792B_ABST
    Figure CN115761792B_ABST
Patent Text Reader

Abstract

The application discloses a hair detection method, device and equipment and a storage medium. The method adopts a YOLOV5 framework combined with KAPAO to perform target detection and key point detection on employees in a hair detection scene, obtains a pedestrian detection frame and corresponding pedestrian key point information, then uses a Self Correction for Human Parsing technology to analyze the human body of the pedestrians, obtains semantic segmentation information of each part of the human body, then uses a predefined rule to combine the key point information and the hair information to determine whether there is a hair behavior, and then uses an audible and visual alarm to perform real-time alarm. The method is real-time and effective, does not need to increase additional costs, has strong expansibility and generalization ability, and can be deployed in different hair detection scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hair-wearing detection technology, and in particular to a hair-wearing detection method, device, equipment, and storage medium that can indirectly determine employees' hair-wearing violations through a camera, has good generalization ability, and can be applied to different hair-wearing detection scenarios. Background Technology

[0002] In recent years, numerous safety accidents have occurred due to factory management issues and employees not wearing proper uniforms when entering factory operating areas. These accidents serve as a reminder to factory managers of the necessity to establish effective systems to regulate employee behavior.

[0003] Traditional methods for detecting employees with disheveled hair rely on manual intervention by shift supervisors or safety inspectors. This approach is inefficient, outdated, and lacks true real-time alerts. Early image detection technology employed algorithms like color segmentation to divide hair for analysis. However, this method requires massive computation, and the segmentation results using edge operators are not precise enough. Furthermore, it cannot achieve real-time detection, making it impractical for real-world scenarios. Subsequent solutions involved installing sensors on machine tools and other equipment, stopping operation upon contact with hair. This approach increases factory costs and also fails to provide comprehensive, blind-spot-free detection.

[0004] With the advancement of artificial intelligence (AI) technology, solutions for detecting employee misconduct using AI have emerged. Smart factories built using AI are large-scale systems formed by combining numerous examples, thereby achieving the intelligent transformation of Industry 4.0. However, traditional methods for detecting fraudulent activities using AI generally suffer from low accuracy, high sensor deployment costs, and high power consumption costs.

[0005] Therefore, how to provide a hair detection method that can overcome the cumbersome nature of manual intervention and has higher accuracy than traditional image processing methods is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of the above problems, the present invention provides a hair-discharge detection method, apparatus, device, and storage medium to overcome or at least partially solve the above problems. This method not only overcomes the cumbersome nature of manual intervention but also has higher accuracy compared to traditional image processing methods. Furthermore, this method can analyze existing camera images of the hair-discharge detection scene or use additional cameras, offering advantages in cost and power consumption compared to sensor-based methods. Simultaneously, this method also possesses 24-hour uninterrupted monitoring capabilities, including detection of hair-discharge scenes operating at night. It is an effective solution for security management of hair-discharge detection scenes using deep learning image processing technology.

[0007] This invention provides the following solution:

[0008] A method for detecting loose hair includes:

[0009] A target detection network is used to detect pedestrians in a target image to obtain pedestrian detection boxes and key point information of various parts of the pedestrian's body; the target image is an image of the target area acquired by an image capturing device; the key point information of various parts of the pedestrian's body is used to determine the position of the center of the pedestrian's neck.

[0010] A human body parsing network based on semantic segmentation is used to perform human body parsing analysis on the pedestrian image within the pedestrian detection box to obtain human body parsing results; the human body parsing results are used to determine the hair pixel information of the pedestrian.

[0011] Based on the location of the center of the neck and the pixel information of the hair, combined with the definition of loose hair, it is determined whether the pedestrian has loose hair.

[0012] Preferably, the target detection network includes a YOLOv5 framework incorporating KAPAO.

[0013] Preferably, the YOLOv5 framework includes the basic feature extraction network Darknet and the feature fusion networks FPN and PAN.

[0014] Preferably, the basic feature extraction network Darknet includes a CSPDarknet53 network constructed by adding a CSP module to the feature extraction network Darknet53.

[0015] Preferably, the human body parsing network includes an A-CE2P framework with an embedded SCHP self-correcting algorithm.

[0016] Preferably, the key point information of each part of the pedestrian's body includes the pedestrian's nose position information, ear position information, and shoulder position information.

[0017] Preferably: the position of the center of the pedestrian's neck is determined by using the nose position information and the shoulder position information to determine the person's frontal orientation towards the image capturing device;

[0018] The position of the center of the pedestrian's neck is determined by using the ear position information, after determining that the person's back is facing the image capturing device.

[0019] The definition of personnel with disheveled hair includes:

[0020] The number of pixels in the hair pixel information whose height is lower than the center of the neck is obtained. If the number of pixels exceeds the target ratio, it is determined that the pedestrian has loose hair.

[0021] A hair loss detection device, the device comprising:

[0022] The pedestrian detection box detection unit is used to detect pedestrians in a target image using a target detection network to obtain pedestrian detection boxes and key point information of various parts of the pedestrian's body; the target image is an image of the target area obtained by an image capturing device; the key point information of various parts of the pedestrian's body is used to determine the position of the center of the pedestrian's neck.

[0023] The human body parsing unit is used to perform human body parsing analysis on the pedestrian image within the pedestrian detection box using a semantic segmentation-based human body parsing network to obtain human body parsing results; the human body parsing results are used to determine the hair pixel information of the pedestrian.

[0024] The disheveled hair behavior determination unit is used to determine whether the pedestrian has disheveled hair behavior based on the position of the center of the neck and the hair pixel information combined with the definition of disheveled hair.

[0025] A hair loss detection device, the device comprising a processor and a memory:

[0026] The memory is used to store program code and transmit the program code to the processor;

[0027] The processor is used to execute the above-described hair loss detection method according to the instructions in the program code.

[0028] A computer-readable storage medium for storing program code for performing the above-described hair loss detection method.

[0029] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0030] This application provides a method, apparatus, device, and storage medium for detecting loose hair. The method employs the YOLOv5 framework combined with KAPAO to perform target detection and keypoint detection on employees in the loose hair detection scenario, obtaining pedestrian detection boxes and corresponding pedestrian keypoint information. Then, Self-Correction for Human Parsing technology is used to perform human body parsing on the pedestrians, obtaining semantic segmentation information for each part of the human body. Next, predefined rules are used to combine the keypoint information and hair information to determine whether loose hair is present. Finally, an audible and visual alarm is used for real-time alerting. This method is real-time effective and can be implemented without incurring additional costs. Furthermore, it has strong scalability and generalization capabilities, and can be deployed in different scenarios requiring loose hair detection.

[0031] In addition, this method uses a non-contact violation detection scheme, employing cameras and sound and light alarms to complete the entire detection and alert process without the need for additional human intervention. It can realize real-time detection schemes for different types of pending detection scenarios and different environments. At the same time, this scheme is superior to existing schemes in terms of accuracy and real-time performance, and can truly achieve a solution that simultaneously satisfies both effectiveness and efficiency.

[0032] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

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

[0034] Figure 1 This is a flowchart of a hair detection method provided in an embodiment of the present invention;

[0035] Figure 2 This is a schematic diagram of the detection mark provided in an embodiment of the present invention;

[0036] Figure 3 This is a schematic diagram of the KAPAO embedded YOLOv5 detection framework network provided in an embodiment of the present invention;

[0037] Figure 4 This is a diagram showing the detection results of pedestrians and key points in the laboratory environment provided in an embodiment of the present invention;

[0038] Figure 5 This is a diagram of the A-CE2P network structure provided in an embodiment of the present invention;

[0039] Figure 6 This is a schematic diagram of the human body analysis results provided in an embodiment of the present invention;

[0040] Figure 7 This is a schematic diagram of the detection results of the dissipation behavior provided in an embodiment of the present invention;

[0041] Figure 8 This is another schematic diagram of the detection results of the dissipation behavior provided in the embodiment of the present invention;

[0042] Figure 9 This is a schematic diagram of a hair detection method provided in an embodiment of the present invention;

[0043] Figure 10 This is a schematic diagram of a hair loss detection device provided in an embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0045] See Figure 1 This invention provides a method for detecting loose hair, such as... Figure 1 As shown, the method may include:

[0046] S101: A target detection network is used to detect pedestrians in a target image, obtaining pedestrian detection boxes and key point information for various parts of the pedestrian's body. The target image is an image of the target region acquired through an image acquisition device. The key point information for various parts of the pedestrian's body is used to determine the position of the center of the pedestrian's neck. Specifically, the target detection network includes a YOLOv5 framework combined with KAPAO. The YOLOv5 framework includes a basic feature extraction network, Darknet, and feature fusion networks FPN and PAN. The basic feature extraction network, Darknet, is a CSPDarknet53 network constructed by adding a CSP module to the Darknet53 feature extraction network.

[0047] S102: The human body parsing network based on semantic segmentation is used to perform human body parsing analysis on the pedestrian image within the pedestrian detection box to obtain human body parsing results; the human body parsing results are used to determine the hair pixel information of the pedestrian; specifically, the human body parsing network includes an A-CE2P framework embedded with the SCHP self-correction algorithm.

[0048] S103: Determine whether the pedestrian has loose hair based on the position of the center of the neck, the hair pixel information, and the definition of loose hair. If loose hair is detected, control the audible and visual alarm to sound.

[0049] The hair-disheveled detection method provided in this application analyzes the image information of the camera inside the scene to be detected. First, it uses the YOLOv5 object detection framework and KAPAO (Keypoints And Poses As Objects) keypoint detection technology to extract the target detection box of the employee and the keypoint information of each part of the body inside the scene to be detected. Then, it uses SCHP (Self Correction for Human Parsing) technology to perform human body parsing on the employee in the target detection box. The segmented hair pixel information is obtained through the human body parsing results. According to the definition of hair-disheveled behavior in this application embodiment, it is determined whether the employee has hair-disheveled behavior. If hair-disheveled behavior is detected, an audible and visual alarm is triggered.

[0050] Specifically, when determining whether there is disheveled hair based on hair pixel information and key point information of various parts of the pedestrian's body, the key point information of various parts of the pedestrian's body includes the pedestrian's nose position information, ear position information, and shoulder position information.

[0051] Furthermore, the position of the center of the pedestrian's neck is determined by using the nose position information and the shoulder position information, after determining that the person is facing the image capturing device.

[0052] The position of the center of the pedestrian's neck is determined by using the ear position information, after determining that the person's back is facing the image capturing device.

[0053] The definition of personnel with disheveled hair includes:

[0054] The number of pixels in the hair pixel information whose height is lower than the center of the neck is obtained. If the number of pixels exceeds the target ratio, it is determined that the pedestrian has loose hair.

[0055] The implementation of the method provided in the embodiments of this application is mainly accomplished through the following three major steps.

[0056] The first step is to build a detection framework that combines pedestrian target detection and pedestrian key points.

[0057] First, a dataset for pedestrian and keypoint detection in the target scene is constructed. Pedestrian images are collected in different target scenes, and bounding boxes and keypoints are labeled according to the COCO dataset standard. The dataset is then trained using the YOLOv5 framework combined with KAPAO. The dataset consists of pedestrian samples from the COCO dataset and self-collected pedestrian samples from the target scenes. Next, the KAPAO keypoint detection method (without heatmaps) is used, and its structure is embedded into the YOLOv5 target detection framework. The YOLOv5 framework consists of the basic feature extraction network Darknet, and feature fusion networks FPN and PAN. A combined anchor structure of keypoints and bounding boxes is then generated, and redundant anchors are filtered using NMS. The final bounding boxes containing keypoint information are obtained based on the score. After training, image information acquired by cameras in the target scene is input into the network for detection prediction, obtaining bounding boxes containing keypoint information.

[0058] The second step is to construct a self-correcting human body parsing network.

[0059] Employee images collected under different scenarios for detecting hair loss were used as sample images and labeled according to the LIP dataset format, with the following labels:

[0060] 0=background, 1=hat, 2=hair, 3=glove, 4=sunglasses, 5=upper cloth, 6=dress, 7=coat, 8=sock, 9=pant, 10=jumpsuit, 11=scarf, 12=skirt, 13=face, 14=left leg, 15=right leg, 16=left arm, 17=right arm, 18=left shoe, 19=rightshoe.

[0061] Then, the labeled images are added to the original LIP dataset to form multiple human body parsing LIP datasets for different hair detection scenarios. The A-CE2P segmentation framework is used to train the initial model. Then, the SCHP self-correction strategy is used to optimize the initial model through online model aggregation and label optimization, so as to obtain a model that performs better than the ground truth label. Then, this model is used to perform human body parsing on the results obtained in step one to obtain the segmentation results of different parts of the human body.

[0062] Specifically, a self-correcting human body parsing framework is established. It starts with a model trained on noisy labels as the initial model, and designs a loop training scheme. Through iterative learning, it aggregates the currently learned model with the previous final model to infer the most reliable pseudo-label, thereby improving model performance. Simultaneously, the A-CE2P approach is used to implicitly and explicitly acquire human body edge and segmentation information, resulting in the final human body parsing result. The base network uses ResNet101 as the backbone for feature extraction, and a pyramid model is used to parse the context encoding module to obtain the final parsing result. The pedestrian detection box content from the first step is input to obtain the human body parsing result for that employee.

[0063] The third step is to determine whether there is any act of disclosing hair.

[0064] Based on the definition mentioned in this article that hair is considered to be disheveled when it extends beyond the center of the neck, the relationship between the positional information of the ears, nose, eyes, shoulders, neck, etc. in the key information of the human body and the positional information of the hair in the human body analysis is used to determine whether there is a situation where the hair extends beyond the center of the neck. If so, it is determined that the employee has disheveled hair behavior, and an alarm is triggered by sound and light.

[0065] In summary, the method provided in this application adopts the YOLOv5 framework combined with KAPAO to perform target detection and keypoint detection on employees in the hair-disheveled detection scenario, obtaining pedestrian detection boxes and corresponding pedestrian keypoint information. Then, it uses Self-Correction for Human Parsing technology to perform human body parsing on pedestrians, obtaining semantic segmentation information of each part of the human body. Next, it uses predefined rules combined with keypoint information and hair information to determine whether there is hair-disheveled behavior, and finally uses an audible and visual alarm for real-time alarm. This method is real-time effective and can be implemented without increasing additional costs. At the same time, this method has strong scalability and generalization ability, and can be deployed in different scenarios for hair-disheveled detection.

[0066] In addition, this method uses a non-contact violation detection scheme, which completes the entire detection and reminder process through the combination of cameras and sound and light alarms, without the need for additional human intervention. It can realize real-time detection schemes in different types of pending detection scenarios and different environments. At the same time, this scheme is superior to existing schemes in terms of accuracy and real-time performance, and can truly achieve a solution that simultaneously satisfies both effectiveness and efficiency.

[0067] The following describes in detail the method provided in the embodiments of this application, taking a factory as an example of a testing scenario to be distributed.

[0068] This invention provides a method for real-time detection and alarm of employees' disheveled hair behavior within a factory area, utilizing target detection, key point detection, and semantic segmentation-based human body parsing techniques. The method consists of three steps, detailed below:

[0069] Step 1: Using images captured by cameras in the factory area, obtain pedestrian target detection boxes and corresponding key point information of various body parts of employees through target detection and key point detection technologies.

[0070] Step 2: Train the initial model using the A-CE2P segmentation framework, then use SCHP to self-correct the model, and then use this model to perform human body analysis on the pedestrians in the pedestrian detection box in Step 1 to obtain the human body analysis results.

[0071] Step 3: Based on the key information obtained in Step 1 and the human body analysis information obtained in Step 2, and combined with the definition of the employee's disheveled hair behavior, determine whether the employee's hair extends beyond the center of the neck. Based on the judgment result, determine whether there is disheveled hair behavior. If so, finally, issue an alarm.

[0072] In step one of the above solution, images captured by cameras in the factory area are used to obtain pedestrian target bounding boxes and corresponding key point information of various body parts of employees through target detection and key point detection technologies. The specific implementation steps are as follows:

[0073] Step 101: First, a dataset for object detection and keypoint detection needs to be established. This scheme uses the COCO dataset format. Images are collected from various locations within different factory areas using different cameras. A deduplication algorithm is then used to remove duplicate samples, resulting in 1000 training images from the factory area. These 1000 images are then labeled with pedestrian detection bounding boxes and pedestrian keypoints using GT_Bbox and GT_KP respectively. There are 17 human keypoints, with the specific labels as follows:

[0074] 1=nose, 2=left_eye, 3=right_eye, 4=left_ear, 5=right_ear, 6=left_shoulder, 7=right_shoulder, 8=left_elbow, 9=right_elbow, 1 0=left_wrist, 11=right_wrist, 12=left_hip, 13=right_hip, 14=left_knee, 15=right_knee, 16=left_ankle, 17=right_ankle, the marking diagram is as follows Figure 2As shown, the triangle points are GT_KP key point information, and the rectangles are GT_Bbox marker box information.

[0075] The aforementioned 1000 images are combined with the existing pedestrian data in the COCO dataset to create a pedestrian detection and keypoint detection dataset adapted to factory scenarios, in preparation for subsequent training.

[0076] Step 102: Establish a YOLOv5 object detection and keypoint detection network under the KAPAO method. The KAPAO method integrates keypoint information into the anchor information generated by YOLOv5 through a multi-task loss function and uses the keypoint loss function to complete keypoint detection.

[0077] Step 103: Based on step 102, establish the YOLOv5 structure, as shown in the framework diagram below. Figure 3 As shown, the feature extraction network is first selected as the training backbone. The selected network is the CSPDarknet53 network, which is constructed by adding the CSP module to the Darknet53 network and is used for feature extraction.

[0078] Then, the SPP module is used to fuse features at different scales. FPN+PAN is then employed to complete feature fusion, ensuring the network can extract strong semantic features while simultaneously conveying strong localization features from the bottom up through a pyramid model. This allows for multi-dimensional and multi-level fusion of feature information. After obtaining the features, anchors containing keypoint information are generated. NMS is then used to remove redundant bounding boxes and keypoint information. A multi-modal loss regression is then used, employing CIOU_loss (Equation 1) for bounding boxes, BCE_loss (Equation 2) for classification, and KP_loss (Equation 4) for keypoints, to determine the category, location, and keypoint information of the bounding boxes from multiple dimensions. The training parameters are adjusted through joint updates of these three loss mechanisms, ultimately completing the training of the entire network.

[0079] CIOU_Loss=1-IOU(t′,t) (Formula 1)

[0080] Where t′ represents GTbbox information.

[0081] CLs_Loss=BCE(c′ n ,c n (Equation 2)

[0082] BCE=-((c n *log c′ n )+(1-c n )*log(1-c′ n(Equation 3)

[0083] Where, c′ n c represents the probability of predicting that the lowest n samples are positive samples. n This represents the label value of the nth sample.

[0084]

[0085] Where, v′ k This refers to key information.

[0086] Step 104: The dataset obtained in Step 101 is used as the training set for the KAPAO embedded YOLOv5 detection framework network in Step 103. The network is trained on a H3C R4900 server using two Tesla-t4 deep learning training cards for a total of 60 epochs. Finally, the KAPAO-L-YOLOv5 model achieves an Ap value of 70.6 for keypoints, a bounding box accuracy of 97.6%, and a recall of 98.7%.

[0087] Step 105: Using the network from step 103 in conjunction with the model obtained in step 104, target detection and keypoint prediction are performed. First, the factory camera images need to be encoded and decoded. The Hikvision convergence platform is used to decode the camera's video stream information. Then, FFmpeg is used to convert the video information into RGB images as a prediction buffer, extracted every 15 frames. The buffer information is then inspected for still frames, black levels, and sharpness. After confirming there are no such issues, forward prediction is performed using the trained model file. Based on the prediction results, pedestrian detection boxes and keypoint information for employees are obtained, such as... Figure 4 As shown.

[0088] In step two of the above scheme, the A-CE2P framework segmentation framework is used to train the model on the initial LIP dataset. Then, the SCHP (Self-Correcting Learning Noise) self-correction algorithm is used to optimize the model. The pedestrian detection result BBox information obtained in step one is used as input to perform forward prediction to parse the employee's human body and obtain the human body parsing result. The specific implementation steps of step two are as follows.

[0089] Step 201: First, construct the LIP human body analysis dataset in the factory scene. Label 8,000 employee images extracted from the factory according to the 20 categories of the LIP dataset. Then, add the original 20,462 samples from the LIP dataset to the dataset to form the final human body analysis dataset in the factory scene. A total of 360,462 images are used as the training set, 11,000 as the validation set, and 12,000 as the test set.

[0090] Step 202: Initial training begins using the dataset from Step 201. The real-world factory scene dataset reveals many challenging poses and viewpoints, along with image issues such as occlusion, incomplete appearance, inaccurate human labeling, and resolution. Therefore, a self-correcting SCHP model is needed. The first step is to determine the enhanced A-CE2P model as the basic segmentation framework, whose basic structure is as follows: Figure 5 As shown in the figure, ResNet-101 was selected as the base network for feature extraction, and the weights were pre-trained using ImageNet. The first three residual layers were fixed, and the stride and dilation rate of the last residual layer were set to 1. This magnified the output of the last layer to 1 / 16 of the input image size. PSPNet (Pyramid Network) was used as the context encoding module, with an input resolution of 473×473. The training batch size was 36. The hyperparameters of the joint loss function were λ1 = 1, λ2 = 1, and λ3 = 0.1. The initial learning rate was set to 7e-3, using a linearly increasing warm-up. Then, a combination of cross-entropy loss and MIOU loss was used as the loss function for supervised training, as shown in Equations 5 and 6. After 100 epochs, the initial trained model was obtained.

[0091] L parsing =L cls -L miou (Equation 5)

[0092]

[0093] For image I, for the nth pixel of the Kth category, where N is the number of pixels, assuming the ground truth label for human body parsing is... Human body analysis prediction is The pixel-level minimum objective function is L cls .

[0094] Step 203: After obtaining the flattened loss function curve on the original noisy training set in step 202, the SCHP self-correction process training begins. The self-correction process consists of two steps. First, online model aggregation is performed. This step aims to discover all potential information from past best models, thereby improving the performance of future models. This scheme obtains a set of all optimized models after each iteration, denoted as P = {ω′1, ω′2, ..., ω′...}. M}, where M is the total number of iterations. Equation 7 shows that the model weight ω′ of the current round is used... m The weights ω′ of the suboptimal model from the previous round m-1 Aggregate to obtain new model weights ω′ mm is the current loop count. After the update is completed, all training data are propagated once to re-estimate the statistical values ​​of some hyperparameters in the normalization layer, such as moving average and standard deviation. After the model aggregation is completed, the network will have a wider model optimum, and the generalization ability of the model will be improved accordingly.

[0095]

[0096] Step 204, similar to step 203, involves optimizing the model weights while simultaneously optimizing the label information online to reduce noise from the labels. This scheme denotes the predicted labels for each round as Y = {y′1, y′2, ..., y′...} M The averaging process for the labels is the same as the averaging process for the model weights, as shown in Equation 8, where y′ is ω′. m The generated pseudo-labels are used as the real labels in the next round of training. The generation of these pseudo-labels can reduce and eliminate the noise of the original data labels, making the actual label information smoother. Through continuous iteration, the model performance and generalization ability can also be improved. After the initial model obtained in step 202, the model is aggregated and the labels are optimized through 5 rounds of self-correction, totaling 10 epochs, and finally the human body parsing model is obtained.

[0097]

[0098] Step 205: Using the pedestrian detection results obtained in Step 105 as input, and the human body parsing network model obtained in Step 204, forward prediction is performed to finally obtain the human body parsing and segmentation image of the employee, such as... Figure 6 As shown.

[0099] In step three of the above scheme, the key point information obtained in step one and the human body analysis information in step two are used, combined with the definition of employee dishonest behavior, to determine whether the employee has engaged in dishonest behavior. If so, an alarm is triggered. The specific implementation steps of step three are as follows:

[0100] Step 301: According to the factory's definition of loose hair, hair is considered loose when it extends beyond the center of the neck. Using the positional information of the nose, eyes, ears, and shoulders obtained in step 105, the neck position h_neck can be calculated (at the center of the shoulder and face) based on the structure of the face and the shoulder information. The center of the face is the nose, so h_neck = (h_nose - h_shoulder) / 2 + h_shoudler is calculated. If the back is facing the camera, the neck position is determined by the ear position: h_neck = (h_nose - h_ear) / 2 + h_shoudler.

[0101] Step 302: After obtaining the neck center height h_neck through step 301, using the human body hair information obtained in step 205, calculate the pixels where the hair height is lower than h_neck. When this percentage exceeds a predetermined proportion, it is determined to be loose hair. The result is as follows: Figure 7 As shown, the purple line segment is located in the center of the neck, and the green box represents the behavior of having loose hair.

[0102] Step 303: After detecting the act of disclosing, the result is uploaded to the monitoring system, and an alarm is triggered by an audible and visual alarm.

[0103] Combining the above three steps, this method utilizes images captured by factory area cameras, deep learning-based object detection and keypoint detection techniques, and image semantic segmentation-based human body analysis technology to detect employees with disheveled hair. This solution is characterized by its real-time detection capability, unaffected by environmental factors such as weather and lighting. Furthermore, compared to traditional image detection techniques, this solution employs a deep learning algorithm, resulting in a significant improvement in accuracy.

[0104] Meanwhile, this method employs supervised and semi-supervised learning schemes, which have excellent generalization capabilities and inherent advantages for large-scale deployment in factory areas. Furthermore, the scheme adopted in this paper does not require additional hardware costs, and for factory areas where cameras have already been installed, it can achieve zero hardware cost deployment. Combining the above advantages, this scheme serves as a demonstration for the implementation of smart factory violation detection.

[0105] See Figure 9 This application embodiment can also provide a hair loss detection device, such as... Figure 9 As shown, the device may include:

[0106] The pedestrian detection box detection unit 901 is used to detect pedestrians in a target image using a target detection network to obtain pedestrian detection boxes and key point information of various parts of the pedestrian's body; the target image is an image of the target area obtained by an image capturing device; the key point information of various parts of the pedestrian's body is used to determine the position of the center of the pedestrian's neck.

[0107] The human body parsing unit 902 is used to perform human body parsing analysis on the pedestrian image within the pedestrian detection box using a semantic segmentation-based human body parsing network to obtain human body parsing results; the human body parsing results are used to determine the hair pixel information of the pedestrian.

[0108] The disheveled hair behavior determination unit 903 is used to determine whether the pedestrian has disheveled hair behavior based on the position of the center of the neck and the hair pixel information combined with the definition of disheveled hair.

[0109] This application embodiment can also provide a hair loss detection device, characterized in that the device includes a processor and a memory:

[0110] The memory is used to store program code and transmit the program code to the processor;

[0111] The processor is used to execute the steps of the above-described hair loss detection method according to the instructions in the program code.

[0112] like Figure 10 As shown in the embodiment of this application, a hair loss detection device may include: a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, memory 11, and communication interface 12 all communicate with each other through the communication bus 13.

[0113] In this embodiment, the processor 10 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic devices.

[0114] The processor 10 can call the program stored in the memory 11. Specifically, the processor 10 can execute the operations in the embodiments of the hair loss detection method.

[0115] The memory 11 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 11 stores at least a program for implementing the following functions:

[0116] A target detection network is used to detect pedestrians in a target image to obtain pedestrian detection boxes and key point information of various parts of the pedestrian's body; the target image is an image of the target area acquired by an image capturing device; the key point information of various parts of the pedestrian's body is used to determine the position of the center of the pedestrian's neck.

[0117] A human body parsing network based on semantic segmentation is used to perform human body parsing analysis on the pedestrian image within the pedestrian detection box to obtain human body parsing results; the human body parsing results are used to determine the hair pixel information of the pedestrian.

[0118] Based on the location of the center of the neck and the pixel information of the hair, combined with the definition of loose hair, it is determined whether the pedestrian has loose hair.

[0119] In one possible implementation, the memory 11 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function (such as file creation or data read / write). The data storage area may store data created during use, such as initialization data.

[0120] In addition, memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0121] Communication interface 12 can be an interface for the communication module, used to connect with other devices or systems.

[0122] Of course, it should be noted that, Figure 10 The structure shown does not constitute a limitation on the hair loss detection device in the embodiments of this application. In practical applications, the hair loss detection device may include more than Figure 10 More or fewer components as shown, or combinations of certain components.

[0123] This application embodiment may also provide a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code, the program code being used to execute the steps of the above-described hair loss detection method.

[0124] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0125] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0126] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0127] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A hair detection method characterized by, The method comprises: detecting a pedestrian in a target picture by using a target detection network to obtain a pedestrian detection frame and pedestrian body part key point information; the target picture is a picture of a target region obtained by an image acquisition device; the pedestrian body part key point information is used to determine a position of a neck center of the pedestrian; performing human body analysis on a pedestrian image in the pedestrian detection frame by using a human body analysis network based on semantic segmentation to obtain a human body analysis result; the human body analysis result is used to determine hair pixel information of the pedestrian; determining whether the pedestrian has a hair covering behavior according to the position of the neck center and the hair pixel information in combination with a personnel hair covering definition.

2. The hair detection method according to claim 1, wherein The target detection network comprises a YOLOV5 framework combined with KAPAO.

3. The hair detection method according to claim 2, wherein, The YOLOV5 framework comprises a basic feature extraction network Darknet and a feature fusion network FPN and PAN.

4. The hair detection method according to claim 3, wherein The basic feature extraction network Darknet comprises a CSPDarknet53 network constructed by adding a CSP module to a basic feature extraction network Darknet53.

5. The hair detection method according to claim 1, wherein, The human body analysis network comprises an A-CE2P framework embedded with an SCHP self-correction algorithm.

6. The hair detection method according to claim 1, wherein The pedestrian body part key point information comprises nose position information, ear position information and shoulder position information of the pedestrian.

7. The hair detection method according to claim 6, wherein When it is determined that the personnel are facing the image acquisition device, the nose position information and the shoulder position information are used to determine the position of the neck center of the pedestrian; When it is determined that the personnel are facing away from the image acquisition device, the ear position information is used to determine the position of the neck center of the pedestrian; The personnel hair covering definition comprises: The number of pixels in the hair pixel information that is lower than the position of the neck center is obtained, and when the number of pixels exceeds a target proportion, it is determined that the pedestrian has a hair covering behavior.

8. A hair detection device, characterized in that The device comprises: a pedestrian detection frame detection unit configured to detect a pedestrian in a target picture by using a target detection network to obtain a pedestrian detection frame and pedestrian body part key point information; the target picture is a picture of a target region obtained by an image acquisition device; the pedestrian body part key point information is used to determine a position of a neck center of the pedestrian; a human body analysis unit configured to perform human body analysis on a pedestrian image in the pedestrian detection frame by using a human body analysis network based on semantic segmentation to obtain a human body analysis result; the human body analysis result is used to determine hair pixel information of the pedestrian; a hair covering behavior determination unit configured to determine whether the pedestrian has a hair covering behavior according to the position of the neck center and the hair pixel information in combination with a personnel hair covering definition.

9. A hair detection device, characterized by The device comprises a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the instructions in the program code to perform the hair detection method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store program code, and the program code is used to execute the hair detection method in any one of claims 1-7.

Citation Information

Patent Citations

  • Commodity recommendation and image detection method and device, equipment and storage medium

    CN113298593A

  • Hair segmentation method and system based on convolutional neural network

    CN114187309A