A method, apparatus, and medium for identifying an absence of a safety hat

By utilizing dual verification of classification and feature matching branches in the head and shoulder image feature comparison, the high false recognition rate of helmet wearing identification in the prior art is solved, and the accuracy of identification is improved.

CN114882535BActive Publication Date: 2026-02-06JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210635480.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2026-02-06
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

Existing technologies are easily affected by environmental factors such as light, camera height, and angle when identifying helmet wearers, resulting in a high false recognition rate and insufficient accuracy.

Method used

By extracting features from the head and shoulder image, a preliminary judgment is made using the classification branch. If no helmet is being worn, the feature matching branch is used to compare the feature vectors with the feature vectors in the database to confirm whether a helmet is not being worn.

Benefits of technology

This reduces the number of cases where helmets are not being worn and improves the accuracy of helmet identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114882535B_ABST
    Figure CN114882535B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and medium for identifying whether a safety helmet is not worn, and relates to the technical field of image processing. The method comprises the following steps: extracting the features of a head-shoulder image; inputting the features of the head-shoulder image into a preset classification branch; judging whether the head-shoulder image is worn with a safety helmet through the classification branch; in the case that the head-shoulder image is not classified as being worn with a safety helmet, extracting the feature vector of the head-shoulder image through a feature matching branch; comparing the extracted vector features of the head-shoulder image with the feature vectors of sample images stored in a database in advance; and identifying that the target is not worn with a safety helmet when the confidence of the feature comparison is less than a threshold. In the method, whether the target is not worn with a safety helmet is first judged in the classification branch, and in the case that the target is not worn with a safety helmet, whether the target is not worn with a safety helmet is further determined through the feature matching branch. Therefore, the method can reduce the case of misidentification that the target is not worn with a safety helmet, thereby improving the accuracy of identifying whether a safety helmet is worn.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus and medium for identifying individuals not wearing safety helmets. Background Technology

[0002] In today's well-established legal framework, ensuring production safety is a major concern and a challenging issue for every construction company. To achieve this goal, construction companies have resorted to various methods, including posting warning signs at construction site entrances and on walls, and even assigning personnel to monitor video surveillance. However, the results have been minimal. Relying solely on warning signs relies heavily on worker self-discipline. Manual monitoring requires significant manpower and financial resources, and the long monitoring periods can lead to worker fatigue and decreased productivity, increasing the risk of missed detections. With the development of deep learning, artificial intelligence devices can detect whether workers are wearing safety helmets to a certain extent, freeing up manpower.

[0003] Traditional methods for detecting helmet use, such as detecting whether a helmet is worn by analyzing the red, green, and blue (RGB) components of an image or the outline of the target in the image, are easily affected by environmental factors such as lighting, camera height, and angle. These methods can easily misidentify a helmet being worn as not being worn, resulting in low accuracy in helmet use detection.

[0004] Therefore, improving the accuracy of identifying helmet wearers is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a method, device, and medium for identifying those not wearing safety helmets, thereby improving the accuracy of identifying those wearing safety helmets.

[0006] To address the aforementioned technical problems, this application provides a method for identifying individuals not wearing safety helmets, comprising:

[0007] Obtain the head and shoulder image of the target in the image to be tested; wherein the size of the head and shoulder image of the target is smaller than the size of the image to be tested;

[0008] Extract the features from the head and shoulder image;

[0009] The features of the head and shoulder image are input into a preset classification branch;

[0010] The classification branch is used to classify and determine whether a helmet is being worn in the head and shoulder diagram;

[0011] If the head and shoulder image is not classified as wearing a safety helmet, the feature vector of the head and shoulder image is extracted through the feature matching branch.

[0012] The extracted feature vector of the head and shoulder image is compared with the feature vector of the sample image pre-stored in the database;

[0013] If the confidence level of the feature comparison is less than a threshold, the target is identified as not wearing a safety helmet.

[0014] Preferably, the extraction of features from the head and shoulder image includes:

[0015] Extract global features from the head and shoulders image;

[0016] The head and shoulder image is corrected using the STN module, and the local features of the target in the head and shoulder image are extracted using the forced segmentation feature module.

[0017] The global features of the head and shoulder image and the local features of the target in the head and shoulder image are combined to form the extracted features of the head and shoulder image.

[0018] Preferably, the step of classifying the head and shoulder diagram by the classification branch to determine whether a helmet is being worn includes:

[0019] The head and shoulder diagram is classified at least as wearing a safety helmet, wearing a hat other than the safety helmet, or not wearing a hat through the classification branch.

