CN113408365A - Method and device for identifying safety helmet in complex scene - Google Patents

Method and device for identifying safety helmet in complex scene Download PDF

Info

Publication number
CN113408365A
CN113408365A CN202110579308.6A CN202110579308A CN113408365A CN 113408365 A CN113408365 A CN 113408365A CN 202110579308 A CN202110579308 A CN 202110579308A CN 113408365 A CN113408365 A CN 113408365A
Authority
CN
China
Prior art keywords
picture
safety helmet
safety
wearing state
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110579308.6A
Other languages
Chinese (zh)
Other versions
CN113408365B (en
Inventor
邹祥波
秦士伟
饶睦敏
叶骥
王群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Energy Group Science And Technology Research Institute Co Ltd
Original Assignee
Guangdong Energy Group Science And Technology Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Energy Group Science And Technology Research Institute Co Ltd filed Critical Guangdong Energy Group Science And Technology Research Institute Co Ltd
Priority to CN202110579308.6A priority Critical patent/CN113408365B/en
Publication of CN113408365A publication Critical patent/CN113408365A/en
Application granted granted Critical
Publication of CN113408365B publication Critical patent/CN113408365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The invention discloses a method and a device for identifying a safety helmet in a complex scene, wherein the method comprises the following steps: acquiring a safety helmet wearing state picture in a complex scene, and performing data annotation on the safety helmet wearing state picture to obtain an annotated picture; preprocessing the marked picture by adopting a picture processing method of illumination equalization to obtain a preprocessed picture; training a neural network model by adopting a preprocessed picture, and obtaining a safety helmet identification model by changing a network structure of the neural network model and adding an attention mechanism; the method comprises the steps of collecting a picture to be identified in a complex scene, inputting the picture to be identified into a safety helmet identification model, and identifying the wearing state of a safety helmet of a worker in the picture to be identified by adopting a TTA (time-to-arrival) method. The embodiment of the invention can effectively reduce the influence of actual environmental factors on the identification result in a complex scene, and can improve the accuracy of the identification of the safety helmet by modifying the network structure of the Yo lov neural network and fusing the attention mechanism.

Description

Method and device for identifying safety helmet in complex scene
Technical Field
The invention relates to the technical field of target detection, in particular to a method and a device for identifying a safety helmet in a complex scene.
Background
The safety helmet can play the role of buffering and damping, and is an essential safety tool for safety production workers and high-altitude operation personnel in all walks of life. The wearing relation of operation safety and safety helmets under complex scenes is closely related, the existing safety helmet identification method mainly aims at comprehensively utilizing each mainstream algorithm model to improve the detection identification rate of the safety helmets, and most of relevant researches aim at the safety helmet identification under the simple scenes, and influence of various factors of actual construction site environments on the safety helmet identification is not considered, so that the wearing condition of the safety helmets under the complex scenes is difficult to identify.
Disclosure of Invention
The invention provides a safety helmet identification method and device in a complex scene, and aims to solve the problem that the existing safety helmet identification method does not consider the influence of various factors of the actual construction site environment on safety helmet identification, so that the wearing condition of a safety helmet in the complex scene is difficult to identify.
The first embodiment of the invention provides a method for identifying a safety helmet in a complex scene, which comprises the following steps:
acquiring a safety helmet wearing state picture in a complex scene, and performing data annotation on the safety helmet wearing state picture to obtain an annotated picture;
preprocessing the marked picture by adopting a picture processing method of illumination equalization to obtain a preprocessed picture;
training a neural network model by adopting the preprocessed picture, and obtaining a safety helmet identification model by changing a network structure of the neural network model and adding an attention mechanism;
the method comprises the steps of collecting a picture to be identified in a complex scene, inputting the picture to be identified into a safety helmet identification model, and identifying the wearing state of a safety helmet of a worker in the picture to be identified by adopting a TTA method.
Further, the method further includes, between "acquiring a helmet wearing state picture in a complex scene, performing data annotation on the helmet wearing state picture to obtain an annotated picture" and "preprocessing the annotated picture by using a picture processing method of illumination equalization to obtain a preprocessed picture":
and carrying out clustering analysis on the detection frame of the marked picture by using a k-means clustering method, and randomly erasing the picture area of the marked picture by using a random-erasing data enhancement method.
Further, the pre-processing is performed on the labeled picture by using a picture processing method with illumination equalization to obtain a pre-processed picture, which specifically comprises:
performing brightness equalization processing on the marked picture, reading three RGB color channels of the marked picture, and converting the color channels into YUV color space;
selecting Y-channel information of the YUV color space, counting a Y-channel value of each pixel, and calculating the probability of the occurrence of preset brightness according to the Y-channel value;
and obtaining a brightness histogram according to the occurrence probability of each brightness, and carrying out normalization processing on the brightness histogram to obtain a preprocessed picture.
Further, the neural network is a Yolov5 model, the neural network model is trained by using the preprocessed pictures, and a helmet identification model is obtained by changing a network structure of the neural network model and adding an attention mechanism, specifically:
and adding a layer of SElayer in the network structure of the neural network model and adding a BackBone fused with an attention mechanism to obtain the safety helmet identification model.
Further, the method further comprises:
when the wearing state of the safety helmet is identified to be that the safety helmet is not worn, generating voice information prompt;
and when the wearing state of the safety helmet is recognized as the wearing state of the safety helmet, classifying the wearing safety helmet by adopting a machine learning method to obtain the color class of the wearing safety helmet.
Further, the step of classifying the worn safety helmet by using a machine learning method to obtain the color class of the worn safety helmet comprises the following steps:
detecting the position of a safety helmet in the preprocessed picture;
manufacturing a plurality of color category templates of the safety helmet;
selecting the upper half part of the worn safety helmet according to the position of the safety helmet, converting the upper half part of the worn safety helmet into the YUV color space, and respectively calculating Euclidean distances from the upper half part of the worn safety helmet to a plurality of color category templates;
and respectively comparing the European distances with the distance threshold range, and obtaining the color category of the safety helmet according to the comparison result.
Further, the comparing the european distances with the distance threshold ranges respectively, and obtaining the color category of the safety helmet according to the comparison result specifically include:
respectively comparing the Euclidean distances with a distance threshold range, and if at least one Euclidean distance is in the threshold range, selecting a color category template corresponding to the minimum Euclidean distance in the Euclidean distances as a final calculation result to obtain the color category of the safety helmet;
and if all the Euclidean distances are not within the distance threshold range, judging that the safety helmet is in other color categories.
A second embodiment of the present invention provides a device for identifying a helmet in a complex scene, including:
the data labeling module is used for acquiring a safety helmet wearing state picture in a complex scene, and performing data labeling on the safety helmet wearing state picture to obtain a labeled picture;
the pre-processing module is used for pre-processing the marked picture by adopting a picture processing method of illumination equalization to obtain a pre-processed picture;
the model training module is used for training a neural network model by adopting the preprocessed pictures, and obtaining a safety helmet identification model by changing the network structure of the neural network model and adding an attention mechanism;
the identification module is used for acquiring a picture to be identified in a complex scene, inputting the picture to be identified into the safety helmet identification model, and identifying the wearing state of the safety helmet of a worker in the picture to be identified by adopting a TTA (time to arrival) method.
The embodiment of the invention fully considers the influence of factors such as strong light, weak light, shielding and the like on the state identification of the safety helmet in a complex scene, adopts a picture processing method of illumination equalization to carry out data preprocessing, can effectively reduce the influence of actual environmental factors on an identification result in the complex scene, and thus can enable the safety helmet identification to be more accurate; according to the embodiment of the invention, the attention of the model on the space is more concentrated by modifying the network structure of the Yolov neural network and fusing the attention mechanism, so that the accuracy of identification is improved; the embodiment of the invention can improve the reliability of the safety helmet identification model by adding the TTA method.
Furthermore, after the safety helmet is recognized to be worn by a worker in a complex scene, the color types of the safety helmet can be further distinguished by manufacturing different color type templates of the safety helmet and calculating the Euclidean distance between the position of the safety helmet and the color type templates, and the management efficiency of the complex scene on the wearing state of the safety helmet is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for identifying a safety helmet in a complex scenario according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a neural network model structure provided by an embodiment of the present invention;
fig. 3 is another schematic flow chart of a method for identifying a safety helmet in a complex scenario according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a safety helmet identification device in a complex scenario according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.
In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Referring to fig. 1 to 3, in a first embodiment of the present invention, a method for identifying a safety helmet in a complex scenario shown in fig. 1 is provided, including:
s1, acquiring a helmet wearing state picture in a complex scene, and performing data annotation on the helmet wearing state picture to obtain an annotated picture;
in step S1, the embodiment of the present invention collects images of the wearing state of the crash helmet in a complex scene as a crash helmet data set, where the images of the wearing state of the crash helmet include an image of a worn crash helmet and an image of an unworn crash helmet. According to the invention, data is labeled by the safety helmet wearing state picture, so that data balance is ensured.
S2, preprocessing the marked picture by adopting a picture processing method of illumination equalization to obtain a preprocessed picture;
illustratively, the complex scene comprises a construction environment, and the problems of strong light, weak light and the like exist in a use environment.
S3, training the neural network model by adopting the preprocessed pictures, and obtaining a safety helmet identification model by changing the network structure of the neural network model and adding an attention mechanism;
according to the embodiment of the invention, the network structure of the neural network model is modified and the attention mechanism is fused, so that the attention of the trained helmet identification model in space is more concentrated, and the accuracy and the efficiency of the helmet wearing state identification can be improved.
S4, acquiring a picture to be recognized in a complex scene, inputting the picture to be recognized into a safety helmet recognition model, and recognizing the wearing state of the safety helmet of a worker in the picture to be recognized by adopting a TTA method.
Specifically, when the identification picture is used for identifying the wearing state of the safety helmet, the picture is randomly turned and zoomed by adopting a TTA method in a safety helmet identification model, and a final safety helmet wearing state identification result is obtained by comprehensively analyzing a plurality of results, so that the reliability of the identification of the wearing state of the safety helmet can be effectively improved.
As a specific implementation manner of the embodiment of the present invention, between "acquiring a helmet wearing state picture in a complex scene, performing data annotation on the helmet wearing state picture to obtain an annotated picture" and "performing preprocessing on the annotated picture by using a picture processing method with illumination equalization to obtain a preprocessed picture", the method further includes:
and performing clustering analysis on the detection frame of the marked picture by using a k-means clustering method, and performing random-erasing on the picture area of the marked picture by using a random-erasing data enhancement method.
In the embodiment of the invention, the detection frame of the marked picture is subjected to clustering analysis by using a k-means clustering method to obtain the size of the detection frame suitable for the wearing state identification of the safety helmet, so that the identification accuracy is improved. In addition, the random-erasing data enhancement method is adopted to randomly erase the image area of the marked image, so that the anti-blocking capability of the model can be effectively improved.
As a specific implementation manner of the embodiment of the present invention, the pre-processing is performed on the labeled picture by using a picture processing method with illumination equalization to obtain a pre-processed picture, which specifically includes:
performing brightness equalization processing on the marked picture, reading three RGB color channels of the marked picture, and converting the color channels into YUV color space;
YUV is a color coding method that is divided into three components, where "Y" denotes brightness and "U" and "V" denote chroma, which is used to describe the color of a given pixel affecting color and saturation. The embodiment of the invention converts the marked picture into the YUV color space, is favorable for balancing the brightness information of the marked picture, and can effectively reduce the influence of various factors on the state identification of the safety helmet in a complex environment.
Selecting Y-channel information of a YUV color space, counting a Y-channel value of each pixel, and calculating according to the Y-channel value to obtain the probability of the occurrence of preset brightness;
and obtaining a brightness histogram according to the probability of each brightness, and performing normalization processing on the brightness histogram to obtain a preprocessed picture.
Specifically, in one discrete picture { x }, the number of occurrences of the luminance i is represented by ni, i.e., the probability of occurrence of a pixel with luminance i in the picture is:
Figure BDA0003085441300000071
where L is the number of all the brightnesses in the picture (typically 256), n is the number of all the pixels in the picture, px (i) is in fact the image histogram with the pixel value i, normalized to [0,1 ].
The cumulative distribution function corresponding to px is defined as:
Figure BDA0003085441300000072
optionally, creating a transform of the form y ═ t (x), and generating a cumulative probability function of y for each value in the original image can be linearized across all ranges of values, where the conversion formula is defined as:
cdfy(i)=iK
as a specific implementation manner of the embodiment of the present invention, the neural network is a Yolov5 model, the neural network model is trained by using the preprocessed pictures, and the helmet identification model is obtained by changing a network structure of the neural network model and adding an attention mechanism, specifically:
and adding a layer of SElayer in the network structure of the neural network model and adding a BackBone fused with an attention mechanism to obtain the safety helmet identification model.
Specifically, when the preprocessed picture is input, a layer of SElayer is added to the network structure of the neural network model to pay attention to the importance degree of different channel characteristics. The added SElayer sequentially carries out average pooling and linear classification, and then learns the correlation among different channels through a Relu activation function and linear classification, so that the attention for the channels can be screened out.
Referring to fig. 2, in the embodiment of the present invention, after passing through the SElayer, the preprocessed picture sequentially passes through the Focus, the CBL, the CSP _1, the CBL, the CDP _3, the CBL, the CSP1_3, the CBL, and the SPP modules, the SElayer is added to the last layer of the BackBone, the convolved feature map is processed to obtain a one-dimensional vector having the same number as that of channels as an evaluation score of each channel, and then the evaluation scores are respectively applied to corresponding channels. After the preprocessed picture passes through a BackBone fused with an attention mechanism, the feature graph is transmitted into a YOLOv5-Neck structure to obtain a safety helmet identification model.
As a specific implementation manner of the embodiment of the present invention, the method further includes:
when the wearing state of the safety helmet is identified to be that the safety helmet is not worn, generating voice information prompt;
and when the wearing state of the safety helmet is recognized as the wearing state of the safety helmet, classifying the wearing safety helmet by adopting a machine learning method to obtain the color class of the wearing safety helmet.
Illustratively, the color classifications of the headgear include red, white, yellow, and blue.
As a specific implementation manner of the embodiment of the present invention, a machine learning method is adopted to classify the worn safety helmet, and the color class of the worn safety helmet is obtained, specifically:
detecting the position of a safety helmet in the preprocessed picture;
manufacturing a plurality of color category templates of the safety helmet;
in the embodiment of the invention, four full-white, full-red, full-yellow and full-blue pictures are selected as the color category templates
Selecting the upper half part of the worn safety helmet according to the position of the safety helmet, converting the upper half part of the worn safety helmet into a YUV color space, and respectively calculating Euclidean distances from the upper half part of the worn safety helmet to a plurality of color category templates;
and comparing the European distances with the distance threshold ranges respectively, and obtaining the color category of the safety helmet according to the comparison result.
According to the embodiment of the invention, four full-white, full-red, full-yellow and full-blue pictures are selected as the color category templates, and the color category of the safety helmet is accurately identified and obtained according to the Euclidean distance between the color category templates and the upper half part of the safety helmet position.
As a specific implementation manner of the embodiment of the present invention, the european distances are compared with the distance threshold ranges, and the color category of the safety helmet is obtained according to the comparison result, specifically:
respectively comparing the Euclidean distances with a distance threshold range, and if at least one Euclidean distance is in the threshold range, selecting a color category template corresponding to the minimum Euclidean distance in the Euclidean distances as a final calculation result to obtain the color category of the safety helmet;
and if all the Euclidean distances are not within the range of the distance threshold, judging that the safety helmet is in other color categories.
Please refer to fig. 3, which is another flow chart of a method for identifying a safety helmet in a complex scenario according to an embodiment of the present invention.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention fully considers the influence of factors such as strong light, weak light, shielding and the like on the state identification of the safety helmet in a complex scene, adopts a picture processing method of illumination equalization to carry out data preprocessing, can effectively reduce the influence of actual environmental factors on an identification result in the complex scene, and thus can enable the safety helmet identification to be more accurate; according to the embodiment of the invention, the attention of the model on the space is more concentrated by modifying the network structure of the Yolov neural network and fusing the attention mechanism, so that the accuracy of identification is improved; the embodiment of the invention can improve the reliability of the safety helmet identification model by adding the TTA method.
Furthermore, after the safety helmet is recognized to be worn by a worker in a complex scene, the color types of the safety helmet can be further distinguished by manufacturing different color type templates of the safety helmet and calculating the Euclidean distance between the position of the safety helmet and the color type templates, and the management efficiency of the complex scene on the wearing state of the safety helmet is improved.
Referring to fig. 4, a second embodiment of the present invention provides a device for identifying a safety helmet in a complex scenario, including:
the data labeling module 10 is used for acquiring a helmet wearing state picture in a complex scene, and performing data labeling on the helmet wearing state picture to obtain a labeled picture;
in step S1, the embodiment of the present invention collects images of the wearing state of the crash helmet in a complex scene as a crash helmet data set, where the images of the wearing state of the crash helmet include an image of a worn crash helmet and an image of an unworn crash helmet. According to the invention, data is labeled by the safety helmet wearing state picture, so that data balance is ensured.
The preprocessing module 20 is configured to preprocess the tagged picture by using a picture processing method of illumination equalization to obtain a preprocessed picture;
illustratively, the complex scene comprises a construction environment, and the problems of strong light, weak light and the like exist in a use environment.
The model training module 30 is used for training the neural network model by adopting the preprocessed pictures, and obtaining a safety helmet identification model by changing the network structure of the neural network model and adding an attention mechanism;
according to the embodiment of the invention, the network structure of the neural network model is modified and the attention mechanism is fused, so that the attention of the trained helmet identification model in space is more concentrated, and the accuracy and the efficiency of the helmet wearing state identification can be improved.
The identification module 40 is configured to acquire a picture to be identified in a complex scene, input the picture to be identified into the helmet identification model, and identify the wearing state of the helmet of a worker in the picture to be identified by using a TTA method.
Specifically, when the identification picture is used for identifying the wearing state of the safety helmet, the picture is randomly turned and zoomed by adopting a TTA method in a safety helmet identification model, and a final safety helmet wearing state identification result is obtained by comprehensively analyzing a plurality of results, so that the reliability of the identification of the wearing state of the safety helmet can be effectively improved.
As a specific implementation manner of the embodiment of the present invention, the preprocessing module 20 is further configured to:
and performing clustering analysis on the detection frame of the marked picture by using a k-means clustering method, and performing random-erasing on the picture area of the marked picture by using a random-erasing data enhancement method.
In the embodiment of the invention, the detection frame of the marked picture is subjected to clustering analysis by using a k-means clustering method to obtain the size of the detection frame suitable for the wearing state identification of the safety helmet, so that the identification accuracy is improved. In addition, the random-erasing data enhancement method is adopted to randomly erase the image area of the marked image, so that the anti-blocking capability of the model can be effectively improved.
As a specific implementation manner of the embodiment of the present invention, the preprocessing module 20 is further configured to:
performing brightness equalization processing on the marked picture, reading three RGB color channels of the marked picture, and converting the color channels into YUV color space;
YUV is a color coding method that is divided into three components, where "Y" denotes brightness and "U" and "V" denote chroma, which is used to describe the color of a given pixel affecting color and saturation. The embodiment of the invention converts the marked picture into the YUV color space, is favorable for balancing the brightness information of the marked picture, and can effectively reduce the influence of various factors on the state identification of the safety helmet in a complex environment.
Selecting Y-channel information of a YUV color space, counting a Y-channel value of each pixel, and calculating according to the Y-channel value to obtain the probability of the occurrence of preset brightness;
and obtaining a brightness histogram according to the probability of each brightness, and performing normalization processing on the brightness histogram to obtain a preprocessed picture.
Specifically, in one discrete picture { x }, the number of occurrences of the luminance i is represented by ni, i.e., the probability of occurrence of a pixel with luminance i in the picture is:
Figure BDA0003085441300000111
where L is the number of all the brightnesses in the picture (typically 256), n is the number of all the pixels in the picture, px (i) is in fact the image histogram with the pixel value i, normalized to [0,1 ].
The cumulative distribution function corresponding to px is defined as:
Figure BDA0003085441300000112
optionally, creating a transform of the form y ═ t (x), and generating a cumulative probability function of y for each value in the original image can be linearized across all ranges of values, where the conversion formula is defined as:
cdfy(i)=iK
as a specific implementation manner of the embodiment of the present invention, the neural network is a Yolov5 model, and the model training module 30 is specifically configured to:
and adding a layer of SElayer in the network structure of the neural network model and adding a BackBone fused with an attention mechanism to obtain the safety helmet identification model.
Specifically, when the preprocessed picture is input, a layer of SElayer is added to the network structure of the neural network model to pay attention to the importance degree of different channel characteristics. The added SElayer sequentially carries out average pooling and linear classification, and then learns the correlation among different channels through a Relu activation function and linear classification, so that the attention for the channels can be screened out.
Referring to fig. 2, in the embodiment of the present invention, after passing through the SElayer, the preprocessed picture sequentially passes through the Focus, the CBL, the CSP _1, the CBL, the CDP _3, the CBL, the CSP1_3, the CBL, and the SPP modules, the SElayer is added to the last layer of the BackBone, the convolved feature map is processed to obtain a one-dimensional vector having the same number as that of channels as an evaluation score of each channel, and then the evaluation scores are respectively applied to corresponding channels. After the preprocessed picture passes through a BackBone fused with an attention mechanism, the feature graph is transmitted into a YOLOv5-Neck structure to obtain a safety helmet identification model.
As a specific implementation manner of the embodiment of the present invention, the identification module 40 is further configured to:
when the wearing state of the safety helmet is identified to be that the safety helmet is not worn, generating voice information prompt;
and when the wearing state of the safety helmet is recognized as the wearing state of the safety helmet, classifying the wearing safety helmet by adopting a machine learning method to obtain the color class of the wearing safety helmet.
Illustratively, the color classifications of the headgear include red, white, yellow, and blue.
As a specific implementation manner of the embodiment of the present invention, a machine learning method is adopted to classify the worn safety helmet, and the color class of the worn safety helmet is obtained, specifically:
detecting the position of a safety helmet in the preprocessed picture;
manufacturing a plurality of color category templates of the safety helmet;
in the embodiment of the invention, four full-white, full-red, full-yellow and full-blue pictures are selected as the color category templates
Selecting the upper half part of the worn safety helmet according to the position of the safety helmet, converting the upper half part of the worn safety helmet into a YUV color space, and respectively calculating Euclidean distances from the upper half part of the worn safety helmet to a plurality of color category templates;
and comparing the European distances with the distance threshold ranges respectively, and obtaining the color category of the safety helmet according to the comparison result.
According to the embodiment of the invention, four full-white, full-red, full-yellow and full-blue pictures are selected as the color category templates, and the color category of the safety helmet is accurately identified and obtained according to the Euclidean distance between the color category templates and the upper half part of the safety helmet position.
As a specific implementation manner of the embodiment of the present invention, the european distances are compared with the distance threshold ranges, and the color category of the safety helmet is obtained according to the comparison result, specifically:
respectively comparing the Euclidean distances with a distance threshold range, and if at least one Euclidean distance is in the threshold range, selecting a color category template corresponding to the minimum Euclidean distance in the Euclidean distances as a final calculation result to obtain the color category of the safety helmet;
and if all the Euclidean distances are not within the range of the distance threshold, judging that the safety helmet is in other color categories.
Please refer to fig. 3, which is another flow chart of a method for identifying a safety helmet in a complex scenario according to an embodiment of the present invention.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention fully considers the influence of factors such as strong light, weak light, shielding and the like on the state identification of the safety helmet in a complex scene, adopts a picture processing method of illumination equalization to carry out data preprocessing, can effectively reduce the influence of actual environmental factors on an identification result in the complex scene, and thus can enable the safety helmet identification to be more accurate; according to the embodiment of the invention, the attention of the model on the space is more concentrated by modifying the network structure of the Yolov neural network and fusing the attention mechanism, so that the accuracy of identification is improved; the embodiment of the invention can improve the reliability of the safety helmet identification model by adding the TTA method.
Furthermore, after the safety helmet is recognized to be worn by a worker in a complex scene, the color types of the safety helmet can be further distinguished by manufacturing different color type templates of the safety helmet and calculating the Euclidean distance between the position of the safety helmet and the color type templates, and the management efficiency of the complex scene on the wearing state of the safety helmet is improved.
The foregoing is a preferred embodiment of the present invention, and it should be noted that it would be apparent to those skilled in the art that various modifications and enhancements can be made without departing from the principles of the invention, and such modifications and enhancements are also considered to be within the scope of the invention.

Claims (8)

1. A safety helmet identification method under a complex scene is characterized by comprising the following steps:
acquiring a safety helmet wearing state picture in a complex scene, and performing data annotation on the safety helmet wearing state picture to obtain an annotated picture;
preprocessing the marked picture by adopting a picture processing method of illumination equalization to obtain a preprocessed picture;
training a neural network model by adopting the preprocessed picture, and obtaining a safety helmet identification model by changing a network structure of the neural network model and adding an attention mechanism;
the method comprises the steps of collecting a picture to be identified in a complex scene, inputting the picture to be identified into a safety helmet identification model, and identifying the wearing state of a safety helmet of a worker in the picture to be identified by adopting a TTA method.
2. The method for identifying safety helmets under complex scenes according to claim 1, wherein the method further comprises the steps of, between "acquiring a picture of wearing states of safety helmets under complex scenes, labeling the picture of wearing states of safety helmets with data to obtain a labeled picture" and "preprocessing the labeled picture by using a picture processing method of illumination equalization to obtain a preprocessed picture":
and carrying out clustering analysis on the detection frame of the marked picture by using a k-means clustering method, and randomly erasing the picture area of the marked picture by using a random-erasing data enhancement method.
3. The method for identifying a safety helmet in a complex scene as claimed in claim 1, wherein the pre-processing is performed on the labeled picture by using a picture processing method of illumination equalization to obtain a pre-processed picture, specifically:
performing brightness equalization processing on the marked picture, reading three RGB color channels of the marked picture, and converting the color channels into YUV color space;
selecting Y-channel information of the YUV color space, counting a Y-channel value of each pixel, and calculating the probability of the occurrence of preset brightness according to the Y-channel value;
and obtaining a brightness histogram according to the occurrence probability of each brightness, and carrying out normalization processing on the brightness histogram to obtain a preprocessed picture.
4. The method for identifying a safety helmet in a complex scene according to claim 1, wherein the neural network is a Yolov5 model, the neural network model is trained by using the preprocessed pictures, and the safety helmet identification model is obtained by changing a network structure of the neural network model and adding an attention mechanism, specifically:
and adding a layer of SElayer in the network structure of the neural network model and adding a BackBone fused with an attention mechanism to obtain the safety helmet identification model.
5. The method for identifying safety helmets under complex scenes according to claim 1, further comprising:
when the wearing state of the safety helmet is identified to be that the safety helmet is not worn, generating voice information prompt;
and when the wearing state of the safety helmet is recognized as the wearing state of the safety helmet, classifying the wearing safety helmet by adopting a machine learning method to obtain the color class of the wearing safety helmet.
6. The method for identifying safety helmets under complex scenes according to claim 5, wherein the machine learning method is used for classifying the worn safety helmets to obtain the color classes of the worn safety helmets, and the method specifically comprises the following steps:
detecting the position of a safety helmet in the preprocessed picture;
manufacturing a plurality of color category templates of the safety helmet;
selecting the upper half part of the worn safety helmet according to the position of the safety helmet, converting the upper half part of the worn safety helmet into the YUV color space, and respectively calculating Euclidean distances from the upper half part of the worn safety helmet to a plurality of color category templates;
and respectively comparing the European distances with the distance threshold range, and obtaining the color category of the safety helmet according to the comparison result.
7. The method for identifying a safety helmet in a complex scene according to claim 6, wherein the comparing the euclidean distances with the distance threshold ranges respectively obtains the color class of the safety helmet according to the comparison result, specifically:
respectively comparing the Euclidean distances with a distance threshold range, and if at least one Euclidean distance is in the threshold range, selecting a color category template corresponding to the minimum Euclidean distance in the Euclidean distances as a final calculation result to obtain the color category of the safety helmet;
and if all the Euclidean distances are not within the distance threshold range, judging that the safety helmet is in other color categories.
8. A safety helmet identification device under complex scene, characterized by comprising:
the data labeling module is used for acquiring a safety helmet wearing state picture in a complex scene, and performing data labeling on the safety helmet wearing state picture to obtain a labeled picture;
the pre-processing module is used for pre-processing the marked picture by adopting a picture processing method of illumination equalization to obtain a pre-processed picture;
the model training module is used for training a neural network model by adopting the preprocessed pictures, and obtaining a safety helmet identification model by changing the network structure of the neural network model and adding an attention mechanism;
the identification module is used for acquiring a picture to be identified in a complex scene, inputting the picture to be identified into the safety helmet identification model, and identifying the wearing state of the safety helmet of a worker in the picture to be identified by adopting a TTA (time to arrival) method.
CN202110579308.6A 2021-05-26 2021-05-26 Safety helmet identification method and device under complex scene Active CN113408365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110579308.6A CN113408365B (en) 2021-05-26 2021-05-26 Safety helmet identification method and device under complex scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110579308.6A CN113408365B (en) 2021-05-26 2021-05-26 Safety helmet identification method and device under complex scene

Publications (2)

Publication Number Publication Date
CN113408365A true CN113408365A (en) 2021-09-17
CN113408365B CN113408365B (en) 2023-09-08

Family

ID=77675373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110579308.6A Active CN113408365B (en) 2021-05-26 2021-05-26 Safety helmet identification method and device under complex scene

Country Status (1)

Country Link
CN (1) CN113408365B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103325114A (en) * 2013-06-13 2013-09-25 同济大学 Target vehicle matching method based on improved vision attention model
KR101715001B1 (en) * 2015-12-30 2017-03-23 연세대학교 산학협력단 Display system for safety evaluation in construction sites using of wearable device, and thereof method
US20170132821A1 (en) * 2015-11-06 2017-05-11 Microsoft Technology Licensing, Llc Caption generation for visual media
CN109766869A (en) * 2019-01-23 2019-05-17 中国建筑第八工程局有限公司 A kind of artificial intelligent detecting method of safety cap wearing based on machine vision
CN109886325A (en) * 2019-02-01 2019-06-14 辽宁工程技术大学 A kind of stencil-chosen and acceleration matching process of non linear color space classification
CN110070033A (en) * 2019-04-19 2019-07-30 山东大学 Safety cap wearing state detection method in a kind of power domain dangerous work region
CN110188724A (en) * 2019-06-05 2019-08-30 中冶赛迪重庆信息技术有限公司 The method and system of safety cap positioning and color identification based on deep learning
WO2020019673A1 (en) * 2018-07-25 2020-01-30 深圳云天励飞技术有限公司 Construction site monitoring method and device based on image analysis, and readable storage medium
CN111680682A (en) * 2020-06-12 2020-09-18 哈尔滨理工大学 Method for identifying safety helmet in complex scene
CN112184773A (en) * 2020-09-30 2021-01-05 华中科技大学 Helmet wearing detection method and system based on deep learning
CN112232307A (en) * 2020-11-20 2021-01-15 四川轻化工大学 Method for detecting wearing of safety helmet in night vision environment
CN112381005A (en) * 2020-11-17 2021-02-19 温州大学 Safety helmet detection system for complex scene
CN112560741A (en) * 2020-12-23 2021-03-26 中国石油大学(华东) Safety wearing detection method based on human body key points

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103325114A (en) * 2013-06-13 2013-09-25 同济大学 Target vehicle matching method based on improved vision attention model
US20170132821A1 (en) * 2015-11-06 2017-05-11 Microsoft Technology Licensing, Llc Caption generation for visual media
KR101715001B1 (en) * 2015-12-30 2017-03-23 연세대학교 산학협력단 Display system for safety evaluation in construction sites using of wearable device, and thereof method
WO2020019673A1 (en) * 2018-07-25 2020-01-30 深圳云天励飞技术有限公司 Construction site monitoring method and device based on image analysis, and readable storage medium
CN109766869A (en) * 2019-01-23 2019-05-17 中国建筑第八工程局有限公司 A kind of artificial intelligent detecting method of safety cap wearing based on machine vision
CN109886325A (en) * 2019-02-01 2019-06-14 辽宁工程技术大学 A kind of stencil-chosen and acceleration matching process of non linear color space classification
CN110070033A (en) * 2019-04-19 2019-07-30 山东大学 Safety cap wearing state detection method in a kind of power domain dangerous work region
CN110188724A (en) * 2019-06-05 2019-08-30 中冶赛迪重庆信息技术有限公司 The method and system of safety cap positioning and color identification based on deep learning
CN111680682A (en) * 2020-06-12 2020-09-18 哈尔滨理工大学 Method for identifying safety helmet in complex scene
CN112184773A (en) * 2020-09-30 2021-01-05 华中科技大学 Helmet wearing detection method and system based on deep learning
CN112381005A (en) * 2020-11-17 2021-02-19 温州大学 Safety helmet detection system for complex scene
CN112232307A (en) * 2020-11-20 2021-01-15 四川轻化工大学 Method for detecting wearing of safety helmet in night vision environment
CN112560741A (en) * 2020-12-23 2021-03-26 中国石油大学(华东) Safety wearing detection method based on human body key points

Also Published As

Publication number Publication date
CN113408365B (en) 2023-09-08

Similar Documents

Publication Publication Date Title
CN110163114B (en) Method and system for analyzing face angle and face blurriness and computer equipment
CN110502965B (en) Construction safety helmet wearing monitoring method based on computer vision human body posture estimation
CN110837784B (en) Examination room peeping and cheating detection system based on human head characteristics
US8351662B2 (en) System and method for face verification using video sequence
CN111881730A (en) Wearing detection method for on-site safety helmet of thermal power plant
US20090034791A1 (en) Image processing for person and object Re-identification
US20070154088A1 (en) Robust Perceptual Color Identification
CN109753904A (en) A kind of face identification method and system
KR20170006355A (en) Method of motion vector and feature vector based fake face detection and apparatus for the same
CN113516076A (en) Improved lightweight YOLO v4 safety protection detection method based on attention mechanism
CN111209818A (en) Video individual identification method, system, equipment and readable storage medium
CN111008971B (en) Aesthetic quality evaluation method of group photo image and real-time shooting guidance system
CN112163572A (en) Method and device for identifying object
CN115841488B (en) PCB hole inspection method based on computer vision
CN115035088A (en) Helmet wearing detection method based on yolov5 and posture estimation
CN110991256A (en) System and method for carrying out age estimation and/or gender identification based on face features
CN113076886A (en) Face individual identification device and method for cat
CN113221667B (en) Deep learning-based face mask attribute classification method and system
Hirzi et al. Literature study of face recognition using the viola-jones algorithm
CN113408365B (en) Safety helmet identification method and device under complex scene
CN113903074B (en) Eye attribute classification method, device and storage medium
CN113450369B (en) Classroom analysis system and method based on face recognition technology
CN115273150A (en) Novel identification method and system for wearing safety helmet based on human body posture estimation
Hemdan et al. Facial features-based method for human tracking
CN114332675A (en) Part picking sensing method for augmented reality auxiliary assembly

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant