A method and device for detecting violations of hot work
By using the directional feature map of width and height attention weights in the feature extraction network of the target detection model, combined with the coordinate-aware attention module, violations in the fire scene are detected in real time, solving the problem of hot work specification detection in the existing technology. The real-time problem is solved and the timeliness of early warning is improved.
Patent Information
- Application Number
- CN202311474524.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-11-07
AI Technical Summary
The existing target detection model cannot detect hot work specifications in real time, which makes it difficult to report violations of hot work in a timely manner and affects the timeliness of early warnings.
The directional feature map using width attention weight and height attention weight in the feature extraction network of the target detection model is used for feature extraction, combined with the coordinate-aware attention module, to detect violations in the fire scene in real time, and through preset actions Fire work rules determine whether a violation has occurred.
It realizes real-time detection of violations at fire sites, improves the timeliness of early warning, and ensures the timeliness and accuracy of detection results.
Smart Images

Figure CN117456461B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for detecting violations of hot work operations. Background Art
[0002] During the construction of subway projects, when there are operations such as steel bar connection, waterproof material application, and material grinding, electric welding, blowtorches, electric drills, and grinding wheels are often used in fire-prohibited areas or flammable and explosive places to carry out welding, cutting, grinding, and other hot work that may produce flames, sparks, and red-hot surfaces. According to the technical specifications for fire safety at construction sites, when hot work is carried out at the construction site, a hot work permit should be issued in advance, combustible materials at the construction site should be cleared, the person who starts the work must hold a permit to start the work, the caretaker should be on-site for supervision, and fire extinguishers should be placed in the hot work area.
[0003] At present, commonly used target detection models (for example, Faster R-CNN) cannot perform real-time detection of hot work regulations. When encountering illegal operations, they cannot meet the requirements of timely reporting of illegal hot work, affecting the real-time judgment of illegal hot work detection. In addition, when existing detection methods detect and judge hot work operations, they often can only detect the compliance of hot work after the hot work behavior occurs. This will lead to a long response time and reduce the timeliness of the warning. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a method and device for detecting violations in hot work operations, which can detect in real time whether there are any illegal operations at the hot work site, so as to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0005] The present application provides a method for detecting violations of hot work, the method comprising:
[0006] Obtain real-time operation images at the fire scene;
[0007] In a feature extraction network of a target detection model, a target feature map of the real-time operation image is obtained by performing feature extraction on a directional feature map carrying a width attention weight and a height attention weight; wherein the directional feature map is obtained by extracting a height feature and a width feature of the real-time operation image using a coordinate perception attention module;
[0008] In the target recognition network of the target detection model, by identifying the target feature map, the target object related to the hot work in the real-time operation image is annotated to obtain an annotated operation image annotated with the target detection result;
[0009] Based on the target detection results marked in the marked operation image and in combination with preset hot work rules, it is determined whether there is any illegal operation behavior in the hot work site.
[0010] In a possible implementation, the directional feature map is extracted by the following steps:
[0011] In the feature extraction network of the target detection model, the real-time operation image is preprocessed to extract the original input feature map of the real-time operation image;
[0012] Using the coordinate-aware attention module, the original input feature map is subjected to global average pooling processing in the height dimension and the width dimension respectively, and an initial width feature map of the original input feature map in the width direction and an initial height feature map in the height direction are mapped;
[0013] Based on the initial width feature map and the initial height feature map, a width attention weight of the original input feature map in the width direction and a height attention weight in the height direction are calculated;
[0014] The width attention weight and the height attention weight are used to perform weighted multiplication processing on the original input feature map to calculate the directional feature map of the real-time operation image.
[0015] In a possible implementation, the calculating, based on the initial width feature map and the initial height feature map, a width attention weight of the original input feature map in the width direction and a height attention weight in the height direction includes:
[0016] The initial height feature map and the initial width feature map are mapped and merged into a spliced feature map through a stacking operation;
[0017] Performing a two-dimensional convolution process on the concatenated feature map to obtain an initial transition feature map of the original input feature map;
[0018] Performing batch normalization and nonlinear processing on the initial transition feature map to extract the transition feature map of the original input feature;
[0019] Separating a transition height feature map and a transition width feature map from the transition feature map;
[0020] The transition height feature map and the transition width feature map are transposed and activated by a function, respectively, to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0021] In a possible implementation, the preprocessing includes slicing operations, convolution operations, and downsampling processing; in the feature extraction network of the target detection model, preprocessing the real-time operation image to extract a feature map of the real-time operation image includes:
[0022] In the feature extraction network of the target detection model, a slicing operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image;
[0023] Using a convolution module to perform a convolution operation on the first feature map, and obtaining a second feature map by performing dimensionality reduction processing on the first feature map in a height dimension and a width dimension;
[0024] The second feature map is downsampled by using the C3 module, and the original input feature map of the real-time operation image is obtained by reducing the dimension of the second feature map in the height dimension and the width dimension.
[0025] In a possible implementation, the using the Focus structure to perform a slicing operation on the real-time operation image to obtain a first feature map of the real-time operation image includes:
[0026] Slicing the real-time operation image into a plurality of operation slice images;
[0027] Perform channel superposition processing on the multiple operation slice images to obtain an integrated operation image of the real-time operation image;
[0028] A convolution operation is performed on the integrated operation image to obtain a first feature map of the real-time operation image.
[0029] In a possible implementation, the using a convolution module to perform a convolution operation in the first feature map, and obtaining a second feature map by performing dimensionality reduction processing on the first feature map in a height dimension and a width dimension, includes:
[0030] Performing a two-dimensional convolution process on the first feature map to obtain a first feature map after the convolution process;
[0031] The first feature map after the convolution process is subjected to batch normalization and nonlinear processing to extract a second feature map of the real-time operation image.
[0032] In a possible implementation, the determining whether there is any illegal operation behavior in the hot work site based on the target detection result marked in the marked work image and in combination with preset hot work rules includes:
[0033] Determine whether there is a hot flame in the target detection result marked in the marking operation image;
[0034] If yes, based on the flame detection frame of the hot work flame and based on the historical operation information of the hot work site, a prior hot work area is marked in the annotated operation image;
[0035] Based on the flame detection frame of the hot work flame, a hot work operation standard area is determined in the annotated operation image by adjusting the prior hot work area;
[0036] Determine whether there is a person doing hot work in the target detection result;
[0037] If so, determining whether there is a work-assisting object in the target detection result;
[0038] If so, based on the positional relationship between the work auxiliary object and the hot work specification area, determine whether there is any illegal work behavior in the hot work site.
[0039] In a possible implementation, determining whether there is any illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work standard area includes:
[0040] Taking a specific coordinate point of the result detection frame of the work auxiliary object as a detection point, calling an area detection function to determine whether the work auxiliary object is located in the hot work specification area;
[0041] If yes, confirm that there is no illegal operation at the hot work site;
[0042] Otherwise, it is determined that illegal operations have occurred at the fire scene.
[0043] In a possible implementation, the target detection model is trained by the following steps:
[0044] Get sample job images;
[0045] Annotating the sample detection results in the sample operation image to obtain a sample annotation label of the sample operation image;
[0046] Based on the sample work images and the sample annotation labels, with the help of a triplet loss function, a pre-constructed initial detection model is trained with the goal of shortening the center distance between the hot work flame and the hot work personnel and increasing the center distance between the hot work flame and the work auxiliary object to obtain a trained target detection model.
[0047] The present application also provides a device for detecting violations of hot work, the device comprising:
[0048] An image acquisition module is used to acquire real-time operation images of the fire scene;
[0049] A feature extraction module, used for obtaining a target feature map of the real-time operation image by performing feature extraction on a directional feature map carrying a width attention weight and a height attention weight in a feature extraction network of a target detection model; wherein the directional feature map is obtained by extracting a height feature and a width feature of the real-time operation image using a coordinate perception attention module;
[0050] A target recognition module is used to mark the target objects related to the hot work in the real-time operation image by identifying the target feature map in the target recognition network of the target detection model, so as to obtain a marked operation image marked with the target detection result;
[0051] The violation determination module is used to determine whether there is any illegal operation behavior in the hot work site based on the target detection results marked in the marked operation image and in combination with preset hot work rules.
[0052] In a possible implementation, the feature extraction module is used to extract the directional feature map through the following steps:
[0053] In the feature extraction network of the target detection model, the real-time operation image is preprocessed to extract the original input feature map of the real-time operation image;
[0054] Using the coordinate-aware attention module, the original input feature map is subjected to global average pooling processing in the height dimension and the width dimension respectively, and an initial width feature map of the original input feature map in the width direction and an initial height feature map in the height direction are mapped;
[0055] Based on the initial width feature map and the initial height feature map, a width attention weight of the original input feature map in the width direction and a height attention weight in the height direction are calculated;
[0056] The width attention weight and the height attention weight are used to perform weighted multiplication processing on the original input feature map to calculate the directional feature map of the real-time operation image.
[0057] In a possible implementation, when the feature extraction module is used to calculate the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction based on the initial width feature map and the initial height feature map, the feature extraction module is used to:
[0058] The initial height feature map and the initial width feature map are mapped and merged into a spliced feature map through a stacking operation;
[0059] Performing a two-dimensional convolution process on the concatenated feature map to obtain an initial transition feature map of the original input feature map;
[0060] Performing batch normalization and nonlinear processing on the initial transition feature map to extract the transition feature map of the original input feature;
[0061] Separating a transition height feature map and a transition width feature map from the transition feature map;
[0062] The transition height feature map and the transition width feature map are transposed and activated by a function, respectively, to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0063] In a possible implementation, the image feature extraction process includes a slicing operation, a convolution operation, and a downsampling process; when the feature extraction module is used in the feature extraction network of the target detection model to process the real-time operation image to extract the original input feature map of the real-time operation image, the feature extraction module is used to:
[0064] In the feature extraction network of the target detection model, a slicing operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image;
[0065] Using a convolution module to perform a convolution operation on the first feature map, and obtaining a second feature map by performing dimensionality reduction processing on the first feature map in a height dimension and a width dimension;
[0066] The second feature map is downsampled by using the C3 module, and the original input feature map of the real-time operation image is obtained by reducing the dimension of the second feature map in the height dimension and the width dimension.
[0067] In a possible implementation manner, when the feature extraction module is used to perform a slicing operation on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image, the feature extraction module is used to:
[0068] Slicing the real-time operation image into a plurality of operation slice images;
[0069] Perform channel superposition processing on the multiple operation slice images to obtain an integrated operation image of the real-time operation image;
[0070] A convolution operation is performed on the integrated operation image to obtain a first feature map of the real-time operation image.
[0071] In a possible implementation, when the feature extraction module is used to perform a convolution operation in the first feature map using the convolution module, and obtain the second feature map by performing dimensionality reduction processing on the first feature map in the height dimension and the width dimension, the feature extraction module is used to:
[0072] Performing a two-dimensional convolution process on the first feature map to obtain a first feature map after the convolution process;
[0073] The first feature map after the convolution processing is subjected to batch normalization processing and nonlinear processing to extract a second feature map of the real-time operation image.
[0074] In a possible implementation manner, when the violation determination module is used to determine whether there is any illegal operation behavior in the hot work site based on the target detection result marked in the marked work image and in combination with the preset hot work rules, the violation determination module is used to:
[0075] Determine whether there is a hot flame in the target detection result marked in the marking operation image;
[0076] If yes, based on the flame detection frame of the hot work flame and based on the historical operation information of the hot work site, a prior hot work area is marked in the annotated operation image;
[0077] Based on the flame detection frame of the hot work flame, a hot work operation standard area is determined in the annotated operation image by adjusting the prior hot work area;
[0078] Determine whether there is a person doing hot work in the target detection result;
[0079] If so, determining whether there is a work-assisting object in the target detection result;
[0080] If so, based on the positional relationship between the work auxiliary object and the hot work specification area, determine whether there is any illegal work behavior in the hot work site.
[0081] In a possible implementation manner, when the violation determination module is used to determine whether there is any illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work specification area, the violation determination module is used to:
[0082] Taking a specific coordinate point of the result detection frame of the work auxiliary object as a detection point, calling an area detection function to determine whether the work auxiliary object is located in the hot work specification area;
[0083] If yes, confirm that there is no illegal operation at the hot work site;
[0084] Otherwise, it is determined that illegal operations have occurred at the fire scene.
[0085] In a possible implementation manner, the violation detection device is used to train the target detection model through the following steps:
[0086] Get sample job images;
[0087] Annotating the sample detection results in the sample operation image to obtain a sample annotation label of the sample operation image;
[0088] Based on the sample work images and the sample annotation labels, with the help of a triplet loss function, a pre-constructed initial detection model is trained with the goal of shortening the center distance between the hot work flame and the hot work personnel and increasing the center distance between the hot work flame and the work auxiliary object to obtain a trained target detection model.
[0089] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned method for detecting violations of hot work are performed.
[0090] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for detecting violations of hot work operations as described above are executed.
[0091] The embodiment of the present application provides a method and device for detecting violations of hot work operations, which obtains a real-time operation image of the hot work site; in the feature extraction network of the target detection model, feature extraction is performed on the directional feature map carrying the width attention weight and the height attention weight to obtain the target feature map of the real-time operation image; in the target recognition network of the target detection model, the target object related to the hot work operation in the real-time operation image is marked by identifying the target feature map to obtain a marked operation image marked with the target detection result; based on the marked target detection results in the marked operation image, combined with the preset hot work operation rules, it is determined whether there is any illegal operation behavior in the hot work site. In this way, it is possible to detect whether there is any illegal operation behavior in the hot work site in real time to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0092] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0094] Figure 1 A flow chart of a method for detecting violations of hot work provided in an embodiment of the present application;
[0095] Figure 2 A schematic diagram of a Focus structure provided in an embodiment of the present application;
[0096] Figure 3 A schematic diagram of a convolution module provided in an embodiment of the present application;
[0097] Figure 4 A schematic diagram of a coordinate perception attention module provided in an embodiment of the present application;
[0098] Figure 5 A schematic diagram of an SPPF module provided in an embodiment of the present application;
[0099] Figure 6 A schematic diagram of a feature extraction network provided in an embodiment of the present application;
[0100] Figure 7 A schematic diagram of a target detection model provided in an embodiment of the present application;
[0101] Figure 8 A schematic diagram of a hot work alarm process provided in an embodiment of the present application;
[0102] Fig. 9 A schematic diagram of the structure of a hot work violation detection device provided in an embodiment of the present application;
[0103] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0104] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0105] Research has found that currently, commonly used target detection models (for example, Faster R-CNN) cannot perform real-time detection of hot work regulations. When encountering illegal operations, they cannot meet the requirements for timely reporting of illegal hot work, affecting the real-time judgment of illegal hot work detection. In addition, when existing detection methods detect and judge hot work operations, they often can only detect the compliance of hot work after the hot work behavior occurs. This will lead to a long response time and reduce the timeliness of the early warning.
[0106] Based on this, an embodiment of the present application provides a method for detecting violations in hot work operations, which can detect in real time whether there are any illegal operations at the hot work site, so as to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0107] See also Figure 1 , Figure 1 This is a flow chart of a method for detecting violations of hot work provided in an embodiment of the present application. Figure 1 As shown in , the method for detecting violations of hot work operations provided by the embodiment of the present application includes:
[0108] S101, obtaining real-time operation images of the fire scene.
[0109] S102. In a feature extraction network of a target detection model, feature extraction is performed on a directional feature map carrying width attention weights and height attention weights to obtain a target feature map of the real-time operation image.
[0110] S103. In the target recognition network of the target detection model, target objects related to the hot work in the real-time operation image are labeled by identifying the target feature map, so as to obtain a labeled operation image labeled with the target detection result.
[0111] S104: Based on the detection results of the marked targets in the marked operation image and in combination with preset hot work rules, determine whether there are any illegal operations in the hot work site.
[0112] A method for detecting violations of hot work provided by an embodiment of the present application uses a camera mounted on a wall to collect real-time work images of the hot work site, and uses a coordinate perception attention module in a feature extraction network of a pre-trained target detection model to extract features on a directional feature map carrying width attention weights and height attention weights to obtain a target feature map of the real-time work image, so that the target feature map not only contains information between channels in the image, but also considers the position information of the image in the directional dimension, thereby broadening the information contained in the feature map, and then, the target detection model can more accurately locate the target detection result, and obtain a labeled work image marked with the target detection result; on the basis of obtaining the labeled work image, based on the target detection results marked in the labeled work image, combined with the preset hot work rules, determine whether there is any illegal work behavior in the hot work site. In this way, it is possible to detect whether there is any illegal work behavior in the hot work site in real time to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0113] In step S101, the fire scene is monitored by a fixed-focus shooting camera mounted on the wall to obtain real-time operation images at the fire scene.
[0114] Here, the real-time operation image can be a video frame image disassembled from the monitoring video of the fire scene; it can also be acquired according to a preset acquisition interval, which can be determined according to the actual situation and is not limited here.
[0115] Here, in order to cope with the complex working environment at the fire scene and the problem of large body changes during the operation of the fire operator, a coordinate perception attention module can be added to the target detection model to extract features from the real-time work image in more directional dimensions (i.e., height dimension and width dimension) to enrich the content included in the feature map.
[0116] In step S102, the acquired real-time work image is input into the target recognition network of the target detection model; the coordinate perception attention module in the target recognition network can realize the extraction of the directional feature map carrying the width attention weight and the height attention weight while considering both the channel information and the direction information included in the real-time work image; in the feature extraction network of the target detection model, the target feature map of the real-time work image is obtained by performing feature extraction on the directional feature map carrying the width attention weight and the height attention weight.
[0117] The directional feature map is obtained by extracting the height features and width features of the real-time operation image using a coordinate perception attention module.
[0118] In one implementation, step S102 includes:
[0119] S1021. In the feature extraction network of the target detection model, preprocess the real-time operation image to extract an original input feature map of the real-time operation image.
[0120] In this step, in the feature extraction network of the target detection model, the real-time operation image is preprocessed by slicing operation, convolution operation (Conv), C3 operation and the like to extract features of the real-time operation image and obtain the original input feature map of the real-time operation image.
[0121] In one implementation, step S1021 includes:
[0122] S10211. In the feature extraction network of the target detection model, a slicing operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image.
[0123] In this step, in the feature extraction network of the target detection model, the real-time operation image is sliced using the Focus structure, and a convolution operation is performed on the multiple operation slice images obtained by the slicing process to reduce the real-time operation image in height and width, that is, to constrain the real-time operation image in terms of specification size, and obtain the first feature map of the real-time operation image.
[0124] In one embodiment, step S10211 includes: slicing the real-time operation image to equally divide it into multiple operation slice images; performing channel superposition processing on the multiple operation slice images to obtain an integrated operation image of the real-time operation image; performing a convolution operation on the integrated operation image to obtain a first feature map of the real-time operation image.
[0125] In this step, first, the real-time operation image is sliced into equal parts using the Focus structure to constrain the size of the real-time operation image to an operation slice image of C / 4*H / 2*W / 2; secondly, a channel superposition (Concat) process is performed on the multiple operation slice images obtained by the equal slicing to obtain an integrated operation image of the real-time operation image; then, a convolution operation is performed on the spliced integrated operation image to extract the first feature map from the real-time operation image.
[0126] See also Figure 2 , Figure 2 A schematic diagram of a Focus structure provided in an embodiment of the present application. Figure 2 As shown, the Focus structure 2a includes a slicing layer 2a-1, a splicing layer 2a-2 and a convolution module 2a-3; the slicing layer 2a-1 can slice the real-time job image into four equal parts into four job slicing images; and then the four job slicing image channels are superimposed into an integrated job image through the splicing layer 2a-2; the convolution module 2a-3 performs a convolution operation on the integrated job image to extract a first feature map (not shown in the figure).
[0127] S10212. Use a convolution module to perform a convolution operation on the first feature map, and obtain a second feature map by performing dimensionality reduction processing on the first feature map in height dimension and width dimension.
[0128] In this step, in the feature extraction network of the target detection model, a convolution module is used to perform a convolution operation on the first feature map output by the Focus structure to reduce the dimension of the first feature map in terms of height and width dimensions, thereby reducing the height and width of the first feature map to half of the original height and width, so as to extract the second feature map based on the first feature map.
[0129] See also Figure 3 , Figure 3 A schematic diagram of a convolution module provided in an embodiment of the present application. Figure 3 As shown, the convolution module 3a includes a two-dimensional convolution processing layer 3a-1, a BN layer 3a-2 and a SiLu layer 3a-3.
[0130] In one embodiment, step S10212 includes: performing two-dimensional convolution processing on the first feature map to obtain a first feature map after convolution processing; performing batch normalization processing and nonlinear processing on the first feature map after convolution processing to extract a second feature map of the real-time operation image.
[0131] In this step, first, two-dimensional convolution processing is performed on the first feature map in the convolution module to obtain the first feature map after the convolution processing; then, batch normalization processing is performed on the first feature map after the two-dimensional convolution processing through the BN (Batch Normalization) layer in the convolution module, and the normalized first feature map is nonlinearly processed using the SiLu activation function to further extract the second feature map based on the first feature map.
[0132] S10213. Use the C3 module to downsample the second feature map, and obtain the original input feature map of the real-time operation image by performing dimensionality reduction processing on the second feature map in the height dimension and the width dimension.
[0133] In this step, in the feature extraction network of the target detection model, the C3 module is used to downsample the second feature map output by the convolution module, so as to reduce the dimension of the second feature map again in the height dimension and the width dimension on the basis of the second feature map, and reduce the height and width of the second feature map to half of the original, so as to extract the original input feature map of the real-time operation image with a size of C*H*W on the basis of the second feature map; wherein C represents the number of channels Channel, H represents the image height Height, and W represents the image width Width.
[0134] Specifically, two-dimensional convolution processing is performed on the second feature map to obtain a second feature map after convolution processing; the second feature map after convolution processing and the second feature map are horizontally spliced to obtain a spliced second feature map; down-sampling processing is performed on the spliced second feature map to extract the feature map of the real-time operation image.
[0135] Here, after preprocessing the original input feature map of the real-time operation image, the coordinate-aware attention module can be used to extract the directional feature map carrying width attention weights and height attention weights, so that the model can better understand the relationship between different positions.
[0136] S1022. Using the coordinate-aware attention module, perform global average pooling processing on the original input feature map in the height dimension and the width dimension respectively, and map the original input feature map to obtain an initial width feature map in the width direction and an initial height feature map in the height direction.
[0137] In this step, the coordinate-aware attention module performs global average pooling on the original input feature map in the height dimension and the width dimension respectively, so as to extract an initial width feature map of size C*1*W and an initial height feature map of size C*H*1 from the original input feature map of the real-time work image of size C*H*W input into the coordinate-aware attention module.
[0138] Among them, the initial width feature map represents the attention distribution of the feature map width, and the initial height feature map represents the attention distribution of the feature map height.
[0139] S1023. Based on the initial width feature map and the initial height feature map, calculate the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0140] In this step, the initial height feature map and the initial width feature map are subjected to feature extraction processes such as splicing, two-dimensional convolution, batch normalization, and nonlinear processing to calculate the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0141] In one implementation, step S1023 includes:
[0142] S10231. Merge the initial height feature map and the initial width feature map into a concatenated feature map by mapping through a stacking operation.
[0143] S10232. Perform two-dimensional convolution processing on the concatenated feature map to obtain an initial transition feature map of the original input feature map.
[0144] In this step, a 1*1 convolution kernel is used to perform two-dimensional convolution processing on the spliced feature map to reduce the number of channels of the spliced feature map to obtain an initial transition feature map of the original input feature map.
[0145] S10233. Perform batch normalization and nonlinear processing on the initial transition feature map to extract the transition feature map of the original input feature.
[0146] In this step, based on the initial transition feature map, the initial transition feature map is subjected to batch normalization processing and nonlinear processing to extract a transition feature map with a size of (C / r)*1*(W+H).
[0147] Among them, r is a hyperparameter between two adjacent layers of the network, which is used to control the reduction rate of the block.
[0148] S10234. Separate a transition height feature map and a transition width feature map from the transition feature map.
[0149] In this step, the transition feature map is split in the height dimension and the width dimension respectively according to the width and height of the transition feature map, and the transition height feature map and the transition width feature map of the original input feature map are separated.
[0150] S10235. Perform transposition and activation function processing on the transition height feature map and the transition width feature map respectively to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0151] In this step, a 1*1 convolution kernel is used to perform two-dimensional convolution processing on the split transition height feature map and transition width feature map to restore the number of channels of the split transition height feature map and transition width feature map to the original number of channels of the real-time working image, so as to adjust the number of channels; and then after the sigmoid activation function, a height attention weight of C*H*1 and a width attention weight of C*1*W are obtained.
[0152] S1024. Using the width attention weight and the height attention weight, perform weighted multiplication processing on the original input feature map to calculate a directional feature map of the real-time operation image.
[0153] See also Figure 4 , Figure 4 Schematic diagram of a coordinate perception attention module provided in an embodiment of the present application. Figure 4 As shown, the coordinate-aware attention module 4a includes an input layer 4a-1, an average pooling layer 4a-2, a spliced convolution module 4a-3, a normalization and non-linear processing layer 4a-4, a two-dimensional convolution layer 4a-5, an activation layer 4a-6 and a multiplication weighted processing layer 4a-7.
[0154] Furthermore, the feature extraction network may also include an SPPF module, which concatenates the input feature map with the maximum pooling result obtained each time after the input feature map is processed by the maximum pooling three times.
[0155] See also Figure 5 , Figure 5 This is a schematic diagram of an SPPF module provided in an embodiment of the present application. Figure 5 As shown, the SPPF module 5a includes a maximum pooling layer 5a-1 and a concatenation layer 5a-2.
[0156] For further information, see Figure 6 , Figure 6 Schematic diagram of a feature extraction network in a target detection model provided in an embodiment of the present application. Figure 6 As shown, the feature extraction network 6b includes a Focus structure 6b-1, a convolution module 6b-2, a C3 module 6b-3, a coordinate-aware attention module 6b-4 and a SPPF module 6b-5.
[0157] In step S103, in the target recognition network of the target detection model, by identifying the target feature map, the channel, direction (height, width) and other information carried in the target feature map is analyzed, and the target objects related to the hot work are marked in the real-time operation image to obtain a marked operation image marked with the target detection results.
[0158] See also Figure 7 , Figure 7 A schematic diagram of a target detection model provided in an embodiment of the present application. Figure 7 As shown, the target detection model 7a includes a feature extraction network 6a, a target recognition network 7b and an output layer 7c; wherein the target recognition network 7b includes multiple convolution modules 7b-1, multiple upsampling modules 7b-2, multiple splicing layers 7b-3 and multiple C3 modules 7b-4, and the target feature map (not shown in the figure) output from the feature extraction network 6a is input to the target recognition network 7b, and the target recognition network 7b outputs a labeled job image (not shown in the figure) labeled with the target detection results.
[0159] In one embodiment, the target detection model is trained by the following steps:
[0160] Step a: Obtain a sample job image.
[0161] Step b: annotating the sample detection results in the sample operation image to obtain a sample annotation label of the sample operation image.
[0162] Step c, based on the sample work image and the sample annotation label, with the help of the triplet loss function, with the goal of shortening the center distance between the hot work flame and the hot work personnel, and increasing the center distance between the hot work flame and the work auxiliary object, train the pre-constructed initial detection model to obtain a trained target detection model.
[0163] In this step, considering that there should be a strong correlation between the hot work flame and the hot work worker, the strong correlation between the hot work flame and the hot work worker can be regarded as a constraint condition. In the process of training the target detection model, the constructed initial detection model is constrained; specifically, the sample operation image is used as the input feature, and the sample annotation label is used as the output feature to train the pre-constructed initial detection model; and in the training process, with the help of the triplet loss function, the initial detection model is constrained with the goal of shortening the center distance between the hot work flame and the hot work worker and increasing the center distance between the hot work flame and the work auxiliary object, so as to obtain a trained target detection model; thereby, the purpose of improving the accuracy of the detection result is achieved.
[0164] Here, the triplet loss function is:
[0165] L=max(d(a,p)-d(a,n)+margin,0);
[0166] Among them, d(a, p) represents the center distance between the hot work flame and the hot work worker, and d(a, n) represents the center distance between the hot work flame and the work auxiliary object.
[0167] Among them, target objects related to hot work may include hot work flames, hot work personnel and work auxiliary objects, and work auxiliary objects may include fire-fighting equipment and fire-watching personnel.
[0168] In step S104, after marking the target detection results, the preset hot work rules can be referred to, and by determining whether each target detection result meets the preset hot work rules, it can be determined whether there are any illegal operations in the hot work site.
[0169] In one implementation, step S104 includes:
[0170] S1041. Determine whether there is any hot flame in the target detection result marked in the marking operation image.
[0171] In this step, the target detection results marked in the marked operation image are identified one by one to determine whether there is a hot work flame in the marked operation image, so as to determine whether the current hot work site is a hot work scene according to the hot work flame.
[0172] S1042: If yes, based on the flame detection frame of the hot work flame and the historical operation information of the hot work site, a prior hot work area is marked in the annotated operation image.
[0173] In this step, if there is a fire flame in the current fire scene, it can be determined that the current fire site is a fire scene; at this time, based on the flame detection box of the fire flame in the annotated work image and combined with the historical work information of the fire scene, the prior fire area of the fire scene can be drawn in the annotated work image.
[0174] S1043: Based on the flame detection frame of the hot work flame, determine the hot work operation standard area in the annotated operation image by adjusting the prior hot work area.
[0175] In this step, considering that the flame position of the hot work flame is not the same each time the hot work operation is performed, the hot work area of the actual operation will deviate. In order to avoid inaccurate illegal operation behaviors due to deviations in the area, at this time, according to the flame detection frame of the hot work flame, the prior hot work area marked in the marked operation image is adjusted to determine the standard hot work area for this hot work operation.
[0176] S1044. Determine whether there are personnel performing hot work in the target detection results.
[0177] Here, considering that hot work must be performed by personnel with professional qualifications, when detecting illegal hot work operations, it is necessary to determine whether there are hot work personnel in the target detection results marked in the marked operation image.
[0178] Among them, at the hot work site, hot work workers need to wear uniforms of specific colors. Therefore, whether there are hot work workers at the hot work site can be determined based on whether the uniforms of specific colors are detected.
[0179] S1045. If so, determine whether there is a work auxiliary object in the target detection result.
[0180] In this step, in order to further increase the safety of the fire operation site, there must be work auxiliary objects at the fire scene, such as fire-fighting equipment, fire-watching personnel, etc. Therefore, under the premise that there are fire operation personnel at the fire scene, it is necessary to further determine whether there are work auxiliary objects in the target detection results marked in the marked operation image.
[0181] S1046. If so, determine whether there is any illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work specification area.
[0182] In this step, it is taken into consideration that if the work auxiliary object is far away from the standardized area for hot work, it will not be able to reach the standardized area for hot work in time when a dangerous situation occurs. Therefore, even if there is a work auxiliary object, it is necessary to further combine the positional relationship between the work auxiliary object and the standardized area for hot work to determine whether there is any illegal work behavior at the hot work site.
[0183] In one embodiment, step S1046 includes: taking a specific coordinate point of a result detection box of the work auxiliary object as a detection point, calling an area detection function to determine whether the work auxiliary object is located within the standard area of the hot work operation; if so, determining that there is no illegal work behavior at the hot work site; otherwise, determining that there is illegal work behavior at the hot work site.
[0184] In this step, the area detection function (cv2.pointPolygonTest()) is used to determine whether each work auxiliary object is located in the specification area of the hot work operation; specifically, the specific coordinate points of the result detection box of the work auxiliary object in the annotated work image are used as detection points (for example, the two points in the lower left corner and the lower right corner are used as detection points), and the area detection function (cv2.pointPolygonTest()) is called to determine whether the work auxiliary object is located in the specification area of the hot work operation.
[0185] If the auxiliary operation object is located within the standardized area for hot work, it is determined that there is no illegal operation behavior at the hot work site; otherwise, it is determined that there is illegal operation behavior at the hot work site.
[0186] Specifically, if there are fire watchers, and according to the result detection box of the fire watchers in the annotated work image, it is determined that the fire watchers are located within the standardized area for fire operations, then the fire watchers are judged to be on duty and in compliance with regulations, and there is no illegal operation at the fire site; if there are no fire watchers, or the fire watchers are not located within the standardized area for fire operations, an illegal fire alarm is issued, and the alarm type is that the caretaker is off duty.
[0187] If there is fire-fighting equipment, and according to the result detection box of the fire-fighting equipment in the annotated operation image, it is determined that the fire-fighting equipment is located within the standardized area for hot work, then it is judged that the fire-fighting equipment is configured in a standardized manner, and there is no illegal operation at the hot work site; if there is no fire-fighting equipment, or the fire-fighting equipment is not located within the standardized area for hot work, an illegal hot work alarm is issued, and the alarm type is that there is no fire-fighting equipment in the surrounding area.
[0188] See also Figure 8 , Figure 8 This is a schematic diagram of a hot work alarm process provided by an embodiment of the present application. Figure 8 As shown, step 801: obtain a real-time operation image of the hot work site; step 802: detect the real-time operation image through the target detection model to obtain a labeled operation image marked with the target detection result; step 803: determine whether there is a hot work flame in the target detection result marked in the labeled operation image; if so, execute step 804; if not, execute step 810; step 804: according to the flame detection frame of the hot work flame, by adjusting the prior hot work area of the hot work site, determine the hot work standard area; step 805: determine whether there is a hot work operator in the target detection result; if so, execute step 806; if not, execute step 811; step 806: determine whether there is a hot work operator in the target detection result operating personnel; if so, execute step 807; if not, execute step 812; step 807: determine whether there is fire-fighting equipment in the target detection result; if so, execute step 808; if not, execute step 813; step 808: determine whether the fire-watching personnel and fire-fighting equipment are located in the fire-fighting operation specification area; if so, execute step 809; if not, execute step 814; step 809: there are no illegal operations at the fire scene; step 810: non-fire scene; step 811: issue an alarm: non-special worker fire; step 812: issue an alarm: the fire-watching personnel are off duty; step 813: issue an alarm: no fire-fighting equipment; step 814: issue an alarm: there are illegal operations at the fire scene.
[0189] The method for detecting violations of hot work provided in the embodiment of the present application obtains a real-time work image of the hot work site; in the feature extraction network of the target detection model, by performing feature extraction on the directional feature map carrying the width attention weight and the height attention weight, a target feature map of the real-time work image is obtained; in the target recognition network of the target detection model, by identifying the target feature map, the target objects related to the hot work in the real-time work image are marked to obtain a marked work image marked with the target detection result; based on the marked target detection results in the marked work image, combined with the preset hot work rules, it is determined whether there are any illegal work behaviors in the hot work site. In this way, it is possible to detect whether there are any illegal work behaviors in the hot work site in real time, so as to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0190] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a hot work violation detection device provided in an embodiment of the present application. Fig. 9 As shown in , the violation detection device 900 includes:
[0191] An image acquisition module 910 is used to acquire real-time operation images of the fire scene;
[0192] A feature extraction module 920 is used to obtain a target feature map of the real-time operation image by performing feature extraction on a directional feature map carrying a width attention weight and a height attention weight in a feature extraction network of a target detection model; wherein the directional feature map is obtained by extracting a height feature and a width feature of the real-time operation image using a coordinate perception attention module;
[0193] A target recognition module 930 is used to mark the target objects related to the hot work in the real-time operation image by identifying the target feature map in the target recognition network of the target detection model, so as to obtain a marked operation image marked with the target detection result;
[0194] The violation determination module 940 is used to determine whether there is any illegal operation behavior in the hot work site based on the target detection results marked in the marked operation image and in combination with preset hot work rules.
[0195] In a possible implementation, the feature extraction module is used to extract the directional feature map through the following steps:
[0196] In the feature extraction network of the target detection model, the real-time operation image is preprocessed to extract the original input feature map of the real-time operation image;
[0197] Using the coordinate-aware attention module, the original input feature map is subjected to global average pooling processing in the height dimension and the width dimension respectively, and an initial width feature map of the original input feature map in the width direction and an initial height feature map in the height direction are mapped;
[0198] Based on the initial width feature map and the initial height feature map, a width attention weight of the original input feature map in the width direction and a height attention weight in the height direction are calculated;
[0199] The width attention weight and the height attention weight are used to perform weighted multiplication processing on the original input feature map to calculate the directional feature map of the real-time operation image.
[0200] Further, when the feature extraction module 920 is used to calculate the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction based on the initial width feature map and the initial height feature map, the feature extraction module 920 is used to:
[0201] The initial height feature map and the initial width feature map are mapped and merged into a spliced feature map through a stacking operation;
[0202] Performing a two-dimensional convolution process on the concatenated feature map to obtain an initial transition feature map of the original input feature map;
[0203] Performing batch normalization and nonlinear processing on the initial transition feature map to extract the transition feature map of the original input feature;
[0204] Separating a transition height feature map and a transition width feature map from the transition feature map;
[0205] The transition height feature map and the transition width feature map are transposed and activated by a function, respectively, to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction.
[0206] Further, the preprocessing includes slicing operation, convolution operation and downsampling processing; when the feature extraction module 920 is used in the feature extraction network of the target detection model to preprocess the real-time operation image to extract the original input feature map of the real-time operation image, the feature extraction module 920 is used to:
[0207] In the feature extraction network of the target detection model, a slicing operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image;
[0208] Using a convolution module to perform a convolution operation on the first feature map, and obtaining a second feature map by performing dimensionality reduction processing on the first feature map in a height dimension and a width dimension;
[0209] The second feature map is downsampled by using the C3 module, and the original input feature map of the real-time operation image is obtained by reducing the dimension of the second feature map in the height dimension and the width dimension.
[0210] Furthermore, when the feature extraction module 920 is used to perform a slicing operation on the real-time operation image using the Focus structure to obtain a first feature map of the real-time operation image, the feature extraction module 920 is used to:
[0211] Slicing the real-time operation image into a plurality of operation slice images;
[0212] Perform channel superposition processing on the multiple operation slice images to obtain an integrated operation image of the real-time operation image;
[0213] A convolution operation is performed on the integrated operation image to obtain a first feature map of the real-time operation image.
[0214] Further, when the feature extraction module 920 is used to perform a convolution operation in the first feature map using the convolution module, and obtain a second feature map by performing dimensionality reduction processing on the first feature map in the height dimension and the width dimension, the feature extraction module 920 is used to:
[0215] Performing a two-dimensional convolution process on the first feature map to obtain a first feature map after the convolution process;
[0216] The first feature map after the convolution processing is subjected to batch normalization processing and nonlinear processing to extract a second feature map of the real-time operation image.
[0217] Further, when the violation determination module 940 is used to determine whether there is any illegal operation behavior in the hot work site based on the target detection result marked in the marked work image and in combination with the preset hot work rules, the violation determination module 940 is used to:
[0218] Determine whether there is a hot flame in the target detection result marked in the marking operation image;
[0219] If yes, based on the flame detection frame of the hot work flame and based on the historical operation information of the hot work site, a prior hot work area is marked in the annotated operation image;
[0220] Based on the flame detection frame of the hot work flame, a hot work operation standard area is determined in the annotated operation image by adjusting the prior hot work area;
[0221] Determine whether there is a person doing hot work in the target detection result;
[0222] If so, determining whether there is a work-assisting object in the target detection result;
[0223] If so, based on the positional relationship between the work auxiliary object and the hot work specification area, determine whether there is any illegal work behavior in the hot work site.
[0224] Further, when the violation determination module 940 is used to determine whether there is any illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work specification area, the violation determination module 940 is used to:
[0225] Taking a specific coordinate point of the result detection frame of the work auxiliary object as a detection point, calling an area detection function to determine whether the work auxiliary object is located in the hot work specification area;
[0226] If yes, confirm that there is no illegal operation at the hot work site;
[0227] Otherwise, it is determined that illegal operations have occurred at the fire scene.
[0228] Furthermore, the violation detection device 900 is used to train the target detection model through the following steps:
[0229] Get sample job images;
[0230] Annotating the sample detection results in the sample operation image to obtain a sample annotation label of the sample operation image;
[0231] Based on the sample work images and the sample annotation labels, with the help of a triplet loss function, a pre-constructed initial detection model is trained with the goal of shortening the center distance between the hot work flame and the hot work personnel and increasing the center distance between the hot work flame and the work auxiliary object to obtain a trained target detection model.
[0232] The hot work violation detection device provided in the embodiment of the present application obtains a real-time work image of the hot work site; in the feature extraction network of the target detection model, by performing feature extraction on the directional feature map carrying the width attention weight and the height attention weight, a target feature map of the real-time work image is obtained; in the target recognition network of the target detection model, by identifying the target feature map, the target objects related to the hot work in the real-time work image are marked to obtain a marked work image marked with the target detection result; based on the marked target detection results in the marked work image, combined with the preset hot work rules, it is determined whether there is any illegal work behavior in the hot work site. In this way, it is possible to detect whether there is any illegal work behavior in the hot work site in real time, so as to ensure the real-time nature of the detection results and improve the timeliness of the early warning.
[0233] See also Fig.10 , Fig.10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown in , the electronic device 1000 includes a processor 1010 , a memory 1020 and a bus 1030 .
[0234] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device 1000 is running, the processor 1010 communicates with the memory 1020 via the bus 1030. When the machine-readable instructions are executed by the processor 1010, the above-mentioned Figure 1 The specific implementation of the steps of the method for detecting violations of hot work operations in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0235] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the method for detecting violations of hot work operations in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0236] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0237] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0238] 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.
[0239] In addition, each functional unit in each embodiment of the present application 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.
[0240] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0241] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting violations of hot work, characterized in that: The violation detection method comprises: Obtain real-time operation images at the fire scene; In a feature extraction network of a target detection model, a target feature map of the real-time operation image is obtained by performing feature extraction on a directional feature map carrying a width attention weight and a height attention weight; wherein the directional feature map is obtained by extracting a height feature and a width feature of the real-time operation image using a coordinate perception attention module; In the target recognition network of the target detection model, by identifying the target feature map, the target object related to the hot work in the real-time operation image is annotated to obtain an annotated operation image annotated with the target detection result; Determine whether there is a hot work flame in the target detection result marked in the marked operation image; if so, calibrate a prior hot work area in the marked operation image based on the flame detection frame of the hot work flame and the historical operation information of the hot work site; determine a hot work operation specification area in the marked operation image by adjusting the prior hot work area based on the flame detection frame of the hot work flame; determine whether there is a hot work operator in the target detection result; if so, determine whether there is an operation auxiliary object in the target detection result; if so, determine whether there is any illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work specification area; The directional feature map is extracted by the following steps: In the feature extraction network of the target detection model, a slice operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image; a convolution module is used to perform a convolution operation on the first feature map, and a second feature map is obtained by performing a dimensionality reduction process on the first feature map in a height dimension and a width dimension; a C3 module is used to perform a downsampling process on the second feature map, and an original input feature map of the real-time operation image is obtained by performing a dimensionality reduction process on the second feature map in a height dimension and a width dimension; Using the coordinate-aware attention module, the original input feature map is subjected to global average pooling processing in the height dimension and the width dimension respectively, and an initial width feature map of the original input feature map in the width direction and an initial height feature map in the height direction are mapped; The initial height feature map and the initial width feature map are merged into a spliced feature map through stacking operation mapping; the spliced feature map is subjected to two-dimensional convolution processing to obtain an initial transition feature map of the original input feature map; the initial transition feature map is subjected to batch normalization processing and nonlinear processing to extract the transition feature map of the original input feature; a transition height feature map and a transition width feature map are separated from the transition feature map; the transition height feature map and the transition width feature map are respectively subjected to transposition and activation function processing to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction; Using the width attention weight and the height attention weight, a multiplication weighted process is performed on the original input feature map to calculate a directional feature map of the real-time operation image; Among them, the feature extraction network also includes an SPPF module, which processes the input feature map through three maximum pooling processes and then concatenates the maximum pooling results obtained each time.
2. The violation detection method according to claim 1, characterized in that: The using the Focus structure to perform a slicing operation on the real-time operation image to obtain a first feature map of the real-time operation image includes: Slicing the real-time operation image into a plurality of operation slice images; Perform channel superposition processing on the multiple operation slice images to obtain an integrated operation image of the real-time operation image; A convolution operation is performed on the integrated operation image to obtain a first feature map of the real-time operation image.
3. The violation detection method according to claim 2, characterized in that: The method of using a convolution module to perform a convolution operation in the first feature map, and obtaining a second feature map by performing dimensionality reduction processing on the first feature map in a height dimension and a width dimension, includes: Performing a two-dimensional convolution process on the first feature map to obtain a first feature map after the convolution process; The first feature map after the convolution processing is subjected to batch normalization processing and nonlinear processing to extract a second feature map of the real-time operation image.
4. The violation detection method according to claim 1, characterized in that: Based on the positional relationship between the operation auxiliary object and the hot work standard area, determining whether there is any illegal operation behavior in the hot work site includes: Taking a specific coordinate point of the result detection frame of the work auxiliary object as a detection point, calling an area detection function to determine whether the work auxiliary object is located in the hot work specification area; If yes, confirm that there is no illegal operation at the hot work site; Otherwise, it is determined that there are illegal operations at the hot work site; Wherein, taking the specific coordinate point of the result detection frame of the operation auxiliary object as the detection point includes: Any two points among the upper left corner, lower left corner, upper right corner and lower right corner of the result detection frame of the operation auxiliary object are used as detection points.
5. The violation detection method according to claim 1, characterized in that: The target detection model is trained by the following steps: Get sample job images; Annotating the sample detection results in the sample operation image to obtain a sample annotation label of the sample operation image; Based on the sample work images and the sample annotation labels, with the help of a triplet loss function, a pre-constructed initial detection model is trained with the goal of shortening the center distance between the hot work flame and the hot work personnel and increasing the center distance between the hot work flame and the work auxiliary object to obtain a trained target detection model.
6. A hot work violation detection device, characterized in that: The violation detection device comprises: An image acquisition module is used to acquire real-time operation images of the fire scene; A feature extraction module, used for obtaining a target feature map of the real-time operation image by performing feature extraction on a directional feature map carrying a width attention weight and a height attention weight in a feature extraction network of a target detection model; wherein the directional feature map is obtained by extracting a height feature and a width feature of the real-time operation image using a coordinate perception attention module; A target recognition module is used to mark the target objects related to the hot work in the real-time operation image by identifying the target feature map in the target recognition network of the target detection model, so as to obtain a marked operation image marked with the target detection result; A violation determination module is used to determine whether there is a hot work flame in the target detection result marked in the marked operation image; if so, based on the flame detection frame of the hot work flame and the historical operation information of the hot work site, a prior hot work area is marked in the marked operation image; based on the flame detection frame of the hot work flame, a hot work operation standard area is determined in the marked operation image by adjusting the prior hot work area; determine whether there is a hot work operator in the target detection result; if so, determine whether there is an operation auxiliary object in the target detection result; if so, determine whether there is an illegal operation behavior in the hot work site based on the positional relationship between the operation auxiliary object and the hot work standard area; The feature extraction module is used to extract the directional feature map through the following steps: In the feature extraction network of the target detection model, a slice operation is performed on the real-time operation image using a Focus structure to obtain a first feature map of the real-time operation image; a convolution module is used to perform a convolution operation on the first feature map, and a second feature map is obtained by performing a dimensionality reduction process on the first feature map in a height dimension and a width dimension; a C3 module is used to perform a downsampling process on the second feature map, and an original input feature map of the real-time operation image is obtained by performing a dimensionality reduction process on the second feature map in a height dimension and a width dimension; Using the coordinate-aware attention module, the original input feature map is subjected to global average pooling processing in the height dimension and the width dimension respectively, and an initial width feature map of the original input feature map in the width direction and an initial height feature map in the height direction are mapped; The initial height feature map and the initial width feature map are merged into a spliced feature map through stacking operation mapping; the spliced feature map is subjected to two-dimensional convolution processing to obtain an initial transition feature map of the original input feature map; the initial transition feature map is subjected to batch normalization processing and nonlinear processing to extract the transition feature map of the original input feature; a transition height feature map and a transition width feature map are separated from the transition feature map; the transition height feature map and the transition width feature map are respectively subjected to transposition and activation function processing to determine the width attention weight of the original input feature map in the width direction and the height attention weight in the height direction; Using the width attention weight and the height attention weight, a multiplication weighted process is performed on the original input feature map to calculate a directional feature map of the real-time operation image; Among them, the feature extraction network also includes an SPPF module, which processes the input feature map through three maximum pooling processes and then concatenates the maximum pooling results obtained each time.
Citation Information
Patent Citations
Training method of violation fire detection model and detection method using model
CN114529869A
YOLO-based deep learning industrial field production working area violation detection method
CN114913606A
High-precision and high-efficiency signal identification detection method and device and medium
CN115497076A
Pedestrian detection method and device
CN116229419A
Method and device for detecting stability of surrounding rock
CN116363512A
