Risk source multi-target identification method based on double cascade attention mechanism

By fusing Canny operator and improving edge detection method of mathematical morphology, combined with the dual cascade attention mechanism and multi-scale perception module, the noise interference and scale changes of image edge detection in complex backgrounds are solved, and the detection is improved Accuracy and robustness enhance small object detection capabilities.

CN118967726APending Publication Date: 2024-11-15NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410943871.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In complex backgrounds, image edge detection is susceptible to noise interference, edge information is inaccurate, small object detection features are easily lost, and traditional methods are difficult to deal with image scale changes and insufficient semantic information.

Method used

Using the edge detection method that combines Canny operator and improves mathematical morphology, a multi-objective recognition model based on the dual cascade attention mechanism is constructed, combining spatial attention, channel attention and temporal attention, feature pyramids and multi-scale perception are introduced Module, dynamically adjust model attention and feature fusion.

Benefits of technology

It improves the robustness and accuracy of image edge detection, enhances the small object detection capability, reduces false detection and missed detection, improves edge continuity and semantic feature extraction, and improves the robustness and generalization capability of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967726A_ABST
    Figure CN118967726A_ABST
Patent Text Reader

Abstract

The invention discloses a risk source multi-target identification method based on a double cascade attention mechanism, and relates to the field of image edge detection and target identification, and the method comprises the steps: when the edge detection of image data is processed, an edge detection method fusing a Canny operator and improved mathematical morphology is used, and the edge detection of the image data is carried out; the method comprises the following steps of: completing purposeful connection and preprocessing work on an image edge, extracting features through a convolutional neural network, and performing scale transformation on an input to-be-detected image by utilizing an image pyramid thought to obtain multiple layers of image features with scales sequentially decreasing from bottom to top; a space attention mechanism is adopted for low-level features, a channel attention mechanism is adopted for high-level features, effective target features are generated, more weights are distributed to channels with large activation responses for high-level feature maps with rich semantic information, and a time attention mechanism is introduced for multi-scale recognition targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a risk source multi-target recognition method based on a dual cascade attention mechanism, and relates to the fields of image edge detection and target recognition. Background Art

[0002] Image edge detection aims to identify the location of the boundary of objects in an image, usually by highlighting the change of pixel values. However, in a complex background, the edge may be disturbed by noise or there may be edge blur, and traditional methods may not be able to accurately capture edge information. Object detection based on deep learning uses models and algorithms for image recognition to complete the detection of objects. It is very sensitive to the scale and change of the object, especially for the detection of small objects. The introduction of attention mechanism can help improve the accuracy and robustness of image edges. The attention mechanism can dynamically adjust the model's attention to different areas according to the content and contextual information of the image. In addition, the attention mechanism can also help the model suppress the influence of background noise or blurred areas, so that the model pays more attention to the boundary of the object, thereby reducing false detection and missed detection. In addition, the attention mechanism can also combine multi-scale feature information for edge detection. Since objects have different edge features at different scales, the introduction of multi-scale attention can help the model better capture edge information at different scales, thereby improving the robustness and generalization ability of detection. This multi-scale attention mechanism can operate on feature maps at different levels. Therefore, it is necessary to achieve more accurate edge detection by integrating information at different scales. Summary of the invention

[0003] The prior art has problems such as image edges being interfered by noise, inaccurate captured information, easy loss of small target detection features, and little high-level semantic information. In view of the above shortcomings, the purpose of the present invention is to provide a risk source multi-target recognition method based on a dual cascade attention mechanism to improve the algorithm's robustness to target scale changes, small target detection and image edge processing performance.

[0004] In view of the above background, the technical solution adopted by the present invention is:

[0005] S1: The acquired image data of the risk source to be identified is subjected to edge detection by adopting the method of fusion of Canny operator and improved mathematical morphology;

[0006] S2: Construct a risk source multi-target recognition model based on a dual cascade attention mechanism: the model includes a multi-target recognition network that introduces a dual attention mechanism module; the dual cascade attention mechanism integrates the spatial attention, channel attention and temporal attention of the image; the multi-target recognition network also introduces a feature pyramid and a multi-scale perception module. In the feature pyramid, convolution is performed on different levels to obtain features, and the input image to be detected is scaled down. On this basis, an image pyramid can be constructed from top to bottom with decreasing image scales. Then, a fixed-size window is used to slide on each layer of the image to detect targets of interest. The multi-scale perception module fuses features at different levels and shares information of different scales. The feature pyramid will pass through the spatial attention module and the channel attention module from bottom to top; the spatial attention module dynamically adjusts the output weights to refine the target features, and the channel attention module assigns more weights to channels with larger activations.