[0020] Preferably, obtaining the feature vector of the sample image pre-stored in the database includes:

[0021] Acquire images including at least the styles of each safety helmet, and images of each of the safety helmets being worn under different orientations, angles, and light intensities, and use the acquired images as the sample images;

[0022] Each of the sample images is fed into a feature extractor to obtain the feature vector corresponding to each of the sample images;

[0023] The feature vectors corresponding to each of the sample images are stored in the database.

[0024] Preferably, after identifying that the target is not wearing a helmet when the confidence level of the feature comparison is less than a threshold, the method further includes:

[0025] Obtain the head and shoulder image of the person who was misclassified as not wearing a helmet;

[0026] Extract features from the head and shoulder images that are misclassified as not wearing a helmet;

[0027] Features of the head and shoulder images that were misclassified as not wearing helmets were added to the database.

[0028] Preferably, obtaining the head and shoulders image of the target in the image to be tested includes:

[0029] Yolov5 was used to detect the head and shoulder coordinates of the target in the image under test;

[0030] Extract the head and shoulders image of the target from the image to be tested.

[0031] Preferably, after identifying that the target is not wearing a helmet when the confidence level of the feature comparison is less than a threshold, the method further includes:

[0032] Output a message to indicate that a helmet is not being worn.

[0033] To address the aforementioned technical problems, this application also provides a device for identifying individuals not wearing safety helmets, comprising:

[0034] An acquisition module is used to acquire a head and shoulder image of a target in a test image; wherein the size of the head and shoulder image of the target is smaller than the size of the test image;

[0035] The first extraction module is used to extract features from the head and shoulder image;

[0036] An input module is used to input the features of the head and shoulder image into a preset classification branch;

[0037] The judgment module is used to classify and judge whether the head and shoulder image is wearing a safety helmet through the classification branch. If not, the second extraction module is triggered.

[0038] The second extraction module is used to extract the feature vector of the head and shoulder image by feature matching branch when the head and shoulder image is not classified as wearing a safety helmet;

[0039] The comparison module is used to compare the extracted head and shoulder image vector features with the feature vectors of sample images pre-stored in the database;

[0040] The identification module is used to identify that the target is not wearing a safety helmet when the confidence level of the feature comparison is less than a threshold.

[0041] To address the aforementioned technical problems, this application also provides a device for identifying individuals not wearing safety helmets, comprising:

[0042] Memory, used to store computer programs;

[0043] A processor is configured to implement the steps of the method for identifying individuals not wearing safety helmets as described above when executing the computer program.

[0044] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for identifying those not wearing safety helmets described above.

[0045] The method for identifying whether a helmet is being worn provided in this application includes: extracting features from a head and shoulder image; inputting the features of the head and shoulder image into a preset classification branch; classifying the head and shoulder image to determine whether a helmet is being worn using the classification branch; if the head and shoulder image is not classified as helmet-wearing, extracting feature vectors from the head and shoulder image using a feature matching branch; comparing the extracted feature vectors of the head and shoulder image with feature vectors of sample images pre-stored in a database; and identifying that the target is not wearing a helmet when the confidence level of the feature comparison is less than a threshold. This method first determines whether the target is not wearing a helmet in the classification branch, and if it is determined that the target is not wearing a helmet, it further confirms whether the target is not wearing a helmet using the feature matching branch. Therefore, this method can reduce false identifications of helmet-wearing, thereby improving the accuracy of helmet-wearing identification.

[0046] In addition, this application also provides a device and a computer-readable storage medium for identifying those not wearing helmets, which correspond to the aforementioned method for identifying those not wearing helmets and have the same effect. Attached Figure Description

[0047] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This application provides a method for identifying individuals not wearing safety helmets.

[0049] Figure 2 This is an overall network structure diagram provided in the embodiments of this application;

[0050] Figure 3 A structural diagram of a device for identifying a person not wearing a helmet, provided in an embodiment of this application;

[0051] Figure 4 A structural diagram of a device for identifying a person not wearing a safety helmet, provided in another embodiment of this application;

[0052] Figure 5 This is an application scenario diagram for identifying individuals not wearing safety helmets, provided in an embodiment of this application. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0054] The core of this application is to provide a method, device, and medium for identifying those not wearing safety helmets, thereby improving the accuracy of identifying those wearing safety helmets.

