Helmet recognition method and storage medium based on weakly supervised collaborative learning algorithm
Through weak supervision collaborative learning algorithm, combined with image-level labels and bounding box-level labels, real-time identification and early warning of people wearing safety helmets on construction sites is achieved, and the cost of manual inspection and deep learning training sample labels in the existing technology is solved. High problems improve detection efficiency and accuracy.
Patent Information
- Application Number
- CN202011042403.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-09-28
AI Technical Summary
In the prior art, construction site safety helmet inspection mainly relies on manual inspection or supervised algorithms based on deep learning. The former consumes human resources, while the latter has high training sample label requirements and high generation cost, which cannot effectively solve whether people on the construction site wear safety helmets. The problem.
Adopt the safety helmet recognition method based on weakly supervised collaborative learning algorithm, train the network through image-level tags, combine the convolutional layer and the ROI pooling layer to extract features, generate bounding box-level tags, and use continuous multi-instance learning and predict consistency losses to achieve Real-time analysis and alarm on the wearing of hard helmets.
Reduced the requirements for training sample labels, improved detection efficiency, reduced manual marking costs, and realized real-time identification and early warning of people wearing safety helmets on construction sites. It has both weak supervision and efficient training ability, and has supervised inspection. Accuracy.
Smart Images

Figure CN112183532B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of depth recognition and target recognition, and in particular relates to a helmet recognition method and a storage medium based on a weakly supervised collaborative learning algorithm. Background Art
[0002] Considering the safety of construction sites, every person entering the site is required to wear a helmet. As the last line of defense, the helmet plays an important role. However, people entering the construction site often do not wear helmets due to laziness, forgetfulness or fluke mentality, which poses a huge risk of danger and injury. Therefore, helmet detection and identification reminders are particularly important for the safety precautions of construction sites. Only by detecting and warning whether the on-the-job workers wear helmets as required and take safety precautions can we truly achieve information management of safe production, prevent beforehand, monitor during the process, and standardize management afterwards.
[0003] The usual way to detect whether construction site workers are wearing helmets is to conduct detection at the entrance, but it is difficult to detect whether workers are wearing helmets in the construction site area. Currently, the common detection methods are as follows:
[0004] (1) Manual inspection: assigning personnel to guard and inspect at each entrance of the construction site and arranging personnel to patrol and inspect in the construction site area. However, this method consumes human resources and there is a possibility of omissions in the inspection.
[0005] (2) Use sensors, chips or tags for reminders. Place these sensing devices in the hard hat. When workers or visitors wear hard hats to enter the construction site, the access control reader will identify the sensors, chips or tags in the hard hat. If they are not wearing them, the system reminder will be triggered. Although this method can detect without omission at the entrance, it cannot detect whether the personnel are wearing them correctly. If they are simply carrying them without wearing them, it cannot be detected. At the same time, this detection method can only be performed at the entrance. Once entering the construction site, this method will fail and human detection is still required.
[0006] (3) Detection of helmet wearing behavior based on computer video image recognition. Cameras are installed at each entrance and important location of the construction site. Based on the video footage captured by the camera, a computer video image recognition algorithm is used to detect the position of the construction worker's head and helmet in the video, and then determine whether the helmet is worn, so as to achieve real-time detection and early warning of the construction worker's helmet wearing behavior. This method uses computers for image processing and recognition, which not only saves labor and sensor costs, but also improves detection accuracy and efficiency. It is the current mainstream method, and most of these methods are based on deep learning algorithms and can be roughly divided into two categories: the first category, two-stage algorithms, first generate candidate regions (region proposals), and then use convolutional neural networks (CNN) for classification. Typical representatives of this type of algorithm include R-CNN, Fast R-CNN and Faster R-CNN. The second category, one-stage algorithms, directly generate the category and position coordinate value of the object. Typical algorithms of this type include YOLO and SSD.
[0007] The above-mentioned construction site helmet detection algorithms based on deep learning all use supervised algorithms, such as Chinese patent number CN201810913181 A method and system for detecting helmets in a dynamic background, CN201811570198 A method and device for identifying helmets, CN201910300441 A method and device for identifying helmets based on deep learning, and CN201910484745 A method and system for positioning and color recognition of helmets based on deep learning. A supervised algorithm is used, that is, a deep learning algorithm network is trained through labeled training samples (i.e., labeled helmet images), so as to obtain an optimal algorithm model, and then this model is used to identify and judge new construction site helmet image data to achieve the purpose of detection. The biggest problem in this process is that the cost of generating training samples is too high. The labeling requirements of the training sample images of supervised algorithms are very high. The training target objects in the image must not only give the object category, but also information such as location coordinates. This is a bounding-box level label, and these labels are usually manually marked, which is a time-consuming and labor-intensive process.
[0008] In addition, although the industry is also conducting research on unsupervised algorithms, that is, using unlabeled training samples to train deep learning algorithm networks, the learning process is too complex and difficult, and the technology has developed very slowly and has not made any breakthroughs. The weakly supervised algorithm came into being as a compromise between supervised and unsupervised algorithms. Its training samples are only image-level labels (that is, the labels only contain the categories of objects in the picture), rather than time-consuming and labor-intensive bounding-box-level labels. This ensures that the learning and training process is simple and easy to operate, and improves the efficiency of the algorithm. It is an ideal choice for construction site helmet detection algorithms, but there are no relevant research results yet.
[0009] In response to the above problems, the present invention designs a construction site safety helmet recognition method based on a weakly supervised collaborative learning algorithm, provides real-time warnings for dangerous behaviors of not wearing safety helmets through real-time video analysis and warnings, and saves alarm screenshots and videos to a database to form reports. This is a technical problem that urgently needs to be solved. Summary of the invention
[0010] One of the purposes of the present invention is to overcome the above shortcomings and provide a helmet recognition method based on a weakly supervised collaborative learning algorithm, which can perform real-time analysis, identification, tracking and alarm on whether personnel in the production area of a construction site are wearing helmets.
[0011] In order to solve the above technical problems, the present invention provides a helmet recognition method based on a weakly supervised collaborative learning algorithm, comprising the following steps:
[0012] Step 1: Use image-level labeled images to train the weakly supervised collaborative learning algorithm network;
[0013] Step 2: Input the image to be detected into the trained weakly supervised collaborative learning algorithm network to perform target detection and obtain a probability vector;
[0014] Step 3: Determine whether the person in the image to be detected is wearing a helmet correctly based on the probability vector.
[0015] Furthermore, the method of using image-level label samples to train the weakly supervised collaborative learning algorithm network includes the following steps:
[0016] Step 11: extract features of the image-level label image through the convolution layer and the ROI pooling layer to obtain a training picture package containing sample instances;
[0017] Step 12: The weakly supervised learning module is trained according to the training picture package and generates a first instance subset of bounding box level label images;
[0018] Step 13: The supervised learning module performs training based on the training picture package and the first instance subset of the bounding box level label image and generates a second instance subset of the bounding box level label image;
[0019] Step 14: The supervised learning module calculates consistency loss for the first instance subset of the bounding box level label image and the second instance subset of the bounding box level label image, and updates the network parameters of the supervised learning module according to the calculation results.
[0020] Furthermore, the weakly supervised learning module is trained according to the training picture package and generates a first result set of bounding box level label images, including the following steps:
[0021] Step 121, a continuous instance selector divides the sample instances in the training image package into subsets;
[0022] Step 122: The continuous evaluator evaluates the sample instances in the training picture package according to the result of dividing the sample instance subsets of the training picture package;
[0023] Step 123: Use the evaluated training picture package as a first result set of bounding box level label images.
[0024] Furthermore, the continuous instance selector performs subset division on the sample instances in the training picture package, comprising the following steps:
[0025] Step 1211: The continuous instance selector calculates the score of each sample instance in the training image package. The calculation formula of the score is: S(t i,j ,σ s )=σ s T (FV b -FV f ), where t ij represents the jth sample instance in the i-th bag, σ s is the network parameter of the instance selector, FV b is the sample instance t ij Fisher vector of medium background, FV f is the sample instance t ij Fisher vector in the middle foreground;
[0026] Step 1212: Select a sample instance with the highest score and not belonging to any bounding box level label image instance subset from all sample instances in the training picture package, and establish a new bounding box level label image instance subset;
[0027] Step 1213: classify the sample instances whose overlapping area with the sample instance image with the highest score in step 1211 is greater than or equal to τ and which do not belong to any bounding box level label image instance subset into the same bounding box level label image instance subset, where τ represents a continuous parameter and has a value range of [0,1];
[0028] Step 1214: Calculate the objective function value of the continuous instance selector according to the established bounding box level label image instance subset. The objective function of the continuous instance selector is:
[0029]
[0030] Among them, t i represents the i-th training picture package, t i,β(τ) represents the β(τ)th instance subset in the ith bag, σ s is the network parameter of the instance selector, l i Represents the positive and negative signs of the i-th training image package, N β(τ) is the instance subset t i,β(τ) The number of instances in t i,j ∈t i,β(τ) ;
[0031] Step 1215: determine whether the objective function value of the continuous instance selector is greater than a preset threshold;
[0032] Step 1216: If the objective function value of the continuous instance selector is less than or equal to the preset threshold, jump to step 1212 to continue execution;
[0033] Step 1217: If the objective function value of the continuous instance selector is greater than a preset threshold, the subset division is completed.
[0034] Furthermore, the continuous evaluator evaluates the sample instances in the training picture package according to the result of dividing the sample instance subsets of the training picture package, and the evaluation formula is:
[0035]
[0036] Among them, the IOU function represents the intersection-over-union ratio between two sample instances, t ij represents the jth sample instance in the i-th package, l ij Represents sample instance t ij The positive and negative signs of t i,j* Represents the sample instance subset t with the highest score i,β(τ)* The sample instance with the highest score in , τ represents a continuous parameter, and its value range is [0,1].
[0037] Furthermore, the prediction consistency loss is calculated using the following formula:
[0038]
[0039] Among them, L c is the consistency loss, x ws represents the bounding box level label image sample instance obtained by the weakly supervised learning module, x s The bounding box level label image sample instance obtained by the supervised learning module, the IOU function represents the intersection-over-union ratio between two sample instances.
[0040] Furthermore, the probability vector includes: a probability value that the object in the image to be detected is identified as a helmet, a probability value that the object in the image to be detected is identified as a person, and position coordinate information of the object in the image to be detected.
[0041] Further, the determining whether the person in the image to be detected is wearing a helmet correctly according to the probability vector comprises the following steps:
[0042] If the probability value of the object in the image to be detected being recognized as a person and the probability value of the object being recognized as a helmet are greater than a fixed threshold and the helmet is located on the top of the person's head, it is determined that the person in the image to be detected is wearing the helmet correctly, otherwise it is determined that the person in the image is not wearing the helmet correctly.
[0043] Accordingly, the present application also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of the helmet recognition methods based on weakly supervised collaborative learning algorithms in the above claims.
[0044] The beneficial effects of the technical solution of the present invention are:
[0045] 1. The technical solution of this application adopts a weakly supervised deep learning algorithm, which only requires image-level labeled sample pictures for training, greatly reducing the requirements for training sample pictures, reducing the time for manual processing of training sample pictures, and improving work efficiency.
[0046] 2. The weakly supervised deep learning algorithm of the present application adopts an improved continuous multi-instance learning method, which smoothes the objective function of the multi-instance learning method and converts it into multiple sub-problems that are easier to solve, so that the objective functions of multiple sub-problems are combined to approximate the final objective function. It can better solve the non-convexity of the weakly supervised objective function and avoid the model from falling into the local minimum too early, thereby obtaining better optimization results.
[0047] 3. The weakly supervised collaborative learning algorithm in the technical solution of the present application adopts a new collaborative learning framework, which connects the weakly supervised detection subnetwork and the supervised detection subnetwork into a unified whole during the weakly supervised learning process, and uses the prediction consistency loss to strengthen the instance prediction consistency of the two detection subnetworks. In this way, the weakly supervised collaborative learning algorithm has both the ability to efficiently train the network with weak supervision and the precise detection accuracy of the supervised algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 The present invention is a flowchart of the steps of a helmet recognition method based on a weakly supervised collaborative learning algorithm.
[0049] Figure 2 It is a flow chart of the steps of training a weakly supervised collaborative learning algorithm network using image-level label samples in the present invention.
[0050] Figure 3 It is a flowchart of the steps of the weakly supervised learning module of the present invention performing training according to the training picture package and generating a first result set of bounding box level label images.
[0051] Figure 4 It is a flow chart of the steps of the continuous instance selector of the present invention for dividing the sample instances in the training picture package into subsets. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] like Figure 1 As shown, it is a flowchart of a method for identifying a helmet based on a weakly supervised collaborative learning algorithm of the present invention, comprising the following steps:
[0054] Step 1: Use image-level labeled images to train the weakly supervised collaborative learning algorithm network;
[0055] In the field of deep learning and target recognition technology, images used for training can be divided into image-level labeled images and bounding-box level labeled images. Image-level labeled images refer to images used for training, where we only know that they contain people or helmets, but we don’t know the specific positions of the people or helmets in the image. Bounding-box level labeled images not only know that they contain people or helmets, but also know the specific positions of each person or helmet in the image. Therefore, bounding-box level labeled image training samples are usually manually marked with the positions of people or helmets, which is time-consuming, labor-intensive and inefficient. Figure 2 As shown, the present invention uses image-level label samples to train the weakly supervised collaborative learning algorithm network, including the following steps:
[0056] Step 11: extract features of the image-level label image through the convolution layer and the ROI pooling layer to obtain a training picture package containing sample instances;
[0057] The image-level labeled image used for training is sent to the convolution layer. The convolution layer extracts candidate regions containing important features of different targets (people or helmets) based on the input image, and then sends the result to the pooling layer, which converts candidate regions of different sizes into fixed-size outputs for post-training. The output of the pooling layer is a training picture package containing sample instances. For example, each input image-level labeled image used for training generates a corresponding training picture package, and each sample instance in the training picture package corresponds to a candidate region in the image that is a person or a helmet, also called a sample instance.
[0058] Step 12: The weakly supervised learning module is trained according to the training picture package and generates a first instance subset of bounding box level label images; Figure 3 As shown, it is a flowchart of the steps of the weakly supervised learning module of the present invention training according to the training picture package and generating a first result set of bounding box level label images, including the following steps:
[0059] Step 121, a continuous instance selector divides the sample instances in the training image package into subsets;
[0060] Assume that T is defined to represent the bag of all training images, t i ∈T represents the i-th training picture package, l i Represents the positive and negative sign of the i-th training image package. When it is 1, it means t i is a positive sample package, i.e., t i contains at least one positive sample instance, for example, at least one sample instance of a person or a helmet. When it is -1, it means ti is a negative sample bag, i.e., t i All the sample instances contained in are negative sample instances, for example, sample instances that do not contain people or helmets at all. i,j represents the jth sample instance in the i-th package, l i,j It means t i,j The positive and negative flags of the sample instance, when it is 1, it indicates that the sample instance is a positive sample instance, and when it is -1, it indicates that the sample instance is a negative sample instance. The technical solution of the present application requires dividing the sample instances in the training image package into multiple subsets, each subset representing a set of similar sample instances, for example, one subset is a set of face regions, and another subset is a set of helmet regions. Figure 4 FIG. 1 is a flow chart showing the steps of performing subset division on the sample instances in the training picture package by the continuous instance selector of the present invention, including the following steps:
[0061] Step 1211, the continuous instance selector calculates the score of each sample instance in the training image package. The score here is the object score calculated for each sample instance, that is, the score of the sample instance belonging to a specific object (face or helmet), which is calculated using the continuous instance selector. The calculation formula of the score is: S(t i,j ,σ s )=σ s T (FV b -FV f ), where t ij represents the jth sample instance in the i-th bag, σ s is the network parameter of the instance selector, FV b is the sample instance t ij Fisher vector of medium background, FV f is the sample instance t ij Fisher vector in the middle foreground;
[0062] Step 1212: Select a sample instance with the highest score and not belonging to any bounding box level label image instance subset from all sample instances in the training picture package, and establish a new bounding box level label image instance subset;
[0063] Step 1213: classify the sample instances whose overlapping area with the sample instance image with the highest score in step 1211 is greater than or equal to τ and which do not belong to any bounding box level label image instance subset into the same bounding box level label image instance subset, where τ represents a continuous parameter and has a value range of [0,1];
[0064] Step 1214: Calculate the objective function value of the continuous instance selector according to the established bounding box level label image instance subset. The objective function of the continuous instance selector is:
[0065]
[0066] Among them, t i represents the i-th training picture package, t i,β(τ) represents the β(τ)th instance subset in the ith bag, σ s is the network parameter of the instance selector, l i Represents the positive and negative signs of the i-th training image package, N β(τ) is the instance subset t i,β(τ) The number of instances in t i,j ∈t i,β(τ) , through the continuous instance selector S(t i,β(τ) ,σ s ) calculate the subset t i,β(τ) When τ=0, the score of i is divided into a subset containing all instances; when τ = 1, the i is divided into multiple subsets, each with only one instance; when 0<τ<1, each package has multiple subsets. This objective function is smoother than the objective function of the instance selector of traditional multi-instance learning. Such smoothness can greatly alleviate the non-convex problem. By optimizing this objective function, a better solution can be found, and finally the instance subset with the highest score t is obtained. i,β(τ)* ;
[0067] Step 1215: determine whether the objective function value of the continuous instance selector is greater than a preset threshold;
[0068] Step 1216: If the objective function value of the continuous instance selector is less than or equal to the preset threshold, jump to step 1212 to continue execution;
[0069] Step 1217: If the objective function value of the continuous instance selector is greater than a preset threshold, the subset division is completed.
[0070] Most traditional weakly supervised deep learning algorithms use a multi-instance learning method, which regards each image as a bag and the objects in the image as an instance. During the training process, the candidate region (proposal) with the highest score is iteratively selected from the bag for network training. Since the weakly supervised supervision information only indicates whether the image contains image-level information of objects of the corresponding category, there is randomness in the positioning of instances. The objective function describing the selection of candidate regions is prone to non-convexity in the early learning stage, and optimizing this objective function will fall into a local minimum, causing it to only detect part of the area and ignore the complete range.
[0071] The weakly supervised deep learning algorithm of this technical solution adopts an improved continuous multi-instance learning method, and introduces a continuous optimization method based on the traditional multi-instance learning method. The purpose is to better solve the non-convexity of the weakly supervised target detection problem, effectively divide the instance candidate area in the image, divide the spatially related and category-related instances into a subset, and define the corresponding smooth objective function on the corresponding subset. The objective functions of different subsets jointly approximate the original objective function to obtain better optimization results. It smoothes the objective function of the multi-instance learning method and converts it into multiple sub-problems that are easier to solve, so that the objective functions of multiple sub-problems jointly approximate the final objective function, which can better solve the non-convexity of the weakly supervised objective function and avoid the model from falling into a local minimum too early, thereby obtaining better optimization results.
[0072] Step 122, the continuous evaluator evaluates the sample instances in the training picture package according to the sample instance subset division result of the training picture package; the role of the continuous evaluator is to further evaluate the positive and negative sign results of each sample instance based on the sample instance subset selected by the continuous instance selector, exclude some errors or interference backgrounds, and further improve the accuracy of training, wherein the evaluation formula used by the continuous evaluator is:
[0073]
[0074] Among them, the IOU function represents the intersection-over-union ratio between two sample instances, t ij represents the jth sample instance in the i-th package, l ij Represents sample instance t ij The positive and negative signs of t i,j* Represents the sample instance subset t with the highest score i,β(τ)* The sample instance with the highest score among them, τ represents a continuous parameter, and its value range is [0,1]. It can be seen from the formula that when the sample instance is i,j* The intersection ratio is greater than or equal to the threshold When , the sample instance is a positive sample. When the instance is equal to t i,j* The intersection ratio is less than the threshold When , the sample instance is a negative sample, and other instances are not considered.
[0075] Step 123: Use the training picture package evaluated by the continuous evaluator as a first result set of bounding box level label images.
[0076] Step 13, a supervised learning module is trained according to the training picture package and the first instance subset of the bounding box level label image and generates a second instance subset of the bounding box level label image; the supervised learning module of the present application adopts a conventional Faster R-CNN algorithm, which inputs the first instance subset of the bounding box level label image, is trained and outputs the second instance subset of the bounding box level label image;
[0077] Step 14: The supervised learning module calculates the consistency loss for the first instance subset of the bounding box level label image and the second instance subset of the bounding box level label image, and updates the network parameters of the supervised learning module according to the calculation results. The prediction consistency loss is calculated by the following formula:
[0078]
[0079] Among them, L c is the consistency loss, x ws represents the bounding box level label image sample instance obtained by the weakly supervised learning module, x s The supervised learning module obtains bounding box level label image sample instances, and the IOU function represents the intersection-over-union ratio between two sample instances. The first instance subset of bounding box level label images obtained by the weakly supervised learning module and the second instance subset of bounding box level label images obtained by the supervised learning module are subjected to consistency loss judgment, and the network parameters of the supervised learning module are reversely updated according to the calculation results. Learning is performed by maintaining the prediction consistency with the weakly supervised learning module, so as to achieve the purpose of supervised algorithm training.
[0080] In addition, the supervised learning module and the weakly supervised learning module have certain similarities on the network. The network parameters can be shared during the training process, and some image feature representations can be shared in the convolutional layer and some fully connected layers. This also ensures the consistency of perception of the two algorithms and improves the training efficiency of the two branches.
[0081] Step 2: Input the image to be detected into the trained weakly supervised collaborative learning algorithm network for target detection to obtain a probability vector. Specifically, the supervised learning module performs target detection on the image to be detected, and the Faster R-CNN algorithm is usually used to obtain a probability vector. The probability vector here includes: the probability value of the object in the image to be detected being identified as a helmet, the probability value of the object in the image to be detected being identified as a person, and the object position coordinate information in the image to be detected.
[0082] Step 3, judging whether the person in the image to be detected is wearing a helmet correctly according to the probability vector, including the following steps: if the probability value of the object in the image to be detected being identified as a person and the probability value of the object being identified as a helmet are greater than a fixed threshold and the helmet is located on top of the person's head, then the person in the image to be detected is judged to be wearing a helmet correctly, otherwise it is judged that the person in the image is not wearing a helmet correctly. Specifically, image recognition is performed through a weakly supervised collaborative learning algorithm network to obtain a detection result, and then a joint detection model for human heads and helmets is established: when no person appears, it is judged that there are no people on the scene; if only a person appears, or both a helmet and a person appear, but the helmet is below the person's head, it is determined that the helmet is not worn; only when the helmet and the person appear at the same time, and the helmet appears on top of the person's head, is it determined that the helmet is worn.
[0083] Preferably, the technical solution of the present application can also provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of the helmet recognition methods based on weakly supervised collaborative learning algorithms in the above claims.
[0084] The technical solution of the present application proposes a framework for weakly supervised collaborative learning through the technology of collaborative learning between the weakly supervised algorithm and the supervised Faster R-CNN algorithm, and uses the task similarity between the two algorithms, namely the prediction consistency, to jointly train the two algorithm sub-networks. First, the weakly supervised algorithm is trained and learned using the method of continuous multi-instance learning. This algorithm only requires image-level labeled sample pictures for training, which greatly reduces the requirements for training sample pictures; the bounding box-level labeled image output by the weakly supervised algorithm is input into the supervised Faster R-CNN algorithm for training, and the prediction consistency loss is used to maintain the similarity with the results of the weakly supervised algorithm, so as to provide the accuracy of training and learning. In this way, the weakly supervised collaborative learning method of the present application has both the ability of efficient network training of the weakly supervised learning method and the precise detection accuracy of the supervised learning method.
[0085] The above specific implementation modes are only detailed explanations of the technical solutions of the present invention. The present invention is not limited to the above embodiments. Any improvement or replacement based on the principles of the present invention should be within the protection scope of the present invention.
Claims
1. A helmet recognition method based on weakly supervised collaborative learning algorithm, characterized in that: The following steps are involved: Step 1: Use image-level label images to train the weakly supervised collaborative learning algorithm network, including the following steps: Step 11: extract features of the image-level label image through the convolution layer and the ROI pooling layer to obtain a training picture package containing sample instances; Step 12, the weakly supervised learning module is trained according to the training picture package and generates a first instance subset of the bounding box level label image, including the following steps: Step 121, a continuous instance selector divides the sample instances in the training picture package into subsets; Step 122, a continuous evaluator evaluates the sample instances in the training picture package according to the training picture package sample instance subset division result; Step 123, the evaluated training picture package is used as the first result set of the bounding box level label image; Step 13: The supervised learning module performs training based on the training picture package and the first instance subset of the bounding box level label image and generates a second instance subset of the bounding box level label image; Step 14: The supervised learning module calculates the consistency loss for the first instance subset of the bounding box level label image and the second instance subset of the bounding box level label image, and updates the network parameters of the supervised learning module according to the calculation results; Step 2: Input the image to be detected into the trained weakly supervised collaborative learning algorithm network to perform target detection and obtain a probability vector; Step 3: Determine whether the person in the image to be detected is wearing a helmet correctly based on the probability vector.
2. The helmet recognition method based on weakly supervised collaborative learning algorithm according to claim 1, characterized in that: The continuous instance selector performs subset division on the sample instances in the training picture package, comprising the following steps: Step 1211: The continuous instance selector calculates the score of each sample instance in the training image package. The score calculation formula is: S(t i,j ,σ s )=σ s T (FV b -FV f ), where t ij represents the jth sample instance in the i-th bag, σ s is the network parameter of the instance selector, FV b is the sample instance t ij Fisher vector of medium background, FV f is the sample instance t ij Fisher vector in the middle foreground; Step 1212: Select a sample instance with the highest score and not belonging to any bounding box level label image instance subset from all sample instances in the training picture package, and establish a new bounding box level label image instance subset; Step 1213: classify the sample instances whose overlapping area with the sample instance image with the highest score in step 1211 is greater than or equal to τ and which do not belong to any bounding box level label image instance subset into the same bounding box level label image instance subset, where τ represents a continuous parameter and has a value range of [0,1]; Step 1214: Calculate the objective function value of the continuous instance selector according to the established bounding box level label image instance subset. The objective function of the continuous instance selector is: Among them, t i represents the i-th training picture package, t i,β(τ) represents the β(τ)th instance subset in the ith bag, σ s is the network parameter of the instance selector, l i Represents the positive and negative signs of the i-th training image package, N β(τ) is the instance subset t i,β(τ) The number of instances in t i,j ∈t i,β(τ) ; Step 1215: determine whether the objective function value of the continuous instance selector is greater than a preset threshold; Step 1216: If the objective function value of the continuous instance selector is less than or equal to the preset threshold, jump to step 1212 to continue execution; Step 1217: If the objective function value of the continuous instance selector is greater than a preset threshold, the subset division is completed.
3. The helmet recognition method based on weakly supervised collaborative learning algorithm according to claim 1, characterized in that: The continuous evaluator evaluates the sample instances in the training picture package according to the sample instance subset division result of the training picture package, and the evaluation formula is: Among them, the IOU function represents the intersection-over-union ratio between two sample instances, t ij represents the jth sample instance in the i-th package, l ij Represents sample instance t ij The positive and negative signs of Represents the sample instance subset t with the highest score i,β(τ)* The sample instance with the highest score in , τ represents a continuous parameter, and its value range is [0,1].
4. The helmet recognition method based on weakly supervised collaborative learning algorithm according to claim 1, characterized in that: The calculation formula of the consistency loss is: Among them, L c is the consistency loss, x ws represents the bounding box level label image sample instance obtained by the weakly supervised learning module, x s The bounding box level label image sample instance obtained by the supervised learning module, the IOU function represents the intersection-over-union ratio between two sample instances.
5. The helmet recognition method based on weakly supervised collaborative learning algorithm according to claim 1, characterized in that: The probability vector includes: a probability value that the object in the image to be detected is recognized as a helmet, a probability value that the object in the image to be detected is recognized as a person, and position coordinate information of the object in the image to be detected.
6. The helmet recognition method based on weakly supervised collaborative learning algorithm as claimed in claim 5, characterized in that: The method of determining whether the person in the image to be detected is wearing a helmet correctly according to the probability vector comprises the following steps: If the probability value of the object in the image to be detected being recognized as a person and the probability value of the object being recognized as a helmet are greater than a fixed threshold and the helmet is located on the top of the person's head, it is determined that the person in the image to be detected is wearing the helmet correctly, otherwise it is determined that the person in the image is not wearing the helmet correctly.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of the helmet recognition methods based on weakly supervised collaborative learning algorithms in claims 1-6.