[0007] Preferably, in S1, after the Canny operator non-maximum suppression, the double threshold filtering only considers the neighborhood of the existing edge, and does not consider the missed edge. If the detected edge disconnection distance is too large, the edge cannot be effectively connected. Therefore, the double threshold filtering is no longer performed, but the improved morphological operation is performed to solve the above problem, including the following steps:

[0008] S11: Determine the position of the sliding window in the original image;

[0009] S12: Search for points belonging to the edge in the sliding window and fit the straight line y=kx+b to these points using the least squares method

[0010] S13: Construct a structure element of order m×n. In the structure element, traverse each point to determine the size of w. If it is greater than w, assign the point value to 0, otherwise to 1; where x and y are the coordinates of each point in the sliding window. is the distance from the edge point to the fitted line, and w is the distance from the specified structural element to the sliding window. If it is greater than w, it means that the point is beyond the range of the structural element, so it is assigned a value of 0; If it is less than w, it means that the point does not exceed the range of the structural element, so it is assigned a value of 1;

[0011] S14: using the structural element to perform corresponding morphological operations on the points in the sliding window;

[0012] S15: Slide the window to the next position until the traversal of the original image is completed.

[0013] Preferably, the edge detection method of the Canny operator and the improved mathematical morphology is integrated in S1, and the Gaussian filter in the Canny operator is changed to a bilateral filter. The traditional Canny operator uses Gaussian filtering for smoothing, which not only eliminates part of the noise, but also weakens the edge gradient of the image. The images obtained in complex environments have many interference factors, and some foreground and background pixel values ​​are relatively similar, so the edges detected are prone to discontinuity. This can retain the image edge information while removing noise.

[0014] Preferably, the edge detection method of S1 is a fusion of the Canny operator and the improved mathematical morphology. In the process of edge filtering, the erosion operation of mathematical morphology is used to remove noise and shorter edges, and the expansion operation of mathematical morphology is used to achieve the connection effect of discontinuous edges.

[0015] Preferably, when the mathematical morphology method traverses the image in a sliding window, it will consider the edge features in each position window, adjust the structural elements, and connect the missing parts of the edge features to solve the problem that the mathematical morphology has fixed structural elements and cannot connect edges with different features.

[0016] Preferably, the risk source multi-target identification method based on the dual cascade attention mechanism, the target detection of the multi-target identification adopts a detection-based tracking method, which can cope with the situation where the mid-target disappears and the new target appears, and better adapt to the actual application scenario.

[0017] Preferably, the hierarchical division of the dual attention mechanism module in S2 is: using a spatial attention mechanism for low-level features and a channel attention mechanism for high-level features, and introducing a temporal attention mechanism for multi-scale targets. The spatial attention mechanism is used for low-level features and the channel attention mechanism is used for high-level features to further refine the feature information of the target area, generate effective target features, and for high-level feature maps with richer semantic information, more weight is assigned to channels with larger activation responses, thereby improving the target classification ability of the algorithm.

[0018] Compared with the prior art, the advantages of the present invention are:

[0019] 1. Aiming at the situation that image edge detection is susceptible to noise interference or edge blur in a complex background, the present invention proposes an edge detection method that integrates the Canny operator and improved mathematical morphology. The traditional Canny operator uses Gaussian filtering for smoothing. This method not only eliminates part of the noise, but also weakens the edge gradient of the image. The method proposed by the present invention changes the Gaussian filtering in the Canny operator into bilateral filtering, and uses mathematical morphology corrosion operation to omit the double threshold filtering in the Canny operator. It can purposefully connect the features of the straight line edges in the image, improve the continuity of the Canny operator for line segment edge detection, and improve the accuracy of edge recognition.

[0020] 2. The dual cascade attention mechanism proposed in the present invention does not simply upsample and downsample the features for multi-target recognition, but uses different attention mechanisms for high-level and low-level features respectively in a more targeted manner. In addition, the detection algorithm also introduces feature pyramids and multi-scale perception modules to improve the robustness of the network to changes in target scales, and uses feature adaptive fusion in the multi-scale perception module instead of simply adding features in equal proportions. The role of the channel attention network is mainly to enhance high-level semantic features, while the spatial attention network is to enhance the detailed features of the target and retain fine-grained information such as target edges that are conducive to small target detection. Therefore, the present invention further explores the accuracy of feature extraction from the perspective of feature stratification. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 The flowchart of morphological improvement of dynamic structural elements of an example of the present invention.