[0055] Existing helmet detection solutions prioritize accurate helmet identification, neglecting the high demands of customers for proper helmet recognition. Identifying a helmet as not being worn reduces the solution's reliability, impacts practicality, and contradicts the goal of freeing up manpower. In practice, there are only two scenarios where a helmet is not worn: wearing another type of hat or not wearing a helmet at all. Environmental factors and target posture can easily lead to false alarms, such as helmets being mistakenly identified as not being worn. For example, the small difference in category features between helmets and baseball caps due to color, outline, and angle can easily cause incorrect classifications. Backlighting or other adverse lighting conditions can make it difficult for the human eye to clearly see head information, resulting in helmets being mistakenly identified as not being worn. Tilting the head up or down reduces the helmet area to be identified, leading to similar errors. Therefore, this application uses feature comparison to reduce false alarms of helmet absence, thereby improving the accuracy of helmet identification. It should be noted that this application provides an analysis of identifying the wearing of a safety helmet. However, in practice, the method provided in this application can also be used to identify any type of hat other than a safety helmet, and all such cases are within the scope of protection of this application.

[0056] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 A method for identifying someone not wearing a safety helmet, provided in this application embodiment, includes:

[0057] S10: Obtain the head and shoulders image of the target in the image to be tested; the size of the head and shoulders image of the target is smaller than the size of the image to be tested.

[0058] In this embodiment, the image used to identify whether a target is wearing a helmet is referred to as the image to be tested. The image to be tested may be an image containing the entire body of the target, or it may be an image containing only the upper body of the target, etc. Since this application identifies whether a target is wearing a helmet, in order to obtain the identification results more quickly and accurately, in practice, a small image containing only the target's head and shoulders is obtained from the image to be tested. The size of the target's head and shoulders image is smaller than the size of the image to be tested.

[0059] S11: Extract features from the head and shoulders image.

[0060] Traditional methods for identifying helmet wearing are easily affected by factors such as lighting, leading to misidentification of helmet wear as helmetlessness. Therefore, this embodiment reduces misidentification by extracting features from the head and shoulder image, classifying the image based on these features, and performing feature comparison. Feature extraction is performed on the head and shoulder image obtained in the above steps to obtain its features.

[0061] S12: Input the features of the head and shoulders image into the preset classification branch.

[0062] S13: Classify the head and shoulder diagram by the classification branch to determine whether a safety helmet is worn. If not, proceed to step S14.

[0063] The features of the head and shoulder image are input into a pre-defined classification branch, which then classifies whether a helmet is worn based on the head and shoulder image. Since the samples in the classification branch include at least three categories—wearing a helmet, wearing a hat other than a helmet, and not wearing a helmet—the classification branch can classify at least these three cases.

[0064] The classification branch consists of only two fully connected layers. After extracting features from the input head and shoulder image, the classification branch directly performs classification. The output of the last fully connected layer is the probability of the input features belonging to the three classes. The class with the highest probability is selected as the class of the target image corresponding to the input features.

[0065] S14: When the head and shoulder image is not classified as wearing a safety helmet, extract the feature vector of the head and shoulder image through the feature matching branch;

[0066] S15: Compare the extracted head and shoulder image feature vector with the feature vector of the sample image stored in the database.

[0067] To avoid misidentification such as helmets with high similarity to other helmets being mistaken for other helmets due to complex environmental factors, or targets wearing helmets being identified as not wearing helmets due to lighting conditions, further judgment is needed on head and shoulder images classified as not wearing helmets by the classification branch. In this embodiment, feature vectors of head and shoulder images are extracted through a feature matching branch, and these feature vectors are compared with feature vectors of sample images pre-stored in a database. Each feature vector in the database is traversed, and the cosine similarity between the feature vector of the head and shoulder image and each feature vector in the database is calculated. The images used as samples are not limited; preferably, they are head and shoulder images of helmets of different colors worn under different lighting conditions, distances, and postures, collected according to the application scenario, as well as head and shoulder images of helmets that are easily misidentified.

[0068] S16: If the confidence level of feature comparison is less than the threshold, the target is identified as not wearing a safety helmet.

[0069] After the feature comparison steps described above, if the confidence scores of all feature comparisons are less than the threshold, it can be concluded that the helmet worn in the head and shoulder image is not among the helmets recorded in the database, confirming that the target is not wearing a helmet. The specific value of the threshold is not limited here; an appropriate threshold should be selected based on the actual situation.

[0070] Figure 2 This is an overall structural diagram of the network provided in an embodiment of this application. (See diagram below.) Figure 2 As shown, the overall structure of the network includes: a backbone network 1, a classification branch 2, and a feature matching branch 3. The input image is a head and shoulders image. The backbone network's role is to extract high-level semantic features from the low-level semantic representation of the image.

