Safety clothing detection method and device, electronic equipment and storage medium
By dimensional mapping, feature vector stitching and semantic information capture methods for the image of the hard hat, the problem of low recognition accuracy in the prior art is solved, and higher recognition accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202411922978.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-01
AI Technical Summary
The existing safety helmet recognition methods have low recognition accuracy in complex production environments and cannot adapt to the coexistence of various states of human beings.
By determining the target image block and performing dimension mapping, the dimension vector is obtained; stitching the dimension vector with the classification vector and adding position coded vectors to obtain the image vector; capturing semantic information through different weight combinations to obtain the reference feature vector; filtering and fusion of the reference feature vectors to obtain the aggregated feature vector, which is used to determine the wearing of safety clothing.
It improves the accuracy of safety clothing recognition, can better adapt to complex weather conditions and scenarios, and reduces dependence on specific scenarios.
Smart Images

Figure CN119741576A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a safety clothing detection method, device, electronic equipment and storage medium. Background Art
[0002] The stable operation of the power system is the cornerstone that supports the smooth operation of all walks of life in society and the daily lives of hundreds of millions of families. Among them, the distribution network is a key link in this complex network, and its safety and reliability are of vital importance. However, in daily operation and maintenance practices, some workers ignore the regulatory requirements for wearing safety helmets due to their weak safety awareness, which not only poses a serious threat to the safety of the operators themselves, but also greatly increases the risk of damage to power equipment. According to statistics, accidents caused by failure to wear safety helmets in a standardized manner occur frequently every year, resulting in casualties and equipment damage. The importance of safety helmets, as an indispensable protective barrier in high-risk working environments, is self-evident.
[0003] The existing helmet recognition method focuses on identifying helmets through various machine learning methods. This method cannot adapt to the complex and changeable production environment and the coexistence of various human states, which will lead to the problem of low helmet recognition accuracy. Summary of the invention
[0004] The present invention provides a safety clothing detection method, device, electronic equipment and storage medium to solve the problem of low safety helmet recognition accuracy.
[0005] According to one aspect of the present invention, a safety clothing detection method is provided, comprising:
[0006] Determine a target image block, and perform dimension mapping on the target image block to obtain a dimension vector; the dimension mapping is used to map the target image block to a preset dimension vector space; the target image block is a split target image; the target image contains an object that needs to be detected as target safety clothing; the dimension vector can represent the detailed feature information of the object in the target image block;
[0007] The dimension vector and the classification vector are concatenated, and a position coding vector is added accordingly to obtain an image vector; the classification vector is used to represent the overall feature information of the object in the target image; the position coding vector is used to represent the position of the target image block in the target image;
[0008] Capturing semantic information in the image vector by combining different weights to obtain a reference feature vector;
[0009] Screening and fusing the reference feature vectors to obtain an aggregated feature vector;
[0010] The wearing condition of the safety clothing is determined according to the aggregated feature vector.
[0011] According to another aspect of the present invention, there is provided a safety clothing detection device, comprising:
[0012] A dimension vector determination module is used to determine a target image block and perform dimension mapping on the target image block to obtain a dimension vector; the dimension mapping is used to map the target image block to a preset dimension vector space; the target image block is a split target image; the target image contains an object that needs to be detected as target safety clothing; the dimension vector can represent the detailed feature information of the object in the target image block;
[0013] An image vector determination module is used to concatenate the dimension vector with the classification vector and add a corresponding position coding vector to obtain an image vector; the classification vector is used to represent the overall feature information of the object in the target image; the position coding vector is used to represent the position of the target image block in the target image;
[0014] A reference feature vector determination module, used to capture the semantic information in the image vector through different weight combinations to obtain a reference feature vector;
[0015] An aggregated feature vector determination module is used to screen and fuse the reference feature vectors to obtain an aggregated feature vector;
[0016] The identification module is used to determine the wearing condition of the safety clothing according to the aggregated feature vector.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the safety clothing detection method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the safety clothing detection method described in any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention determines the target image block and performs dimension mapping on the target image block to obtain a dimension vector, which can reduce the amount of data and improve the recognition speed; the dimension vector is spliced with the classification vector, and the position coding vector is added accordingly to obtain an image vector, which can provide the spatial position information of the target image block and also contain the overall feature vector of the object, which helps to improve the accuracy of recognition; the semantic information in the image vector is captured by different weight combinations to obtain a reference feature vector, which can obtain a more advanced semantic understanding and avoid the problem of insufficient feature information capture; the reference feature vector is screened and fused to obtain an aggregate feature vector, which can remove the same feature information in the vector, thereby reducing the amount of calculation and improving the speed of calculation; the wearing condition of safety clothing is determined according to the aggregate feature vector, which can make full use of the different feature information in the target image and improve the recognition accuracy. The method can extract different feature vector information in the target image block, and judge the wearing condition of safety clothing through different feature vector information, which can greatly improve the recognition accuracy and better adapt to complex weather conditions, thereby reducing the dependence on specific scenes.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A flowchart of a safety clothing detection method provided by an embodiment of the present invention;
[0026] Figure 2 A schematic diagram of the structure of a safety clothing detection device provided by an embodiment of the present invention;
[0027] Figure 3 A schematic diagram of the structure of an electronic device for implementing the safety clothing detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Figure 1 This is a flowchart of a safety clothing detection method provided by an embodiment of the present invention. This embodiment can be applied to the situation of determining whether the power distribution network staff wears a safety helmet. The method can be executed by a safety clothing detection device. The safety clothing detection device can be implemented in the form of hardware and / or software. The safety clothing detection device can be configured in any electronic device with network communication function. Figure 1 As shown, the method includes:
[0031] S110, determining a target image block, and dimensionally mapping the target image block to obtain a dimension vector.
[0032] The dimensional mapping is used to map the target image block to a preset dimensional vector space.
[0033] The target image block is the split target image, and the target image contains the object that needs to be detected for target safety clothing.
[0034] Among them, the dimensional vector can represent the detailed feature information of the object in the target image block.
[0035] Specifically, the original image is screened, and the image that does not contain the detected object is deleted to obtain the target image. The target image is segmented to obtain the target image block. The target image block is mapped to a preset dimensional vector space to obtain a dimensional vector.
[0036] S120, concatenate the dimension vector and the classification vector, and add the position encoding vector accordingly to obtain an image vector.
[0037] Among them, the classification vector is used to represent the overall feature information of the object in the target image.
[0038] The position encoding vector is used to represent the position of the target image block in the target image.
[0039] Specifically, the dimension vector is average-pooled, concatenated with the classification vector after processing, and the position encoding information corresponding to the dimension vector is added to obtain the image vector.
[0040] S130 , capturing semantic information in the image vector through different weight combinations to obtain a reference feature vector.
[0041] Specifically, the image vector is input into a multi-head neural network model with different weight combinations to capture semantic information and obtain at least one feature vector. The at least one feature vector obtained is concatenated to obtain a reference feature vector.
[0042] The multi-head neural network model is a model that can simultaneously use different weight combinations for feature extraction. For example, a Transformer Encoder can be used.
[0043] S140, screening and fusing the reference feature vectors to obtain an aggregated feature vector.
[0044] Specifically, the same feature information contained in the reference feature vectors is eliminated, and the reference feature vectors after elimination are concatenated and fused to obtain an aggregated feature vector.
[0045] S150: Determine the wearing condition of the safety clothing according to the aggregated feature vector.
[0046] Specifically, the aggregated feature vector is compared with the preset feature vector. If the aggregated feature vector contains the preset feature vector, the detected object in the target image is wearing safety clothing; if the aggregated feature vector does not contain the preset feature vector, the detected object in the target image is not wearing safety clothing.
[0047] Furthermore, the wearing condition of the safety clothing may be determined by: inputting the aggregated feature vector into a classifier, the classifier classifies the aggregated feature vector, and judging the wearing condition of the safety clothing according to the classification result.
[0048] The classifier may be a MLP (Multilayer Perceptron).
[0049] Furthermore, after it is recognized that the safety clothing is not worn, an early warning is issued through the sound and light alarm module.
[0050] Among them, the sound and light alarm module is responsible for generating alarm signals and giving reminders through sound, light signals, display screens or sending them to a remote monitoring center. It can also record and report the location and information of detected objects who are not wearing safety clothing.
[0051] Furthermore, the wearing condition of safety clothing can also be directly detected according to the target image through the recognition model.
[0052] Among them, the recognition model is configured in an operating system equipped with Ubuntu 16.04. The server is equipped with 64GB RAM and four NVIDIA GeForce RTX 2080Ti GPUs to support high-performance computing needs. The recognition model is built based on the Pytorch deep learning framework, and the Python version used is 3.6.2. At the same time, the ViT-L / 16 model weights pre-trained on the ImageNet-21k dataset are used. The optimization algorithm uses stochastic gradient descent (SGD), and the momentum parameter is set to 0.9. The maximum number of iterations does not exceed 20 times. In addition, the number of Transformer Encoder layer stacks in the recognition model is 12 layers to enhance the feature extraction capability of the recognition model.
[0053] Optionally, determining the target image block includes steps A1-A4:
[0054] Step A1: determine the original image.
[0055] Specifically, the captured image data or video data is obtained from the image acquisition device. If it is image data, it is directly used as the original image; if it is video data, it is cropped according to the frame to obtain the original image.
[0056] Step A2: determining edge feature information according to the original image.
[0057] The edge feature information is used to represent the edge information of the object in the original image.
[0058] Specifically, edge feature information of objects in the original image is extracted.
[0059] Step A3: Filter the original image according to the edge feature information to obtain the target image.
[0060] Specifically, the edge feature information is matched with the reference edge information. If the reference edge information contains edge feature information, it is considered that the original image contains the detected object, so it is retained. If the reference edge information does not contain edge feature information, it is considered that the original image contains the detected object, so it is removed and the remaining retained image is used as the target image.
[0061] The reference edge information is used to characterize the feature information of the detected object.
[0062] Step A4: segment the target image to obtain target image blocks and position encoding vectors.
[0063] Among them, the position encoding vector corresponds one-to-one to the target image block.
[0064] Specifically, the target image is segmented and encoded according to a preset size to obtain target image blocks and position encoding vectors.
[0065] Exemplarily, the preset size may be 16×16.
[0066] Optionally, dimension mapping is performed on the target image block to obtain a dimension vector, including steps B1-B2:
[0067] Step B1: extract the first eigenvector in the target image block.
[0068] The first eigenvector can represent the characteristic information of the color and texture of the object in the image.
[0069] Specifically, a first feature vector is generated according to pixel information of the target image block.
[0070] Step B2: performing convolution and pooling processing on the first eigenvector to obtain a second eigenvector.
[0071] The dimension of the second eigenvector is greater than the dimension of the first eigenvector.
[0072] Specifically, convolution processing is performed on the first eigenvector, and pooling processing is performed after the convolution to obtain the second eigenvector.
[0073] Furthermore, the convolution processing is as follows: a convolution kernel is set, the convolution kernel is slid on the first eigenvector, the eigenvalues in the local area of the first eigenvector covered by the convolution kernel are multiplied element by element by the convolution kernel, and then the products are added to obtain new eigenvalues, until the convolution kernel traverses the first eigenvector and the convolution processing is completed.
[0074] Furthermore, the pooling process is as follows: the convolved feature vector is divided into several small areas, the average value of the feature value in each small area is calculated, and the maximum value is obtained as the new feature value, so as to obtain the second feature vector.
[0075] Step B3: Dimensionally map the second eigenvector to obtain a dimensional vector.
[0076] The dimension of the dimension vector is smaller than the dimension of the second eigenvector.
[0077] Specifically, the second eigenvector is low-dimensionally mapped and mapped to a preset dimensional vector space to obtain a dimensional vector.
[0078] Exemplarily, the dimension vector is:
[0079] Optionally, the dimension vector is concatenated with the classification vector, and the position encoding vector is added accordingly to obtain the image vector, including steps C1-C2:
[0080] Step C1: Perform average pooling processing on the dimension vector to obtain a vector to be processed.
[0081] Specifically, the dimension vector is average pooled according to a preset convolution kernel to obtain a vector to be processed.
[0082] Exemplarily, the preset convolution kernel may be a 2×2 convolution kernel.
[0083] Step C2: concatenate the vector to be processed, the position encoding vector and the classification vector to obtain an image vector.
[0084] Specifically, the classification vector is concatenated to the vector to be processed, and the position encoding vector is embedded to obtain the image vector.
[0085] Optionally, the reference feature vectors are screened and fused to obtain an aggregated feature vector, including steps D1-D4:
[0086] Step D1: integrate the reference feature vector through at least one fully connected layer to obtain at least one vector to be screened.
[0087] The vector to be screened is used to characterize the overall characteristics of the target image.
[0088] Specifically, the reference feature vector is input into at least one fully connected layer, and complex linear and nonlinear transformations are performed on the reference feature vector through the fully connected layer to obtain at least one vector to be screened.
[0089] Furthermore, if the number of fully connected layers is greater than 2, the number of neurons in each fully connected layer is different.
[0090] Step D2: perform feature comparison on at least one vector to be screened to obtain a comparison result.
[0091] The comparison result is used to indicate whether at least one of the vectors to be screened contains the same feature information.
[0092] Specifically, the feature information contained in at least one vector to be screened is compared to determine whether the at least one vector to be screened contains the same feature information.
[0093] Exemplarily, assuming that there are 5 vectors to be screened, among which vectors 1, 2 and 5 contain feature information of the same object, the comparison results of vectors 1, 2 and 5 are that they have the same feature information.
[0094] Step D3: Screen at least one vector to be screened according to the comparison result to obtain a distinguishing feature vector.
[0095] Specifically, if the comparison result shows that there are identical vectors to be screened, one is retained and the others are deleted to obtain a distinguishing feature vector.
[0096] Step D4: concatenate the distinguishing feature vectors to obtain an aggregated feature vector.
[0097] Specifically, the distinguishing feature vectors are concatenated according to the position encoding vectors to obtain an aggregated feature vector.
[0098] Optionally, determining the wearing condition of the safety clothing according to the aggregated feature vector includes steps E1-E3:
[0099] Step E1: Match the aggregated feature vector with the preset feature vector.
[0100] The preset feature vector is used to characterize the feature information corresponding to the detected object wearing the safety clothing.
[0101] Furthermore, the detected object may be a worker working at a distribution network operation site.
[0102] Specifically, the aggregated feature vector is compared with the preset feature vector to determine whether the preset feature vector is included in the aggregated feature vector.
[0103] Step E2: If the aggregated feature vector contains a preset feature vector, the detected person in the target image is wearing safety clothing.
[0104] Specifically, if the aggregated feature vector includes a preset feature vector, it indicates that the target image includes a detected object wearing safety clothing.
[0105] Step E3: If the aggregated feature vector does not include the preset feature vector, the detected object in the target image is not wearing safety clothing.
[0106] Specifically, if the aggregated feature vector does not include the preset feature vector, then there is no detected object wearing safety clothing in the target image, and it is considered that the detected object in the target image is not wearing safety clothing.
[0107] The technical solution of this embodiment determines the target image block and performs dimension mapping on the target image block to obtain a dimension vector, which can reduce the amount of data and improve the recognition speed; the dimension vector is spliced with the classification vector, and the position coding vector is added accordingly to obtain an image vector, which can provide the spatial position information of the target image block and also contain the overall feature vector of the object, which helps to improve the recognition accuracy; the semantic information in the image vector is captured by different weight combinations to obtain a reference feature vector, which can obtain a more advanced semantic understanding and avoid the problem of insufficient feature information capture; the reference feature vector is screened and fused to obtain an aggregate feature vector, which can remove the same feature information in the vector, thereby reducing the amount of calculation and improving the speed of calculation; the wearing condition of safety clothing is determined according to the aggregate feature vector, which can make full use of the different feature information in the target image and improve the recognition accuracy. This method can extract different feature vector information in the target image block, and judge the wearing condition of safety clothing through different feature vector information, which can greatly improve the recognition accuracy and better adapt to complex weather conditions, thereby reducing the dependence on specific scenes.
[0108] Figure 2 This is a schematic diagram of the structure of a safety clothing detection device provided by an embodiment of the present invention. This embodiment can be applied to the situation of determining whether the power distribution network staff are wearing safety helmets. The safety clothing detection device can be implemented in the form of hardware and / or software, and the safety clothing detection device can be configured in any electronic device with network communication function. Figure 2 As shown, the device includes: determining a target image block 210, an image vector determining module 220, a reference feature vector determining module 230, an aggregate feature vector determining module 240 and a recognition module 250, wherein:
[0109] Dimension vector determination module 210: used to determine the target image block and perform dimension mapping on the target image block to obtain a dimension vector; the dimension mapping is used to map the target image block to a preset dimension vector space; the target image block is the split target image; the target image contains an object that needs to be detected as target safety clothing; the dimension vector can represent the detailed feature information of the object in the target image block;
[0110] Image vector determination module 220: used to concatenate the dimension vector and the classification vector, and add the position coding vector accordingly to obtain the image vector; the classification vector is used to represent the overall feature information of the object in the target image; the position coding vector is used to represent the position of the target image block in the target image;
[0111] Reference feature vector determination module 230: used to capture semantic information in the image vector through different weight combinations to obtain a reference feature vector;
[0112] Aggregate feature vector determination module 240: used to screen and fuse reference feature vectors to obtain aggregate feature vectors;
[0113] Identification module 250: used to determine the wearing condition of the safety clothing according to the aggregated feature vector.
[0114] Optionally, the dimension vector determination module 210 includes:
[0115] Original image determination unit: used for determining the original image;
[0116] Edge feature information determination unit: used to determine edge feature information according to the original image; the edge feature information is used to characterize edge information of an object existing in the original image;
[0117] Target image determination unit: used to filter the original image according to edge feature information to obtain the target image;
[0118] Target image block determination unit: used to segment the target image to obtain target image blocks and position coding vectors; the position coding vectors correspond one-to-one to the target image blocks.
[0119] Optionally, the dimension vector determination module 210 includes:
[0120] A first feature vector determination unit: used to extract a first feature vector in a target image block; the first feature vector can represent feature information of color and texture of an object in the image;
[0121] A second feature vector determination unit: used for performing convolution and pooling processing on the first feature vector to obtain a second feature vector; the dimension of the second feature vector is greater than the dimension of the first feature vector;
[0122] Dimension vector determination unit: used for dimension mapping the second eigenvector to obtain a dimensional vector; the dimension of the dimensional vector is smaller than the dimension of the second eigenvector.
[0123] Optionally, the image vector determination module 220 includes:
[0124] A unit for determining a vector to be processed: used for performing average pooling processing on the dimension vector to obtain a vector to be processed;
[0125] Image vector determination unit: used for concatenating the vector to be processed with the position encoding vector and the classification vector to obtain an image vector.
[0126] Optionally, the aggregate feature vector determination module 240 includes:
[0127] A unit for determining a vector to be screened is used to integrate the reference feature vector through at least one fully connected layer to obtain at least one vector to be screened;
[0128] A comparison result determination unit: used to perform feature comparison on at least one vector to be screened to obtain a comparison result; the comparison result is used to indicate whether at least one vector to be screened contains the same feature information;
[0129] A distinguishing feature vector determining unit: used to screen at least one vector to be screened according to the comparison result, and aggregate the feature vectors to obtain a distinguishing feature vector;
[0130] Aggregate feature vector determination unit: used for concatenating the distinguishing feature vectors to obtain an aggregate feature vector.
[0131] Optionally, the identification module 250 includes:
[0132] Matching unit: used to match the aggregated feature vector with a preset feature vector; the preset feature vector is used to represent the feature information corresponding to the detected object wearing the safety clothing;
[0133] The first recognition unit is used for determining that the detected person in the target image is wearing safety clothing if the aggregated feature vector contains a preset feature vector;
[0134] The second recognition unit is used to determine that the detected object in the target image is not wearing safety clothing if the aggregated feature vector does not contain a preset feature vector.
[0135] The safety clothing detection device provided in the embodiment of the present invention can execute the safety clothing detection method provided in any embodiment of the present invention, and has the corresponding functions and beneficial effects of executing the safety clothing detection method. For detailed process, please refer to the relevant operations of the safety clothing detection method in the above embodiment.
[0136] Figure 3 A schematic diagram of the structure of an electronic device for implementing the safety clothing detection method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0137] like Figure 3As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0138] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0139] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the safety clothing detection method.
[0140] In some embodiments, the safety clothing detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the safety clothing detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the safety clothing detection method in any other appropriate manner (e.g., by means of firmware).
[0141] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0142] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0143] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0144] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0145] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0146] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0147] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0148] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A safety clothing detection method, characterized in that: include: Determine a target image block, and perform dimension mapping on the target image block to obtain a dimension vector; the dimension mapping is used to map the target image block to a preset dimension vector space; the target image block is a split target image; the target image contains an object that needs to be detected as target safety clothing; the dimension vector can represent the detailed feature information of the object in the target image block; The dimension vector and the classification vector are concatenated, and a position coding vector is added accordingly to obtain an image vector; the classification vector is used to represent the overall feature information of the object in the target image; the position coding vector is used to represent the position of the target image block in the target image; Capturing semantic information in the image vector by combining different weights to obtain a reference feature vector; Screening and fusing the reference feature vectors to obtain an aggregated feature vector; The wearing condition of the safety clothing is determined according to the aggregated feature vector.
2. The method according to claim 1, characterized in that The determining of the target image block comprises: Determine the original image; Determine edge feature information according to the original image; the edge feature information is used to characterize edge information of an object existing in the original image; Filtering the original image according to the edge feature information to obtain a target image; The target image is segmented to obtain target image blocks and position coding vectors; the position coding vectors correspond to the target image blocks one by one.
3. The method according to claim 1, characterized in that The step of performing dimension mapping on the target image block to obtain a dimension vector includes: Extracting a first feature vector from the target image block; the first feature vector can represent feature information of color and texture of the object in the image; Performing convolution and pooling processing on the first feature vector to obtain a second feature vector; the dimension of the second feature vector is greater than the dimension of the first feature vector; The second feature vector is dimensionally mapped to obtain a dimension vector; the dimension of the dimension vector is smaller than the dimension of the second feature vector.
4. The method according to claim 1, characterized in that: The step of concatenating the dimension vector with the classification vector and adding a corresponding position encoding vector to obtain an image vector includes: Perform average pooling on the dimension vector to obtain a vector to be processed; The vector to be processed is concatenated with the position encoding vector and the classification vector to obtain an image vector.
5. The method according to claim 1, characterized in that The screening and fusion of the reference feature vectors to obtain an aggregated feature vector includes: Performing feature integration on the reference feature vector through at least one fully connected layer to obtain at least one vector to be screened; Performing feature comparison on the at least one vector to be screened to obtain a comparison result; the comparison result is used to indicate whether the at least one vector to be screened contains the same feature information; Screening the at least one vector to be screened according to the comparison result to obtain a distinguishing feature vector; The distinguishing feature vectors are concatenated to obtain an aggregated feature vector.
6. The method according to claim 1, characterized in that The step of determining the wearing condition of the safety clothing according to the aggregated feature vector includes: Matching the aggregated feature vector with a preset feature vector; the preset feature vector is used to characterize feature information corresponding to the detected object wearing the safety clothing; If the aggregated feature vector includes a preset feature vector, the detected person in the target image is wearing safety clothing; If the aggregated feature vector does not include the preset feature vector, the detected person in the target image is not wearing safety clothing.
7. A safety clothing detection device, characterized in that: include: A dimension vector determination module is used to determine a target image block and perform dimension mapping on the target image block to obtain a dimension vector; the dimension mapping is used to map the target image block to a preset dimension vector space; the target image block is a split target image; the target image contains an object that needs to be detected as target safety clothing; the dimension vector can represent the detailed feature information of the object in the target image block; An image vector determination module is used to concatenate the dimension vector and the classification vector, and to add a corresponding position coding vector to obtain an image vector; the classification vector is used to characterize the overall feature information of the object in the target image; The position encoding vector is used to represent the position of the target image block in the target image; A reference feature vector determination module, used to capture the semantic information in the image vector through different weight combinations to obtain a reference feature vector; An aggregated feature vector determination module is used to screen and fuse the reference feature vectors to obtain an aggregated feature vector; The identification module is used to determine the wearing condition of the safety clothing according to the aggregated feature vector.
8. The device according to claim 7, characterized in that The aggregated feature vector determination module comprises: A to-be-screened vector determination unit is used to perform feature integration on the reference feature vector through at least one fully connected layer to obtain at least one to-be-screened vector; A comparison result determination unit is used to perform feature comparison on the at least one vector to be screened to obtain a comparison result; the comparison result is used to indicate whether the at least one vector to be screened contains the same feature information; A distinguishing feature vector determining unit: configured to screen the at least one vector to be screened according to the comparison result, and aggregate feature vectors to obtain a distinguishing feature vector; Aggregate feature vector determination unit: used for concatenating the distinguishing feature vectors to obtain an aggregate feature vector.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the safety clothing detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the safety clothing detection method according to any one of claims 1 to 7 when executed.