[0023] Figure 2 Schematic diagram of target detection based on dual attention mechanism according to an example of the present invention.

[0024] Figure 3 A multi-scale fireworks recognition method based on a dual attention mechanism is a specific implementation example of the present invention.

[0025] Figure 4 This is a multi-scale and multi-scene fireworks recognition dataset for an example implementation of the present invention.

[0026] Figure 5 This is a field scene verification diagram of a specific implementation example of the present invention.

[0027] Figure 6 This is a verification diagram of an urban suburban scene according to a specific implementation example of the present invention.

[0028] Figure 7 This is the precision-recall curve of the fireworks multi-scale recognition model according to the specific implementation example of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0030] The following is combined with Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 The embodiments of the present invention are described in further detail.

[0031] In traditional fireworks recognition, there are often many challenges such as scale change, illumination change, and morphological diversity, which are precisely the challenges that traditional methods cannot overcome. The emergence of fireworks multi-scale recognition method based on dual attention mechanism fills this technical gap. Figure 3 . First, the method utilizes the strategy of multi-scale feature extraction to capture rich information of fireworks images from different scales. The scale change of fireworks is often one of the difficulties in their recognition, and the method of multi-scale feature extraction can effectively solve this problem. By extracting features at different scales, the system can more comprehensively understand the morphology and structure of fireworks, thereby improving the accuracy of recognition. The evolution process of fireworks often has certain time series characteristics, and traditional static image recognition methods often cannot capture such dynamic changes. Therefore, it is necessary to additionally introduce a temporal attention mechanism on the basis of the present invention, which can help the system better understand the evolution process of fireworks, thereby improving the robustness and accuracy of recognition.

[0032] The present invention proposes a multi-target risk source recognition method based on a dual cascade attention mechanism. The common fireworks targets in industrial production are used as recognition targets in the implementation method, including the following steps:

[0033] S1: Obtain smoke and fire data sets through collection and web crawling for intelligent model training, see Figure 4. It is planned to establish a fireworks dataset with a scale of about 10,000 to 20,000 images, using the voc dataset tag xml, divided into two types: smoke and fire. The dataset collection process includes fireworks videos. The collected light is three different light types: light, dim, and normal light. The collected fire includes three different fire size collection scenes: large fire, medium fire, and small fire. The dataset includes scenes such as power stations, buildings, transportation, and forests. It is widely used in power station fire monitoring, urban fire fighting, forest fire prevention, etc.; then use image annotation tools to create image annotation datasets, which are particularly suitable for target detection and semantic segmentation tasks.

[0034] S2: Perform edge detection on the fireworks images in the data set using the method of fusing the Canny operator and improved mathematical morphology proposed in the present invention.

[0035] See Figure 1 In S2, after the Canny operator non-maximum suppression, the following steps are included:

[0036] S21: Determine the position of the sliding window in the original image.

[0037] S22: Search for points belonging to the edge in the sliding window, and fit a straight line y=kx+b to these points using the least squares method.

[0038] S23: Construct a structure element of order m×n. In the structure element, traverse each point to determine the size of w. If it is greater than w, assign the point value to 0, otherwise to 1; where x and y are the coordinates of each point in the sliding window. is the distance from the edge point to the fitted line, and w is the distance from the specified structural element to the sliding window. If it is greater than w, it means that the point is beyond the range of the structural element, so it is assigned a value of 0; If it is less than w, it means that the point does not exceed the range of the structural element, so it is assigned a value of 1.

[0039] S24: Use the structural element to perform corresponding morphological operations on the points in the sliding window.

[0040] S25: Slide the window to the next position until the traversal of the original image is completed.

[0041] S3: Construct a multi-target risk source recognition model based on a dual cascade attention mechanism: The model includes a multi-target recognition network that introduces a dual attention mechanism module, see Figure 2; The dual cascade attention mechanism integrates the image's spatial attention, channel attention and an additional temporal attention mechanism when facing fireworks detection; the multi-target recognition network also introduces a feature pyramid and a multi-scale perception module. In the feature pyramid, convolution is performed on different levels to obtain features, and the input image to be detected is scaled down. On this basis, an image pyramid can be constructed from top to bottom with decreasing image scales. Then, a fixed-size window is used to slide on each layer of the image to detect targets of interest. The multi-scale perception module fuses features at different levels and shares information at different scales; the feature pyramid will pass through the spatial attention module, the channel attention module, and the temporal attention module from bottom to top.