[0071] The backbone network is connected to two branches: a classification branch and a feature matching branch. The classification branch classifies whether a helmet is worn in the head and shoulder image, while the feature matching branch further filters the results of the classification network. The classification branch consists of only two fully connected layers. The output of the last fully connected layer represents the number of categories supported by the classification model, and the output values ​​are the probability values ​​for each category. The feature matching branch consists of two fully connected layers. The first fully connected layer, with a size of 1024*512, is used to fuse global and local information. The last connected layer outputs a 1*218 dimensional feature vector. The backbone network + classification branch forms a complete classifier, while the backbone network + feature matching branch forms a complete feature extractor. Sharing a backbone network for both the classifier and the feature extractor has two advantages: 1. It significantly reduces the number of parameters and memory requirements; 2. It significantly reduces computational cost and effectively reduces advance inference time. The classification branch outputs the probability values ​​for each category of the target image, while the feature matching branch outputs a fixed-dimensional feature vector. In practical applications, when a sample is identified as a reportable sample by the classification model, its output from the backbone network is extracted and fed into the feature matching branch to obtain a feature vector that corresponds to the database. Each vector in the database is traversed, and the cosine similarity between each vector and the reportable sample's features is calculated. If any metric exceeds a set threshold, the target of the reportable sample is considered to be wearing a safety helmet, the classification model is incorrect, and no alarm is triggered. Conversely, if the classification branch identifies a sample as a safety helmet, the feature matching branch does not analyze it. This feature comparison method avoids false alarms with strong timeliness, enabling rapid response to local needs. When a false alarm occurs, simply adding the false alarm sample to the database avoids further false alarms, allowing time for data collection and classification model optimization.

[0072] When the classification branch identifies the head and shoulder image as a helmet, the analysis of that sample ends. When the classification branch identifies the head and shoulder image as not wearing a helmet, the sample should be reported. However, to avoid false reports caused by the classification model's capabilities, the samples to be reported are sent to the feature matching branch, where the similarity between the sample and the feature vectors pre-stored in the database is measured. Only when the similarity between the sample and each feature vector in the database is less than a certain threshold is it finally judged as not wearing a helmet and reported.

[0073] The method for identifying whether a helmet is being worn, provided in this embodiment, includes: extracting features from a head and shoulder image; inputting the features of the head and shoulder image into a preset classification branch; classifying the head and shoulder image to determine whether a helmet is being worn using the classification branch; if the head and shoulder image is not classified as helmet-wearing, extracting feature vectors from the head and shoulder image using a feature matching branch; comparing the extracted vector features of the head and shoulder image with feature vectors of sample images pre-stored in a database; and identifying that the target is not wearing a helmet when the confidence level of the feature comparison is less than a threshold. This method first determines whether the target is not wearing a helmet in the classification branch, and if it is determined that the target is not wearing a helmet, it further confirms whether the target is not wearing a helmet again using the feature matching branch. Therefore, this method can reduce false identifications of helmet-wearing, thereby improving the accuracy of helmet-wearing identification.

[0074] To more accurately identify whether a target in the head and shoulder image is wearing a helmet, in practice, as a preferred implementation, the features extracted from the head and shoulder image include:

[0075] Extract global features from the head and shoulders image;

[0076] The head and shoulder image is corrected using the STN module, and the local features of the target in the head and shoulder image are extracted using the forced segmentation feature module.

[0077] The global features of the head-shoulder image and the local features of the target in the head-shoulder image are combined to form the features of the extracted head-shoulder image.

[0078] In the head-shoulder thumbnail image, the head is generally located directly above it. Based on this prior knowledge, the upper half of the head-shoulder features can be directly cut out as the local features of the top of the head. Therefore, this application designs a forced segmentation module to extract the local features of the top of the head. However, in actual production, workers' postures vary greatly; they may be looking down, turning to the side, or the head region may not be directly above the head-shoulder thumbnail due to the capabilities of the detection model. To solve this problem, this application introduces a Spatial Transformer Networks (STN) module, which has the function of correcting the head region back to the top.

[0079] The STN module is spatially indeformable and consists of three parts: a localization network, a grid generator, and a sampler. The localization network is used to regress the transformation parameters θ. Its input is the feature image, which, after a series of convolutions, outputs the spatial transformation parameters θ between the feature image and the input features. The grid generator maps pixels on the target feature V to the source feature U based on the predicted transformation parameters, representing the mapping relationship between the source feature U and the target feature V. The sampler then maps pixel values ​​from the source features to the corresponding pixels on the target feature V based on the mapping relationship established by the grid generator.

