Work clothes identification method in safety supervision scene and computing device
Through the combination of deep learning feature extraction network and image base library, the accuracy and robustness of traditional work clothes recognition methods are solved, and the identification of any scene and style of work clothes is realized, and the efficiency and accuracy of safety management are improved.
Patent Information
- Application Number
- CN202411052848.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-10
AI Technical Summary
The traditional manual monitoring method is inefficient, and the work clothes recognition method based on traditional feature operators is difficult to ensure the accuracy of recognition, it is not robust to the environment and work clothes styles, and it is unable to adapt to new scenarios and new styles of work clothes recognition.
Using a feature extraction network based on deep learning, by constructing a work clothes image base library, using the feature extraction network model to extract the image feature vectors of the work clothes image, perform pedestrian detection and feature similarity calculations, and determine whether the person wears the required work clothes and adapts to different lighting. , angle and occlusion.
It realizes accurate identification of any scenario and any style of work clothes, reduces the cost of human supervision, improves the level of safety management, and can quickly respond to potential safety hazards.
Smart Images

Figure CN119107670A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing and production safety technology, and in particular to a method and computing device for identifying work clothes in a safety supervision scenario. Background Art
[0002] As the scale of industrial production expands, the requirements for safe production are also getting higher and higher. In the safety supervision scenario, ensuring that workers wear work clothes correctly is an important part of ensuring safe production. Traditional manual monitoring methods are not only inefficient, but also prone to missed detection and false detection. Some methods based on traditional feature operators for work clothes color or feature matching are not only difficult to ensure the accuracy of recognition, but also have low robustness to the environment and work clothes style.
[0003] With the rapid development of deep learning technology, convolutional neural networks have been widely used in computer vision applications, such as image classification, feature extraction, etc. Methods based on image classification or work clothes attribute recognition require the preparation of data of specific categories of work clothes in advance, which are easily affected by human posture changes, human body occlusion and other scenarios, and can only recognize existing work clothes categories in the later stage, and cannot be used for new work clothes scenarios. Summary of the invention
[0004] The present invention aims to provide a method and computing device for identifying work clothes in safety supervision scenarios, which has high adaptability and flexibility, can solve the problem of identifying work clothes in any scenario and any style, reduce the cost of human supervision, and ensure the safety of production operations.
[0005] According to one aspect of the present invention, a method for identifying work clothes in a safety supervision scenario is provided, the method comprising:
[0006] Constructing a work clothes image base library, wherein the work clothes image base library includes image feature vectors of work clothes images extracted based on a feature extraction network model;
[0007] Deframe the surveillance video stream and perform pedestrian detection on the current frame image;
[0008] Extract the work clothes feature of the detected pedestrian image to obtain the work clothes feature vector of the pedestrian to be identified;
[0009] The feature similarity between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base is calculated. If the similarity value is greater than the similarity threshold, it is determined that the person in the current image is wearing the required work clothes. Otherwise, the corresponding alarm information is output.
[0010] Among them, the feature extraction network model includes a feature normalization part, which is used to normalize the image feature vectors of different samples of the work clothes image base to obtain normalized image feature vectors, and the at least one image feature vector includes the normalized image feature vector.
[0011] According to some embodiments, the feature extraction network model includes an image data set input part, a backbone network, a universal mean pooling part, a loss function part and a feature output part connected in sequence, wherein:
[0012] The work clothes image or pedestrian image enters the backbone network through the image data set input part, the output of the backbone network passes through the universal mean pooling part, and then the image feature vector of the work clothes or the pedestrian work clothes feature vector is learned and retained through the loss function part and output through the feature output part, and the feature normalization part receives the output of the feature output part;
[0013] The backbone network adopts a non-local attention mechanism.
[0014] According to some embodiments, the loss function partially adopts a triplet loss, which includes an anchor point, a positive example and a negative example, and feature extraction is achieved by comparing the distance between the anchor point and the positive example and the distance between the anchor point and the negative example.
[0015] According to some embodiments, the normalized image feature vector includes a first normalized image feature vector and a second normalized image feature vector;
[0016] The first normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the front sample;
[0017] The second normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the back sample.
[0018] According to some embodiments, calculating feature similarity between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base library includes:
[0019] The feature similarity between the pedestrian workwear feature vector and the normalized image feature vector is calculated.
[0020] According to some embodiments, calculating feature similarity between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base library includes:
[0021] The feature similarity between the pedestrian work clothes feature vector and each image feature vector in the work clothes image base is calculated.
[0022] According to some embodiments, calculating feature similarity between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base library includes:
[0023] The feature similarity calculation is performed between at least two connections of the pedestrian work clothes feature vector and corresponding at least two connections of the image feature vector of the work clothes image base.
[0024] According to some embodiments, the workwear image base includes:
[0025] Image feature vectors of a plurality of images of different persons wearing the work clothes in different postures;
[0026] Establish a corresponding database of work clothes images in various categories according to the colors and styles that need to be identified to support the recognition of work clothes in multiple scenarios and of any style.
[0027] According to some embodiments, de-framing the surveillance video stream and detecting pedestrians on the current frame image include:
[0028] Identify pedestrian images. If a pedestrian is detected, crop the human body area image; if no pedestrian is detected, continue to detect pedestrians on the next frame of image.
[0029] According to another aspect of the present invention, a computing device is provided, comprising a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes any of the above methods.
[0030] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium having computer-readable instructions stored thereon, and when the instructions are executed by a processor, the processor is caused to execute any of the above methods.
[0031] According to an embodiment of the present invention, a work clothes image database is constructed and work clothes are identified through feature extraction and similarity calculation, real-time deframing and pedestrian detection are performed on the monitoring video stream, image feature vectors of the work clothes images are extracted by a feature extraction network model and feature normalization is performed, feature similarity calculation is performed between the pedestrian work clothes feature vector and at least one image feature vector of the same category of work clothes image database, and the calculation result is used to determine whether the person in the current image is wearing the required work clothes, so that the system can promptly discover people who do not wear work clothes as required, thereby quickly responding to potential safety hazards.
[0032] According to the embodiments of the present invention, the key feature information of work clothes can be accurately extracted, and the system can adapt to the work clothes identification needs under complex conditions such as different lighting, angles, and occlusions. The method of combining feature extraction and similarity calculation provides an efficient, accurate, customizable and easy-to-maintain solution for work clothes identification, greatly improving the level of workplace safety management. The work clothes image base of the present invention can be customized and updated according to the specific needs of different industries and scenarios, so that the system can adapt to a variety of work environments and work clothes types. The feature extraction network can extract deep feature representations from the image, so that the system can accurately distinguish different styles of work clothes.
[0033] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0035] Figure 1 A schematic diagram of a feature extraction network for work clothes recognition according to an example embodiment is shown.
[0036] Figure 2 A flow chart illustrating workwear identification according to an example embodiment is shown.
[0037] Figure 3 A schematic diagram showing a non-local attention mechanism of a feature extraction network for workwear recognition according to an example embodiment.
[0038] Figure 4 A schematic diagram illustrating the triplet loss of a feature extraction network for work clothes recognition according to an example embodiment.
[0039] Figure 5 A schematic diagram showing a workflow of work clothes recognition according to an exemplary embodiment.
[0040] Figure 6 A block diagram of a computing device according to an example embodiment of the invention is shown. DETAILED DESCRIPTION
[0041] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0042] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0043] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0044] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0045] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the present inventive concept. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0046] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0047] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present invention, and therefore cannot be used to limit the protection scope of the present invention.
[0048] Traditional manual monitoring methods are inefficient and prone to missed detections and false detections. The method of matching work clothes color or features based on traditional feature operators is not only difficult to ensure the accuracy of recognition, but also has low robustness to the environment and work clothes styles.
[0049] With the rapid development of deep learning technology, convolutional neural networks have been widely used in computer vision applications, such as image classification, feature extraction, etc. However, methods based on image classification or work clothes attribute recognition require the preparation of data of specific categories of work clothes in advance, which are easily affected by human posture changes, human body occlusion and other scenarios, and can only recognize existing work clothes categories in the later stage.
[0050] To this end, the present invention proposes a method for identifying work clothes in safety and supervision scenarios. For work clothes of different styles and colors, it is only necessary to create a corresponding work clothes base library, and perform feature extraction on the base library data as a feature library. When different application scenarios appear or the type of work clothes is changed, it is only necessary to create a corresponding work clothes image base library to realize work clothes recognition in the new scenario.
[0051] Before describing the embodiments of the present invention, some terms or concepts involved in the embodiments of the present invention are explained.
[0052] ReID (Person Re-Identification), also known as person re-identification, is a technology in the field of computer vision, which is mainly used to identify the same individual in non-overlapping camera views. This technology has a wide range of applications in video surveillance, public safety, retail analysis, smart security and other fields. The goal of ReID is to identify images belonging to the same person in images or video sequences captured at different times and places, even if these images differ in appearance, posture, lighting, resolution, etc.
[0053] GeM (Generalized Mean Pooling), generalized mean pooling is a pooling technique used for feature aggregation in deep learning, which provides a more flexible and powerful alternative to traditional average pooling and maximum pooling.
[0054] Weighted Regularization Triplet (triplet loss) is a loss function used in deep learning, especially in face recognition, image retrieval and other tasks that require metric learning. It is mainly used to measure the relative distance between samples in the feature space.
[0055] Non-local Attention is a method for capturing long-distance dependencies in images or sequences, which enhances the expressiveness of the model by calculating the relationships between global features.
[0056] Among the work clothes recognition methods, the recognition methods based on traditional feature operators, such as the color recognition method or the template matching method, determine whether the designated work clothes are worn by matching the colors of the work clothes. The disadvantage is that sometimes, although the colors are matched correctly, the same color clothes have different styles, and the information such as the color of the clothes itself is easily affected by factors such as lighting. Therefore, this method is not only difficult to ensure the accuracy of recognition, but also has low robustness to the environment and the style of work clothes. The methods based on clothing image classification or the methods based on human attributes can usually only recognize the clothing categories in the training samples. When new clothing categories appear or new types of work clothes to be recognized appear in new application scenarios, they are often not usable or cannot be accurately recognized.
[0057] The feature extraction method based on deep learning of the present invention adopts a method similar to facial feature extraction or Reid feature extraction, and minimizes the internal differences in the features of pedestrian work clothes with the same ID or work clothes through triplet loss, while maximizing the internal differences between the features of pedestrian work clothes with different IDs or work clothes. Such a feature method can have a strong feature extraction and recognition capability and strong robustness. In actual application scenarios, it is only necessary to make an image base according to the type of work clothes in different scenarios, and then recognize the work clothes of any scene by comparing the features of the recognition image with the features of the base library. When different application scenarios appear or the type of work clothes is changed, it is only necessary to make a corresponding work clothes image base to realize the recognition of work clothes in the new scenario.
[0058] Exemplary embodiments of the present invention are described below with reference to the accompanying drawings.
[0059] Figure 1 A schematic diagram of a feature extraction network for work clothes recognition according to an example embodiment is shown.
[0060] See also Figure 1 According to an example embodiment, the feature extraction network for work clothes recognition includes an image data set input part, a backbone network, a general mean pooling part, a loss function part and a feature output part connected in sequence. The work clothes image or the pedestrian image enters the backbone network through the image data set input part. After the output of the backbone network passes through the general mean pooling part, the image feature vector of the work clothes or the pedestrian work clothes feature vector is learned and retained through the loss function part and output through the feature output part. According to some embodiments, the feature extraction network also includes a feature normalization part, and the feature normalization is used to normalize the image feature vectors of different samples of the work clothes image base to obtain a normalized image feature vector.
[0061] According to an example embodiment, feature extraction training is performed on the image dataset input based on the backbone network Resnet50, and the image dataset input can be any open source reid dataset or clothing recognition dataset. The feature extraction network uniformly scales the human body image to 256*192 size as the feature extraction network input, and the input image passes through the Resnet50 network to map the input image to a 1*128 dimensional feature vector after feature extraction and global pooling operations. The feature extraction process uses the attention mechanism to better extract distinguishing features. The training process uses triple loss to minimize the distance between feature vectors of the same category data and maximize the distance between feature vectors of different categories of data. Because the input distribution of the network layer changes with the training process, the training becomes unstable and slow. The introduction of feature normalization solves the problem of internal covariate shift. The height and width of the image are set to 256*192. This is based on the characteristic that the height of human body images is greater than their width. The image is scaled to the same size to ensure the consistency of the network input. The feature is then mapped to a 1*128 dimensional vector. The process of feature dimensionality reduction can remove redundant information and reduce the risk of overfitting. At the same time, the high-dimensional feature space of the image is condensed into a dense feature representation of a lower dimensionality, which is conducive to the processing of subsequent tasks.
[0062] According to some embodiments, general mean pooling (GeM) is used instead of traditional average pooling or maximum pooling. GeM pooling can automatically adjust the properties of the pooling operation during model training by introducing a learnable parameter p, providing a flexible way to balance the effects between average pooling and maximum pooling, thereby better adapting to the needs of specific tasks.
[0063] The formula for GeM pooling is:
[0064]
[0065] Among them, x i is an element of the input feature map;
[0066] N is the total number of elements in the feature map;
[0067] p is an adjustable parameter that controls the degree of pooling.
[0068] When p increases and approaches infinity, GeM pooling tends to maximum pooling; when p = 1, it is equivalent to average pooling. Therefore, GeM pooling can find the best balance between average pooling and maximum pooling by adjusting the value of p.
[0069] The feature extraction network also includes a feature normalization part, which is used to normalize the image feature vectors of different samples in the workwear image base to obtain a normalized image feature vector. The normalized image feature vector includes a first normalized image feature vector and a second normalized image feature vector, wherein the first normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the front sample, and the second normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the back sample.
[0070] During the feature extraction model training process, the features within the class are also normalized in the feature library. The purpose of this is to improve the efficiency of feature matching. Because when performing feature matching, the feature library originally extracts as many feature vectors as the number of base library images. In order to make feature matching faster and more efficient, we accumulate and sum the feature library vectors, and then average them to obtain a mean feature vector to represent the feature vector of the base library. This is called base library feature normalization. In this way, only one comparison is required during the comparison, which can greatly reduce the time required for comparison and improve the efficiency of work clothes recognition.
[0071] In machine learning and data science, the weighted sum of features within a class as a feature vector has beneficial effects in feature aggregation, noise reduction, feature selection, feature fusion, personalized recommendation and model input. According to some embodiments, when there are multiple related features but it is desired to simplify them into a comprehensive indicator, a weighted summation method can be used. For example, in a recommendation system, a user's preference for different items can be converted into a user feature vector through weighted summation, where the weight reflects the importance of each item feature.
[0072] By assigning different weights to different features, the impact of irrelevant or noisy features can be reduced, thereby improving the performance of the model. According to some embodiments, features are not equally important, and weight allocation can help the model focus on more informative features. Weighted summation can also be viewed as a feature selection technique, in which features with lower weights have less impact after summation, which actually weakens or excludes these features. When processing multimodal data, features of different modalities may require different processing methods, and weighted summation can be used as an effective means of fusing features from different sources. When constructing a feature vector for a user or item, a weighted summation can be used to reflect the user's personal preferences or the characteristics of the item, where the weights can be based on historical behavior, time decay factors, or user feedback, etc.
[0073] According to some embodiments, such as in a neural network model, the input layer may require a vector of fixed length. In this case, weighting and summing multiple features into a vector of fixed length can meet the input requirements of the model.
[0074] The specific implementation of weighted summation can be linear or nonlinear, depending on how the weights are determined. The weights can be pre-defined, such as based on domain knowledge, or learned through machine learning algorithms (such as linear regression, support vector machines, neural networks, etc.).
[0075] For example, in a linear weighted sum, an eigenvector can be represented as:
[0076] xweighted=w1x1+w2x2+…+wnxnxweighted=w1x1+w2x2+…+wnxn
[0077] Among them, wiwi is the weight of feature xixi, and xweightedxweighted is the weighted feature vector.
[0078] In practical applications, the determination of weights often requires experimentation and tuning to find the optimal combination of weights, which may involve cross-validation and performance evaluation.
[0079] The identity loss (ID loss) is mainly used in the field of deep learning, especially in ReID, to ensure that the feature extraction network can learn and retain the identity features of individuals. The feature extraction method based on deep learning uses triplet loss to minimize the difference between the features of pedestrian work clothes with the same ID or work clothes, and maximize the difference between the features of pedestrian work clothes with different IDs or work clothes. Such a feature method can have stronger feature extraction and recognition capabilities and stronger robustness.
[0080] The backbone network adopts a non-local attention mechanism. Figure 3 The non-local attention mechanism is an enhanced attention mechanism that captures long-distance dependencies in images or sequences by calculating the relationship between global features. Where X can be an image or sequence data, and feature X undergoes 1x1 convolution. Each convolution is first calculated by inner product, and then feature addition is performed. Z is the final output feature after non-local-attention.
[0081] The loss function part adopts triple loss, see Figure 4, a triplet consists of an anchor point (Anchor), a positive example (Positive) and a negative example (Negative). The goal is to make the distance between the anchor point and the positive example smaller than the distance between the anchor point and the negative example by at least one fixed boundary. a represents the anchor point, b represents the positive example, and c represents the negative example. The positive and negative examples are relative to the anchor point. For example, an image in the same ID category is defined as the anchor point, then the positive example is any other image selected from the current ID category, and the negative example is an image selected from any other ID. Comparing the distance between the arrows, the positive example b may be close to the anchor point a, and the negative example c may be far from the anchor point a, so that the purpose of feature extraction can be achieved.
[0082] Through the method of the present invention, it is only necessary to create a work clothes image base according to the types of work clothes in different scenes, and then the work clothes in any scene can be recognized by comparing the features of the recognition image with the features of the base library. When different application scenarios appear or the type of work clothes is changed, it is only necessary to create a corresponding work clothes image base to realize the work clothes recognition in the new scene.
[0083] The preparation of a work clothes image base usually includes multiple photos of different people wearing the work clothes and in different angles and postures, such as standing, walking, bending, etc. from the front, side, and back angles, to increase the robustness of recognition and ensure that the photos collected in the database cover diversity. The work clothes refer to work clothes with fixed colors and styles to be identified. The preparation of the work clothes image base is to establish a database containing work clothes of specific styles and colors for subsequent identification and management. For work clothes of different styles and colors used in different work scenes, corresponding work clothes image bases are established respectively. When it is necessary to identify a specified style of work clothes, the work clothes image base of that style is directly called.
[0084] Figure 2 A flow chart illustrating workwear identification according to an example embodiment is shown.
[0085] In S101, a workwear image base is constructed.
[0086] According to the example embodiment, the required work clothes image base is constructed according to the above-mentioned work clothes image base preparation method, and photos of employees wearing designated work clothes are collected to ensure that the photos are of good quality, with sufficient light, simple background, and avoid interference factors. The work clothes image base includes image feature vectors of multiple images of different people wearing the work clothes in different postures.
[0087] In S103, an image feature vector of the work clothes image is extracted based on a feature extraction network model.
[0088] According to the example embodiment, the base database feature extraction algorithm is started to extract the image feature vector of the work clothes image and save it in the corresponding position. The picture in the work clothes image base database is input into the feature extraction network model to obtain the corresponding feature vector, and the extracted feature vector is saved in the corresponding file or database to facilitate subsequent search and matching.
[0089] In S105, the monitoring video stream is deframed.
[0090] According to an example embodiment, a workwear recognition algorithm and system are enabled to deframe the surveillance video stream, convert the video into continuous image frames, and push the extracted image frame data to the pedestrian detection algorithm.
[0091] In S107, pedestrian detection is performed on the current frame image.
[0092] According to the example embodiment, the current frame image data transmitted from S105 is received, the current frame image is analyzed through pedestrian detection, and pedestrians that may exist in the picture are identified and located. If a pedestrian is detected, the human body area image is cropped and the image is pushed to the work clothes feature extraction algorithm. If no pedestrian is detected, pedestrian detection is continued for the next frame image.
[0093] In S109, work clothes features are extracted from the detected pedestrian image to obtain a work clothes feature vector of the pedestrian to be identified.
[0094] According to an example embodiment, a deep learning model is used to extract features related to work clothes. The extracted features are encoded into a fixed-length feature vector. In this scenario, the dimension of the feature vector is specified as 1*128 dimensions. The feature vector also needs to be normalized to ensure the comparability between different features and the stability of model training.
[0095] In S111, feature similarity calculation is performed between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base library.
[0096] According to an example embodiment, calculating the feature similarity between the pedestrian's work clothes feature vector and at least one image feature vector of the work clothes image base library includes calculating the feature similarity between the pedestrian's work clothes feature vector and each image feature vector of the work clothes image base library, for example, including calculating the feature similarity between the pedestrian's work clothes feature vector and the normalized image feature vector.
[0097] According to an example embodiment, calculating feature similarity between the pedestrian's work clothes feature vector and at least one image feature vector of the work clothes image base library further includes calculating feature similarity between at least two connections of the pedestrian's work clothes feature vector and corresponding at least two connections of the image feature vector of the work clothes image base library.
[0098] According to some embodiments, when the similarity calculation result of any one of the image feature vectors exceeds a threshold, it can be determined that the identified pedestrian work clothes feature is required to be worn. According to other embodiments, when the similarity calculation results of at least two features exceed a threshold, it can be determined that the identified pedestrian work clothes feature is required to be worn.
[0099] The similarity calculation method uses the cosine value of two eigenvectors as the similarity index. Cosine similarity is often used for similarity calculation in high-dimensional space because it focuses on the direction of the vector rather than the size, and is suitable for the comparison of this eigenvector.
[0100] In S113, the similarity value and the similarity threshold are determined.
[0101] According to the example embodiment, the size of the similarity value and the similarity threshold is determined. The similarity threshold can be set through the system platform. If the calculated similarity value is greater than the set similarity threshold, it is determined that the person in the current image is wearing the required work clothes; conversely, if the calculated similarity value is less than the set similarity threshold, it is determined that the person in the current image is not wearing the required work clothes, and the corresponding alarm information is output.
[0102] Figure 5 A schematic diagram showing a workflow of work clothes recognition according to an exemplary embodiment.
[0103] According to the example embodiment, when performing work clothes recognition, a required work clothes image base is first established, and the work clothes image base is prepared by de-framing the monitoring video stream, performing pedestrian detection in the image frame after the video data is de-framed, and then selecting image data. Work clothes features are extracted from the work clothes image base, and the extracted features are stored in the memory for subsequent feature comparison.
[0104] Perform real-time work clothes recognition, parse video data to detect pedestrians in the current frame data of the original video frame, and when a pedestrian is detected, crop the corresponding human body area and send it to the work clothes feature extraction network for feature extraction to obtain a 1*128-dimensional feature vector corresponding to the current pedestrian. Perform feature comparison between the 1*128-dimensional feature vector and the feature vector library of the work clothes base library, and perform logical judgment on the similarity value and the similarity threshold. If the similarity threshold is greater than the threshold and there is no situation greater than the threshold, then the person in the current frame image meets the requirements. If the similarity threshold is less than the threshold, it is judged that the pedestrian corresponding to the current image is not wearing the required work clothes, and the result is pushed to the work clothes recognition platform, and the corresponding alarm information is output.
[0105] Through the example embodiments of the present invention, the automated monitoring of the work clothes identification system realizes real-time monitoring and management of the clothing of people in the workplace. When non-compliant behavior is found, an alarm is immediately issued and reported to the platform, which greatly reduces labor costs and improves safety and identification accuracy.
[0106] The work clothes recognition method based on feature extraction of the present invention adopts deep learning algorithm for feature extraction, which can accurately extract the key feature information of work clothes. The system can adapt to the work clothes recognition needs under complex conditions such as different lighting, angles, occlusion, etc. The application of feature extraction and similarity comparison not only improves the accuracy of work clothes recognition, but also provides a more efficient and intelligent safety management solution.
[0107] The present invention supports the recognition of work clothes in any scene and any style by presetting the work clothes base library. The training model and base library can be customized according to the characteristics and needs of a specific industry to meet the high-precision recognition requirements in specific scenes. The base library can be made according to different actual needs to meet the work clothes recognition needs in different scenes.
[0108] Figure 6 A block diagram of a computing device according to an example embodiment of the invention is shown.
[0109] like Figure 6 As shown, computing device 30 includes processor 12 and memory 14. Computing device 30 may also include bus 22, network interface 16, and I / O interface 18. Processor 12, memory 14, network interface 16, and I / O interface 18 may communicate with each other via bus 22.
[0110] The processor 12 may include one or more general-purpose CPUs (Central Processing Units, processors), microprocessors, or application-specific integrated circuits, etc., for executing relevant program instructions. According to some embodiments, the computing device 30 may also include a high-performance graphics card (GPU) 20 for accelerating the processor 12.
[0111] The memory 14 may include a machine system readable medium in the form of a volatile memory, such as a random access memory (RAM), a read-only memory (ROM) and / or a cache memory. The memory 14 is used to store one or more programs including instructions and data. The processor 12 can read the instructions stored in the memory 14 to execute the above-mentioned method according to the embodiment of the present invention.
[0112] The computing device 30 may also communicate with one or more networks via the network interface 16. The network interface 16 may be a wireless network interface.
[0113] The bus 22 may include an address bus, a data bus, a control bus, etc. The bus 22 provides a path for exchanging information between components.
[0114] It should be noted that, in the specific implementation process, the computing device 30 may also include other components necessary for normal operation. In addition, those skilled in the art may understand that the above device may only include components necessary for implementing the embodiments of this specification, and need not include all components shown in the figure.
[0115] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.
[0116] An embodiment of the present invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method recorded in the above method embodiments.
[0117] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array, an integrated circuit, etc.
[0118] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0119] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0124] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.
Claims
1. A method for identifying work clothes in a safety supervision scenario, characterized in that: include: Constructing a work clothes image base library, wherein the work clothes image base library includes image feature vectors of work clothes images extracted based on a feature extraction network model; Deframe the surveillance video stream and perform pedestrian detection on the current frame image; Extract the work clothes feature of the detected pedestrian image to obtain the work clothes feature vector of the pedestrian to be identified; The feature similarity between the pedestrian work clothes feature vector and at least one image feature vector in the work clothes image base is calculated. If the similarity value is greater than the similarity threshold, it is determined that the person in the current image is wearing the required work clothes. Otherwise, the corresponding alarm information is output. Among them, the feature extraction network model includes a feature normalization part, which is used to normalize the image feature vectors of different samples of the work clothes image base to obtain normalized image feature vectors, and the at least one image feature vector includes the normalized image feature vector.
2. The method according to claim 1, characterized in that The feature extraction network model includes an image data set input part, a backbone network, a general mean pooling part, a loss function part and a feature output part connected in sequence, wherein: The work clothes image or pedestrian image enters the backbone network through the image data set input part, the output of the backbone network passes through the universal mean pooling part, and then the image feature vector of the work clothes or the pedestrian work clothes feature vector is learned and retained through the loss function part and output through the feature output part, and the feature normalization part receives the output of the feature output part; The backbone network adopts a non-local attention mechanism.
3. The method according to claim 2, characterized in that The loss function part adopts a triplet loss, which includes an anchor point, a positive example and a negative example. Feature extraction is achieved by comparing the distance between the anchor point and the positive example and the distance between the anchor point and the negative example.
4. The method according to claim 1, characterized in that: The normalized image feature vector includes a first normalized image feature vector and a second normalized image feature vector; The first normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the front sample; The second normalized image feature vector is a normalized image feature vector obtained by normalizing the image feature vector of the back sample.
5. The method according to claim 1, characterized in that The feature similarity calculation of the pedestrian work clothes feature vector and at least one image feature vector of the work clothes image base library includes: The feature similarity between the pedestrian workwear feature vector and the normalized image feature vector is calculated.
6. The method according to claim 1, characterized in that The feature similarity calculation of the pedestrian work clothes feature vector and at least one image feature vector of the work clothes image base library includes: Case Number: The feature similarity between the pedestrian work clothes feature vector and each image feature vector in the work clothes image base is calculated.
7. The method according to claim 1, characterized in that The feature similarity calculation of the pedestrian work clothes feature vector and at least one image feature vector of the work clothes image base library includes: The feature similarity calculation is performed between at least two connections of the pedestrian work clothes feature vector and corresponding at least two connections of the image feature vector of the work clothes image base.
8. The method according to claim 1, characterized in that The work clothes image base library includes: Image feature vectors of a plurality of images of different persons wearing the work clothes in different postures; Establish a corresponding database of work clothes images in various categories according to the colors and styles that need to be identified to support the recognition of work clothes in multiple scenarios and of any style.
9. The method according to claim 1, characterized in that: Deframe the surveillance video stream and perform pedestrian detection on the current frame image, including: Identify pedestrian images. If a pedestrian is detected, crop the human body area image; if no pedestrian is detected, continue to detect pedestrians on the next frame of image.
10. A computing device, characterized in that include: processor; as well as A memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 9 is implemented.