[0042] S4: Combined with actual scenarios, the model with dual attention mechanism is trained, and the test results are divided into field scenes and urban suburban scenes for verification. The recognition results of the tests are shown in Figure 5 , Figure 6 .

[0043] S5: Figure 7 This is the precision-recall curve of the multi-scale firework recognition model, where the smoke precision is 0.891, the flame recognition precision is 0.926, and the average category precision is 0.909. The precision-recall curve of the multi-scale firework recognition model is one of the important indicators for evaluating its performance and effect, indicating its excellent performance in the recognition of different types of firework. In addition, the average category precision of the model is 0.909, which further highlights its robustness and accuracy in multi-category target recognition tasks. The precision-recall curve is a common method for evaluating the performance of a classifier at different thresholds. It shows the performance of the model under different precision and recall conditions. By analyzing this curve, we can have a more comprehensive understanding of the performance of the model at different operating points, and adjust the threshold according to actual needs to achieve the best performance. These excellent performance indicators prove the excellent performance of the multi-scale firework recognition model in smoke and flame recognition tasks, and provide strong technical support for responding to fire risks and improving urban safety levels.

[0044] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.

[0045] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A multi-target risk source identification method based on a dual cascade attention mechanism, characterized in that: The method comprises the following steps: S1: The acquired image data of the risk source to be identified is subjected to edge detection by adopting the method of fusion of Canny operator and improved mathematical morphology; S2: Construct a risk source multi-target recognition model based on a dual cascade attention mechanism: the model includes a multi-target recognition network that introduces a dual attention mechanism module; the dual cascade attention mechanism integrates the spatial attention, channel attention and temporal attention of the image; the multi-target recognition network introduces a feature pyramid and a multi-scale perception module, in which convolution is performed on different levels of the feature pyramid to obtain features, and the input image to be detected is scaled down. On this basis, an image pyramid with decreasing image scales from top to bottom can be constructed, and then a fixed-size window is used to slide on each layer of the image to detect targets of interest. The multi-scale perception module fuses features at different levels and shares information of different scales; the feature pyramid will pass through the spatial attention module and the channel attention module from bottom to top; the spatial attention module dynamically adjusts the output weights to refine the target features, and the channel attention module assigns more weights to channels with larger activations.

2. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: In S1, after the Canny operator non-maximum suppression, double threshold filtering is no longer performed, but an improved mathematical morphological operation is performed, including the following steps: S11: Determine the position of the sliding window in the original image; S12: Search for points belonging to the edge in the sliding window, and fit a straight line y=kx+b to these points using the least squares method; S13: Construct a structure element of order m×n. In the structure element, traverse each point to determine the size of w. If it is greater than w, assign the point value to 0, otherwise to 1; where x and y are the coordinates of each point in the sliding window. is the distance from the edge point to the fitted line, and w is the distance from the specified structural element to the sliding window; if If it is greater than w, it means that the point is beyond the range of the structural element, so it is assigned a value of 0; If it is less than w, it means that the point does not exceed the range of the structural element, so it is assigned a value of 1; S14: using the structural element to perform corresponding morphological operations on the points in the sliding window; S15: Slide the window to the next position until the traversal of the original image is completed.

3. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: The S1 integrates the canny operator and the improved mathematical morphology edge detection method, wherein the Gaussian filter in the Canny operator is changed to a bilateral filter.

4. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: The S1 combines the canny operator with an improved mathematical morphology edge detection method, and uses the erosion and dilation operations of mathematical morphology in the process of edge filtering.

5. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: The mathematical morphology method considers the edge features in each position window when the sliding window traverses the image, adjusts the structural elements, and connects the missing parts of the edge features.

6. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: The target detection of the multi-target recognition adopts a detection-based tracking method.

7. According to claim 1, a risk source multi-target identification method based on a dual cascade attention mechanism is characterized in that: The hierarchical division of the dual attention mechanism module in S2 adopts the spatial attention mechanism for low-level features and the channel attention mechanism for high-level features. The method also has reliable scalability. When identifying multi-scale targets, the temporal attention mechanism is introduced to accurately identify multi-scale targets.