[0080] Ordinary neural networks can spontaneously find regions of interest through iterative training. However, sometimes, due to limitations of the network itself and the data, as well as the influence of background information, the network struggles to accurately locate regions of interest from the global information. To address this issue, a self-attention module is typically embedded in the network. This module learns and outputs the weights for each pixel, which are then superimposed onto the original feature map to highlight the features of key regions. This pixel-level computation method is performance-intensive and unsuitable for practical applications. Considering that in the task of detecting whether a helmet is being worn, the region of interest (the head region) is generally located at the top of the head-shoulder image, and even if it is not at the top, the STN module will correct it, this embodiment proposes a forced segmentation module. Based on prior knowledge, the forced segmentation module directly segments local information containing the top of the head from the global information, and finally concatenates the global and local information to obtain the final feature representation. This module can reduce the influence of background information and enhance the weight of important regions in the feature representation.

[0081] This embodiment builds the backbone network from the input layer to the resnet4b layer of ResNet18 by embedding an adaptive learning key region module, making the backbone network more robust to environmental factors, human posture, and fine-grained inter-class features. The adaptive learning key region module consists of an STN module and a forced segmentation module, which operate independently, located after the res2a_relu and res4b_relu layers, respectively. By combining the STN module and the forced segmentation feature module, the adaptive learning key region module can accurately highlight regions with important features, improving the network's learning ability. The forced segmentation module consists of two branches: a global branch, composed of convolutional layers, pooling layers, and a fully connected layer with a 1*512 dimensional vector output, used to learn global information of the entire image; and a local branch, based on a slice layer to extract local features of the head region. These two types of information are concatenated by a concat layer, resulting in the final feature representation of the entire head and shoulder image.

[0082] The method for extracting local features of a target using the STN module and the forced segmentation feature module provided in this embodiment uses the STN module to actively correct the head region to be directly above the head and shoulder image when the head region is not directly above the head and shoulder image, thereby enabling the identification of whether the target is wearing a helmet. The forced segmentation feature module can reduce the influence of background information and enhance the weight of important regions in feature expression, thereby enabling more accurate identification of whether the target is wearing a helmet.

[0083] To accurately identify whether a target is wearing a helmet, in a preferred implementation, the classification of the head and shoulder image to determine whether a helmet is worn involves using a classification branch:

[0084] The head-and-shoulder diagram is classified into at least three categories: wearing a safety helmet, wearing a hat other than a safety helmet, and not wearing a hat.

[0085] In this embodiment, the classification branch classifies the head and shoulder images into three categories: wearing a helmet, wearing another type of hat, and not wearing a hat. Positive samples are those of people wearing helmets, and negative samples are those of people wearing other types of hats or not wearing a hat. The backbone network and the classification branch form a complete classification network, and its training set is constructed with a ratio of helmet wear: other type of hat: no hat = 2:1:1. Each category has at least 50,000 samples and 100 scenarios. The massive amount of data can encompass as many states as possible when wearing or not wearing a helmet, which can improve the model's generalization ability. To combat the impact of different light intensities and sharpness on the helmet recognition accuracy, image processing methods such as ColorJitter and GaussianBlur are used to preprocess the data during training. The optimization of the backbone network, the expansion of the data volume, and the use of data augmentation can ensure that the classification network has extremely high accuracy.

[0086] The head and shoulder image identification provided in this embodiment, which identifies those wearing safety helmets, those wearing other types of hats, and those not wearing hats, can widen the gap between safety helmets and other categories, reduce false alarms about safety helmets, and increase the detection rate of those not wearing safety helmets. By further comparing the samples that the classification branch considers to be not wearing safety helmets, false alarms caused by misclassification by the classification branch can be effectively filtered out.

[0087] Traditional methods for detecting helmet wearing are easily affected by environmental factors such as lighting, camera height, and angle, and can easily misidentify wearing a helmet as not wearing one. Therefore, to improve the accuracy of feature comparison, a preferred implementation method is to obtain the feature vectors of sample images pre-stored in a database, including:

[0088] Obtain images of at least each helmet style, as well as images of each helmet worn in different orientations, angles, and light intensities, and use each obtained image as a sample image;

[0089] Each sample image is fed into the feature extractor to obtain the feature vector corresponding to each sample image;

[0090] The feature vectors corresponding to each sample image are stored in the database.

[0091] Based on the application scenario, small images of the head and shoulders of helmets of different colors are collected under different lighting conditions, distances, and postures, as well as small images of helmet heads and shoulders that are easily misidentified. These head and shoulder images are then fed into a feature extractor to obtain their corresponding feature vectors, which are then stored in a database. The database containing features of helmet wearing in different scenarios provided in this embodiment can maximize the accuracy of feature comparison, thereby improving the accuracy of helmet identification.

[0092] To enrich the data in the database, in practice, after identifying that the target is not wearing a safety helmet when the confidence level of feature comparison is less than a threshold, the following steps are also included:

[0093] Obtain head and shoulder images that were misclassified as not wearing a helmet;

[0094] Extract features from head and shoulder images that are misclassified as not wearing a helmet;

[0095] Features of head and shoulder images that were misclassified as not wearing helmets were added to the database.

[0096] Head and shoulder images that are misclassified as not wearing a helmet typically fall into the following scenarios:

[0097] (1) Due to the color attribute, when the classification model identifies a helmet sample with an unclear image as wearing other hats, such samples are added to the database and the feature comparison part can correct them, reducing false alarms.

[0098] (2) Over time, safety helmets will fade and become very different from the colors of common safety helmets, making it easy for classification models to identify them as other types of hats. Adding such samples to the database can correct them in the feature comparison part and reduce false alarms.

[0099] (3) In backlit or backlit scenes, the image is not clear and the head area is dark. When the classification model identifies it as not wearing a hat, such samples are added to the database and the feature comparison part can correct it, reducing false alarms.

[0100] (4) Depending on production needs, the shape of the safety helmet may be changed, resulting in a difference from the conventional shape. This may cause the classification model to easily identify it as other hats. Inputting this sample into the data path and the feature comparison part can correct it and reduce false alarms.

[0101] The feature vector provided in this embodiment, which adds the head and shoulder image misclassified as not wearing a helmet to the database, enriches the database. On the one hand, it improves the accuracy of feature comparison; on the other hand, it enables the head and shoulder image with the same feature to be quickly identified through feature comparison when it is encountered again, thereby improving the efficiency of identifying whether a helmet is being worn.

[0102] In order to quickly detect the head and shoulders of a target in a test image, in a preferred implementation, acquiring a head and shoulders image of the target in the test image includes:

[0103] Yolov5 was used to detect the head and shoulder coordinates of a target in the image under test.

[0104] Extract the head and shoulders of the target from the image to be tested.

[0105] Because YOLOv5 has advantages such as small model size, low deployment cost, high flexibility, and high detection speed, this embodiment uses YOLOv5 to detect the head and shoulders of the target in the image to be tested, so that the detection results can be obtained quickly.

[0106] To promptly remind the target to wear a helmet, after identifying the target as not wearing a helmet when the confidence level of feature comparison is less than a threshold, the following steps are also included:

[0107] Output a message to indicate that a helmet is not being worn.

[0108] The above embodiment classifies head and shoulder images indicating that a person is not wearing a helmet by using a classification branch. Further feature comparison is performed on these head and shoulder images classified as helmetless, thereby reducing the occurrence of misidentification. For targets confirmed to be helmetless, a prompt message is sent to remind them to wear a helmet promptly to ensure personal safety. The content and form of the output prompt message are not limited here, as long as it indicates that the classification results include a helmetless situation. The output prompt message can be delivered through a buzzer, flashing warning lights, or a display screen. It should be noted that the prompt message in this embodiment is used to remind identified helmetless targets to wear helmets promptly. In practice, even if the head and shoulder image classification does not indicate helmet wearing, the output prompt message can also be used to suggest the need for further analysis of the helmetless situation. The two prompt messages can be the same or different. However, preferably, the two prompt messages use different methods to facilitate user differentiation.

[0109] This embodiment provides a prompt message to remind the target not to wear a helmet after identifying that the target is not wearing a helmet when the confidence level of feature comparison is less than the threshold. This can promptly remind the target to wear a helmet, thereby ensuring personal safety.

[0110] In the above embodiments, the method for identifying that a safety helmet is not being worn has been described in detail. This application also provides embodiments corresponding to a device for identifying that a safety helmet is not being worn. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional modules, and the other is based on the hardware.

[0111] Figure 3 This is a structural diagram of a device for identifying individuals not wearing helmets, provided as an embodiment of this application. This embodiment, based on functional modules, includes:

[0112] The acquisition module 10 is used to acquire the head and shoulder image of the target in the image to be tested; wherein the size of the head and shoulder image of the target is smaller than the size of the image to be tested.

[0113] The first extraction module 11 is used to extract features from the head and shoulder image;

[0114] Input module 12 is used to input the features of the head and shoulders image into a preset classification branch;

[0115] The judgment module 13 is used to classify and judge whether the head and shoulder image is wearing a safety helmet through the classification branch. If not, the second extraction module 14 is triggered.

[0116] The second extraction module 14 is used to extract the feature vector of the head and shoulder image through the feature matching branch when the head and shoulder image is not classified as wearing a safety helmet.

[0117] The comparison module 15 is used to compare the extracted head and shoulder image vector features with the feature vectors of sample images pre-stored in the database.

[0118] The identification module 16 is used to identify that the target is not wearing a safety helmet when the confidence level of the feature comparison is less than a threshold.

[0119] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0120] The device for identifying helmetless targets provided in this embodiment acquires a head and shoulder image of a target from a test image via an acquisition module; the size of the target's head and shoulder image is smaller than the size of the test image. A first extraction module extracts features from the head and shoulder image. An input module inputs these features into a preset classification branch. A judgment module classifies the head and shoulder image to determine whether a helmet is being worn. If not, a second extraction module is triggered to extract feature vectors from the head and shoulder image via a feature matching branch. A comparison module compares the extracted feature vectors with feature vectors from sample images pre-stored in a database. The recognition module identifies the target as not wearing a helmet if the confidence level of the feature comparison is less than a threshold. This device first determines whether the target is not wearing a helmet in the classification branch, and then further confirms this through the feature matching branch if a helmet is not being worn. Therefore, this device can reduce false identifications of helmetless targets, thereby improving the accuracy of helmet-wearing identification.

[0121] Figure 4 This is a structural diagram of a device for identifying a person not wearing a helmet, according to another embodiment of this application. This embodiment is based on a hardware perspective, such as... Figure 4 As shown, the device for identifying those not wearing helmets includes:

[0122] Memory 20 is used to store computer programs;

[0123] The processor 21 is configured to execute a computer program to implement the steps of the method for identifying the absence of a safety helmet as described in the above embodiments.

[0124] The device for identifying those not wearing helmets provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0125] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0126] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the method for identifying not wearing a safety helmet disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the aforementioned method for identifying not wearing a safety helmet.

[0127] In some embodiments, the device for identifying those not wearing helmets may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0128] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the device for identifying those not wearing helmets and may include more or fewer components than illustrated.

[0129] The device for identifying those not wearing safety helmets provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the method for identifying those not wearing safety helmets, with the same effect as above.

[0130] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0131] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0132] The computer-readable storage medium provided in this application includes the aforementioned method for identifying those not wearing safety helmets, and has the same effect.

[0133] To enable those skilled in the art to better understand the technical solution of this application, the following description is provided in conjunction with the appendix. Figure 5 This application will now provide a more detailed description of the above. Figure 5 This is an application scenario diagram illustrating the identification of individuals not wearing safety helmets, provided in an embodiment of this application. Figure 5 As shown, the process includes:

[0134] S17: Acquire video frames;

[0135] S18: Input the video frames into the detection model and obtain the head and shoulder thumbnail;

[0136] S19: Send the head and shoulders into the classification branch for identification of non-helmet categories;

[0137] S20: Obtain the database; the database contains pre-stored sample data;

[0138] S21: Construct feature matching branches using the database;

[0139] S22: Feed the head and shoulder thumbnail images of non-helmet categories into the feature matching branch;

[0140] S23: If there is no match, an alarm will be triggered.

[0141] This method first determines whether the target is not wearing a helmet in the classification branch. If it is determined that the target is not wearing a helmet, it further confirms whether the target is not wearing a helmet through the feature matching branch. Therefore, this method can reduce false identifications of the target not wearing a helmet, thereby improving the accuracy of helmet identification.

[0142] The foregoing has provided a detailed description of a method, apparatus, and medium for identifying the absence of a safety helmet, as provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0143] It should also be noted that, in this specification, 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.

Claims

1. A method of identifying non-wearing of a safety helmet, characterized by, The method comprises the following steps: obtaining a head-shoulder image of a target in a to-be-tested image, wherein the size of the head-shoulder image of the target is smaller than the size of the to-be-tested image; extracting features of the head-shoulder image; inputting the features of the head-shoulder image into a preset classification branch; wherein the network structure of the classification branch comprises: the overall structure of the network comprises: a backbone network, a classification branch and a feature matching branch; the backbone network is connected with two branches, one is the classification branch, and the other is the feature matching branch; the classification branch is used for classifying whether the head-shoulder image wears a safety helmet, and the feature matching branch is used for further filtering the result of the classification network; classifying and judging whether the head-shoulder image wears a safety helmet through the classification branch; in the case that the head-shoulder image is not classified as wearing a safety helmet, extracting a feature vector of the head-shoulder image through the feature matching branch; comparing the feature vector of the head-shoulder image with a feature vector of a sample image stored in a database in advance; in the case that the confidence of the feature comparison is less than a threshold value, identifying that the target does not wear a safety helmet.

2. The method of identifying non-wearing of a safety cap according to claim 1, wherein, The step of extracting the features of the head-shoulder image comprises: extracting global features of the head-shoulder image; correcting the head-shoulder image through an STN module, and extracting local features of the target in the head-shoulder image by using a forced segmentation feature module; splicing the global features of the head-shoulder image and the local features of the target in the head-shoulder image as the extracted features of the head-shoulder image.

3. The method of identifying non-wearing of a safety cap according to claim 2, wherein, The step of classifying and judging whether the head-shoulder image wears a safety helmet through the classification branch comprises: classifying and judging whether the head-shoulder image wears a safety helmet, wears other hats except the safety helmet, or does not wear a hat through the classification branch.

4. The method of identifying non-wearing of a safety cap according to claim 1, wherein, The step of obtaining the feature vector of the sample image stored in the database in advance comprises: obtaining at least images of each safety helmet style, images of wearing each safety helmet in different directions, different angles and different light intensities, and taking each obtained image as the sample image; sending each sample image into a feature extractor to obtain a corresponding feature vector of each sample image; storing the corresponding feature vector of each sample image into the database.

5. The method of identifying non-wearing of a safety cap according to claim 4, wherein, After identifying that the target does not wear a safety helmet in the case that the confidence of the feature comparison is less than the threshold value, the method further comprises the following steps: obtaining the head-shoulder image misclassified as not wearing a safety helmet; extracting features of the head-shoulder image misclassified as not wearing a safety helmet; adding the features of the head-shoulder image misclassified as not wearing a safety helmet to the database.

6. The method of identifying non-wearing of a safety cap according to claim 1, wherein, The step of obtaining the head-shoulder image of the target in the to-be-tested image comprises: detecting the head-shoulder position coordinates of the target in the to-be-tested image by using Yolov5; cutting out the head-shoulder image of the target from the to-be-tested image.

7. The method of identifying non-wearing of a safety cap according to any one of claims 1 to 6, characterized in that, After identifying that the target does not wear a safety helmet in the case that the confidence of the feature comparison is less than the threshold value, the method further comprises the following step: outputting prompt information for prompting not wearing a safety helmet.

8. A device for identifying non-wearing of a safety helmet, characterized by, The method comprises the following steps: an obtaining module is configured to obtain a head-shoulder image of a target in a to-be-tested image, wherein the size of the head-shoulder image of the target is smaller than the size of the to-be-tested image; a first extracting module is configured to extract features of the head-shoulder image; The input module is configured to input the features of the head-shoulder image into a preset classification branch; wherein, the network structure of the classification branch comprises: the overall structure of the network comprises: a backbone network, a classification branch, and a feature matching branch; the backbone network is connected with two branches, one is the classification branch, and the other is the feature matching branch; the classification branch is configured to classify whether the head-shoulder image wears a safety helmet, and the feature matching branch is configured to further filter the result of the classification network; The judgment module is configured to judge whether the head-shoulder image wears a safety helmet through the classification branch, and if not, trigger the second extraction module; The second extraction module is configured to extract the feature vector of the head-shoulder image through the feature matching branch when the head-shoulder image is not classified as wearing a safety helmet; The comparison module is configured to compare the extracted feature vector of the head-shoulder image with the feature vector of the sample image stored in the database in advance; The recognition module is configured to recognize that the target does not wear a safety helmet when the confidence of the feature comparison is less than a threshold.

9. A device for identifying non-wearing of a safety helmet, characterized by, The memory is configured to store a computer program; The processor is configured to execute the computer program to realize the steps of the method for recognizing the non-wearing of a safety helmet according to any one of claims 1 to 7. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the method for recognizing the non-wearing of a safety helmet according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Safety helmet recognition method and device, electronic equipment and storage medium

    CN111401278A

  • Construction site helmet wearing detection method and system

    CN111639552A