Urban facility abnormality identification method, device, electronic equipment and storage medium
By using the target detection model in urban facility anomaly detection, combined with the residual focused convolution module and the multi-scale fusion attention mechanism module, the feature information of different scales is extracted and fused, which solves the problem of low recognition accuracy in the existing technology and achieves A more efficient anomaly identification effect is achieved.
Patent Information
- Application Number
- CN202410788998.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-19
AI Technical Summary
Existing urban facility anomaly detection methods lack flexibility and adaptability in complex and changeable urban environments, resulting in low recognition accuracy and inability to effectively identify anomalies in urban facilities.
An urban facility anomaly identification method is adopted, by acquiring images and inputting them into a pre-established target detection model, using the backbone network, neck network and detection head, combined with the residual focused convolution module and the multi-scale fusion attention mechanism module , extract and fuse feature information at different scales to achieve abnormal identification of urban facilities.
It improves the accuracy of abnormal identification of urban facilities, can more effectively identify abnormal situations in complex environments, and improves the detection effect and adaptability of the model.
Smart Images

Figure CN118429623B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of urban facility anomaly detection, and in particular, relates to an urban facility anomaly recognition method, device, electronic equipment and storage medium. Background Art
[0002] Abnormal events in urban facilities, such as traffic accidents and facility damage, can be identified and handled in a timely manner, which can not only improve the efficiency of urban operations, but also ensure the safety of residents' lives and property. Although existing monitoring systems and automated control technologies can detect specific abnormal situations to a certain extent, in the face of complex and changing urban environments, traditional methods usually rely on fixed thresholds or rules to identify abnormalities, which often lack flexibility and adaptability, and have low accuracy in identifying abnormalities in urban facilities. Summary of the invention
[0003] In response to the above problems, the embodiments of the present application provide a method, device, electronic device and storage medium for identifying abnormalities in urban facilities, which can achieve relatively accurate identification of abnormalities in urban facilities.
[0004] The present application embodiment provides a method for identifying abnormalities in urban facilities, including:
[0005] Acquire an image to be identified, wherein the image includes: urban facilities;
[0006] The image is input into a pre-established target detection model to determine the abnormal category of the urban facility, wherein the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image.
[0007] In some embodiments, the residual focusing convolution module includes: a first residual focusing convolution module, a second residual focusing convolution module, a third residual focusing convolution module and a fourth residual focusing convolution module, the multi-scale fusion attention mechanism module includes: a first multi-scale fusion attention mechanism module, a second multi-scale fusion attention mechanism module, and a third multi-scale fusion attention mechanism module, the backbone network also includes: a convolution module, a first CBS module, a second CBS module, a third CBS module, a fourth CBS module and a spatial pyramid pooling module, the convolution module is used to extract features of different scales of the image, the convolution module, the first CBS module, the first residual focusing convolution module, the second CBS The module, the second residual focusing convolution module, the first multi-scale fusion attention mechanism module, the third CBS module, the third residual focusing convolution module, the second multi-scale fusion attention mechanism module, the fourth CBS module, the fourth residual focusing convolution module, the third multi-scale fusion attention mechanism module, and the spatial pyramid pooling module are connected in sequence, the first multi-scale fusion attention mechanism module is used to output feature information of the first scale to the neck network of the target detection model, the second multi-scale fusion attention mechanism module is used to output feature information of the second scale to the neck network, and the spatial pyramid pooling module is used to output feature information of the third scale to the neck network.
[0008] In some embodiments, the residual focusing convolution module includes: a residual focusing convolution block, a fifth CBS module and a sixth CBS module, the fifth CBS module is used to provide feature information of different scales to the residual focusing convolution block, the residual focusing convolution block is used to extract feature information of different scales, and perform nonlinear changes on the extracted feature information, and maintain the gradient flow of the target detection model, and input the processed feature information into the sixth CBS module.
[0009] In some embodiments, the residual focused convolution block includes: a first depthwise convolution of a first convolution kernel size, a second depthwise convolution of the first convolution kernel size, a LayerNorm layer, a convolution of a second convolution kernel size, a GELU unit, and a convolution of a second convolution kernel size, which are connected in sequence, wherein the input of the first depthwise convolution forms a residual connection with the first depthwise convolution, the input of the second depthwise convolution forms a residual connection with the second depthwise convolution, the GELU unit is used to introduce nonlinearity, and the convolution of the second convolution kernel size is used to integrate feature information and adjust the number of channels.
[0010] In some embodiments, the multi-scale fusion attention mechanism module includes: a multi-scale convolution module and an SE module connected in sequence, the multi-scale convolution module is used to obtain feature information of different scales, and splice the feature information of different scales, and output the spliced feature information, the SE module is used to extract attention weights for the spliced feature information, and determine a shared channel attention vector based on the attention weights, and re-calibrate the shared channel attention vector, and apply the re-calibrated attention vector to the multi-scale feature map, and output the result.
[0011] In some embodiments, feature information of different scales corresponds to different detection heads, and each detection head includes: a REG module, a first convolutional shared BN separation layer, a second convolutional shared BN separation layer, and a seventh CBS module. The input of the REG module is the output of the neck network, the output of the REG module is the input of the first convolutional shared BN separation layer, the output of the first convolutional shared BN separation layer is the input of the bounding box regression loss function, the input of the seventh CBS module is the output of the neck network, the output of the seventh CBS module is the input of the second convolutional shared BN separation layer, the output of the second convolutional shared separation layer is the input of the classification loss function, and the first convolutional shared BN separation layer and the second convolutional shared BN separation layer are used to share convolution weights between different layers.
[0012] In some embodiments, the neck network includes: a first concat module, a second concat module, a third concat module, a fourth concat module, a fifth residual focused convolution module, a sixth residual focused convolution module, a seventh residual focused convolution module, an eighth residual focused convolution module, an eighth CBS module, a ninth CBS module, a first upsampling module and a second upsampling module, the input of the first concat module is the output of the first multi-scale fusion attention mechanism module and the first upsampling module, the output of the first concat module is the input of the fifth residual focused convolution module, the output of the fifth residual focused convolution module is the input of the eighth CBS module and the detection head, the input of the second concat module is the second upsampling module and the second multi-scale fusion attention mechanism module Output, the output of the second concat module is the input of the sixth residual focused convolution module, the output of the sixth residual focused convolution module is the input of the first upsampling module and the third concat module, the input of the third concat module is the output of the eighth CBS module, the output of the third concat module is the input of the seventh residual focused convolution module, the output of the seventh residual focused convolution module is the input of the detection head and the ninth CBS module, the input of the fourth concat module is the output of the spatial pyramid pooling module and the ninth CBS module, the input of the second upsampling module is the output of the spatial pyramid pooling module, the output of the fourth concat module is the input of the eighth residual focused convolution module, and the output of the eighth residual focused convolution module is the input of the detection head.
[0013] The embodiment of the present application provides a device for identifying abnormalities in urban facilities, comprising:
[0014] An acquisition module, used for acquiring an image to be identified, wherein the image includes: urban facilities;
[0015] A determination module is used to input the image into a pre-established target detection model to determine the abnormal category of the urban facility, wherein the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image.
[0016] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the computer program.
[0017] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned methods is implemented.
[0018] An embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the electronic device executes any one of the above methods.
[0019] The embodiments of the present application provide a method, device, electronic device and storage medium for identifying abnormalities in urban facilities. The method acquires an image to be identified, wherein the image includes urban facilities; the image is input into a pre-established target detection model to determine the abnormal category of the urban facilities, wherein the target detection model includes a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image, so as to realize relatively accurate identification of abnormalities in urban facilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present application will be described in more detail below based on embodiments and with reference to the accompanying drawings.
[0021] Figure 1 A schematic diagram of the implementation process of a method for identifying abnormalities of urban facilities provided for the implementation of this application;
[0022] Figure 2 A schematic diagram of the structure of a target detection model provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of a residual focused convolution module provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a residual focusing convolution block provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of a processing flow of a multi-scale fusion attention mechanism module provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of the structure of a device for identifying abnormalities in urban facilities provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0028] In the drawings, the drawings are not drawn to scale. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0030] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0031] If similar descriptions of "first\second\third" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0033] Based on the problems existing in the related art, the embodiment of the present application provides a method for identifying abnormalities of urban facilities. The method for identifying abnormalities of urban facilities provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, and personal digital assistants (PDA). The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.
[0034] The functions implemented by the urban facility anomaly identification method provided in the embodiment of the present application can be implemented by calling program codes by a processor of an electronic device, wherein the program codes can be stored in a computer storage medium.
[0035] The present application provides a method for identifying abnormalities in urban facilities. Figure 1 A schematic diagram of the implementation process of a method for identifying abnormalities in urban facilities provided for the implementation of this application is as follows: Figure 1 As shown, the method for identifying abnormalities of urban facilities includes:
[0036] Step S101, obtaining an image to be identified, wherein the image includes: urban facilities.
[0037] In the embodiment of the present application, the image to be identified can be acquired by shooting with a camera, a drone or other image acquisition equipment. The acquired image to be identified may include urban facilities, and the urban facilities may include: one or more of: roads, manhole covers, guardrails, walls, telescopic devices, drainage facilities, isolation fences, anti-collision columns, and vehicle stoppers.
[0038] In the embodiment of the present application, when using a camera, the camera can be set on a vehicle, and the image to be identified is collected by moving the vehicle. The image information may include: a picture or a video.
[0039] In some embodiments, the electronic device may also obtain the image to be identified through the Internet.
[0040] Step S102: input the image into a pre-established target detection model to determine the abnormal category of the urban facility.
[0041] In an embodiment of the present application, the image information may be input into a pre-established target detection model, and after being processed by the model, the abnormal category of the urban facility is determined.
[0042] In the embodiment of the present application, the abnormal category may include: multiple categories, for example, may include: one or more of the first category, the second type, the third category, etc.
[0043] In an embodiment of the present application, the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image.
[0044] In the embodiment of the present application, the residual focused convolution module can perform feature extraction and fusion at different scales, and can provide more contextual information for the model, so as to solve the problem of category semantic ambiguity in the identification of urban facility anomalies.
[0045] In an embodiment of the present application, the multi-scale fusion attention mechanism module can introduce multi-scale convolution operations at a single scale to achieve the effect of multi-scale fusion, thereby solving the problem of multi-scale differences within and between categories in the identification of urban facility anomalies, and helping to improve the detection effect of the model.
[0046] In the embodiment of the present application, the target detection model is improved based on the MFSNet network.
[0047] An embodiment of the present application provides a method for identifying abnormalities in urban facilities. The method obtains an image to be identified, wherein the image includes urban facilities; the image is input into a pre-established target detection model to determine the abnormal category of the urban facilities, wherein the target detection model includes a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image, so as to achieve more accurate identification of abnormalities in urban facilities.
[0048] In some embodiments, the residual focusing convolution module includes: a first residual focusing convolution module, a second residual focusing convolution module, a third residual focusing convolution module and a fourth residual focusing convolution module, the multi-scale fusion attention mechanism module includes: a first multi-scale fusion attention mechanism module, a second multi-scale fusion attention mechanism module, a third multi-scale fusion attention mechanism module, the backbone network also includes: a convolution module, a first CBS module, a second CBS module, a third CBS module, a fourth CBS module and a spatial pyramid pooling module, the convolution module is used to input an image, the convolution module, the first CBS module, the first residual focusing convolution module, the second CBS module, the The second residual focusing convolution module, the first multi-scale fusion attention mechanism module, the third CBS module, the third residual focusing convolution module, the second multi-scale fusion attention mechanism module, the fourth CBS module, the fourth residual focusing convolution module, the third multi-scale fusion attention mechanism module, and the spatial pyramid pooling module are connected in sequence, the first multi-scale fusion attention mechanism module is used to output feature information of the first scale to the neck network of the target detection model, the second multi-scale fusion attention mechanism module is used to output feature information of the second scale to the neck network, and the spatial pyramid pooling module is used to output feature information of the third scale to the neck network.
[0049] The CBS (Cross stage Partial Network) module is a cross-stage partial network that is used to extract features of different scales. The CBS module can capture objects of different sizes at different levels.
[0050] In the embodiment of the present application, the convolution module uses the Conv function to convolve the input image.
[0051] In the embodiment of the present application, the first scale, the second scale and the third scale are different. Exemplarily, the first scale is a 1 / 8 feature map, the second scale is a 1 / 16 feature map, and the third scale is a 1 / 32 feature map.
[0052] In an embodiment of the present application, the spatial pyramid pooling module may be SPPF (Spatial Pyramid Pooling Fusion), which is a spatial pyramid pooling technology for processing images or feature maps with unfixed input sizes. SPPF can encode inputs of different sizes on a fixed-size output by dividing the image or feature map into grids of different sizes and performing a pooling operation within each grid. SPPF can help neural networks maintain the richness of spatial information when processing inputs of different sizes.
[0053] Figure 2 A schematic diagram of the structure of a target detection model provided in an embodiment of the present application is shown in FIG. Figure 2 As shown in the figure, the convolution module is represented by Conv, the residual focus convolution module can be represented by C2RFC, the multi-scale fusion attention mechanism module can be represented by MSFA, and the spatial pyramid pooling module is represented by SPPF.
[0054] In some embodiments, the residual focusing convolution module includes: a residual focusing convolution block, a fifth CBS module and a sixth CBS module, the fifth CBS module is used to provide feature information of different scales to the residual focusing convolution block, the residual focusing convolution block is used to extract feature information of different scales, and perform nonlinear changes on the extracted feature information, and maintain the gradient flow of the target detection model, and input the processed feature information into the sixth CBS module.
[0055] In an embodiment of the present application, the residual focused convolution block may be an RFC Block (Residuals Focused Convlution Block).
[0056] Figure 3 A schematic diagram of the structure of a residual focused convolution module provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the fifth CBS module is the input end of the residual focused convolution module, and the sixth CBS module is the output end of the residual focused convolution module.
[0057] In the embodiment of the present application, S=1, K=1 of the fifth CBS module, and S=1, K=1 of the sixth CBS module.
[0058] In some embodiments, the residual focusing convolution block includes: a first depth convolution of a first convolution kernel size, a second depth convolution of the first convolution kernel size, a LayerNorm layer, a convolution of a second convolution kernel size, a GELU unit, and a convolution of a second convolution kernel size, wherein the input of the first depth convolution forms a residual connection with the first depth convolution, the input of the second depth convolution forms a residual connection with the second depth convolution, the GELU unit is used to introduce nonlinearity, and the convolution of the second convolution kernel size is used to integrate feature information and adjust the number of channels. The GELU unit is a Gaussian Error Linear Unit, which is an activation function and is usually used in the hidden layer of a neural network.
[0059] Figure 4 A schematic diagram of the structure of a residual focusing convolution block provided in an embodiment of the present application is shown in FIG. Figure 4As shown in the figure, it includes two 7x7 depth convolutions with residuals, LayerNorm layer, 1x1 convolution, GELU unit and 1x1 convolution and a large residual structure with jump connection. The residual focused convolution block can effectively extract features and perform nonlinear transformation while maintaining gradient flow and avoiding the gradient disappearance problem.
[0060] In the embodiment of the present application, there is an input feature map , then the structure of RFC Block can be expressed as:
[0061] ;
[0062] ;
[0063] ;
[0064] in, represents a depthwise convolution with a kernel size of 7×7, which is the same as the 7x7 depthwise convolution with residual in the above text. Represents the residual connection formed by the original input X and the first 7x7 depthwise convolution to help optimize training and solve the gradient vanishing problem. express The residual connection formed with the second 7x7 depth convolution is used to capture more extensive context information in the spatial dimension, which can play a role in focusing the target. LN is LayerNorm to speed up the training process and improve the stability of the model. The GELU unit is an activation function to introduce nonlinearity. Represents a convolution with a convolution kernel size of 1×1, which is used to integrate features and adjust the number of channels.
[0065] In the embodiment of the present application, through the structural design of RFC Block, a small amount of additional computing cost can be introduced to enhance the model's learning ability for complex features. RFC Block can simultaneously merge fine-grained local features and coarse-grained global features for interaction.
[0066] In some embodiments, the multi-scale fusion attention mechanism module includes: a multi-scale convolution module and an SE module connected in sequence, the multi-scale convolution module is used to obtain feature information of different scales, and splice the feature information of different scales, and output the spliced feature information, the SE module is used to extract attention weights for the spliced feature information, and determine a shared channel attention vector based on the attention weights, and re-calibrate the shared channel attention vector, and apply the re-calibrated attention vector to the multi-scale feature map, and output the result.
[0067] Figure 5A processing flow diagram of a multi-scale fusion attention mechanism module provided in an embodiment of the present application is shown in FIG. Figure 5 As shown in the figure, the multi-scale fusion attention mechanism first obtains feature information of different scales through the multi-scale convolution module MSC (Multi-scale Convolution); then the shared channel-level attention vector is obtained through weight learning through the SE module; finally, Softmax is used to re-correct the channel attention vector obtained above, and the corrected attention vector is applied to the multi-scale feature map to output the result.
[0068] In the embodiment of the present application, the SE module refers to the Squeeze-and-Excitation module, which is an attention mechanism module used to enhance the performance of convolutional neural networks.
[0069] exist Figure 5 In the above figure, Softmax is the Softmax function, which converts the elements in the input vector into probability values.
[0070] In the embodiment of the present application, the output of the MSC module has rich multi-scale information. Assume that the input is ,First, we extract features of X through group convolution (g=1,4,8,16) with different convolution kernel sizes (k=3,5,7,9) to obtain feature maps of different scales. Then, we concatenate the extracted multi-scale features through concat. The above process can be simply described as follows:
[0071] ;
[0072] ;
[0073] Based on the above features, attention weights are extracted for different parts of the features, and they are spliced in different dimensions to achieve attention information interaction and integrate cross-dimensional information. The formula is as follows:
[0074] ;
[0075] ;
[0076] The obtained attention weights are then normalized and defined as follows:
[0077] ;
[0078] Finally, the corrected features are obtained:
[0079] ;
[0080] In an embodiment of the present application, by adding an MSFA attention mechanism behind feature maps of different scales in the backbone network, a multi-scale convolution operation can be introduced at a single scale to achieve the effect of multi-scale fusion, thereby solving the problem of multi-scale differences within and between categories in the identification of urban facility anomalies, and helping to improve the detection effect of the model.
[0081] In some embodiments, feature information of different scales corresponds to different detection heads, and each detection head includes: a REG module, a first convolutional shared BN separation layer, a second convolutional shared BN separation layer, and a seventh CBS module. The input of the REG module is the output of the neck network, the output of the REG module is the input of the first convolutional shared BN separation layer, the output of the first convolutional shared BN separation layer is the input of the bounding box regression loss function, the input of the seventh CBS module is the output of the neck network, the output of the seventh CBS module is the input of the second convolutional shared BN separation layer, the output of the second convolutional shared separation layer is the input of the classification loss function, and the first convolutional shared BN separation layer and the second convolutional shared BN separation layer are used to share convolution weights between different layers.
[0082] Continue to see Figure 2 In an embodiment of the present application, the BN separation layer is a batch normalization (BN) layer, and the first convolution shared BN separation layer and the second convolution shared BN separation layer are used to share convolution weights between different layers. The bounding box regression loss function can be represented by Bbox Loss, and the classification loss function can be represented by Cls Loss. The REG (Region Proposal Network or Regression Network) module generally refers to a region proposal network or a regression network. This module is used in the target detection algorithm to generate candidate object boxes or perform accurate bounding box regression on the object box. In the target detection task, it is usually necessary to generate a series of candidate regions that may contain the target object, and determine the exact bounding box position of the target object within these candidate regions in the subsequent processing. The REG module generates candidate boxes or regresses the positions of candidate boxes by learning feature maps, thereby helping the model to more accurately locate the target object.
[0083] Continuing with the above example, 1 / 8 of the feature map corresponds to one detection head, 1 / 16 of the feature map corresponds to one detection head, and 1 / 32 of the feature map corresponds to one detection head.
[0084] In the embodiment of the present application, the detection head can be considered as a convolution shared BN separated detection head SVSBHead (ShareConvolution Separate BN Head).
[0085] In the embodiment of the present application, each detection head is implemented by sharing convolution weights between different layers and independently calculating the statistics of BN. This detection head not only reduces the number of parameters and calculations, but also improves the flexibility and adaptability of the model when processing different features at different layers, thereby improving the overall performance and generalization ability of the model. At the same time, BN is also more effective than other normalization layers (such as Group normalization) because it directly uses the statistics calculated in training in reasoning.
[0086] In some embodiments, see Figure 2 , the neck network includes: a first concat module, a second concat module, a third concat module, a fourth concat module, a fifth residual focused convolution module, a sixth residual focused convolution module, a seventh residual focused convolution module, an eighth residual focused convolution module, an eighth CBS module, a ninth CBS module, a first upsampling module and a second upsampling module, the input of the first concat module is the output of the first multi-scale fusion attention mechanism module and the first upsampling module, the output of the first concat module is the input of the fifth residual focused convolution module, the output of the fifth residual focused convolution module is the input of the eighth CBS module and the detection head, the input of the second concat module is the output of the second upsampling module and the second multi-scale fusion attention mechanism module, The output of the second concat module is the input of the sixth residual focused convolution module, the output of the sixth residual focused convolution module is the input of the first upsampling module and the third concat module, the input of the third concat module is the output of the eighth CBS module, the output of the third concat module is the input of the seventh residual focused convolution module, the output of the seventh residual focused convolution module is the input of the detection head and the ninth CBS module, the input of the fourth concat module is the output of the spatial pyramid pooling module and the ninth CBS module, the input of the second upsampling module is the output of the spatial pyramid pooling module, the output of the fourth concat module is the input of the eighth residual focused convolution module, and the output of the eighth residual focused convolution module is the input of the detection head.
[0087] In the embodiment of the present application, the function of the concat module is to splice or connect multiple input features along a specified dimension to combine information from different sources. By splicing multiple input features, the neural network can simultaneously utilize information from different sources, thereby improving the network's representation ability and performance.
[0088] In some embodiments, before step S102, the method further includes:
[0089] Step S1021, obtaining a sample data set.
[0090] In the embodiment of the present application, the sample data set may be an urban facility abnormality data set.
[0091] The abnormal type is marked in the image in the sample data set. In the embodiment of the present application, a camera or other image acquisition device can be used to capture images in the real world. The captured images are marked to mark the abnormal type. Special image annotation tools such as LabelImg, CVAT, etc. can be used to mark the abnormal type of each image. The labeled images and the corresponding annotation data are then organized into a data set. After the sample data set is obtained, it can be used to train the target detection model.
[0092] Step S1022: training the initial target detection model based on the sample data set to obtain the target detection model.
[0093] In an embodiment of the present application, the sample data set can be preprocessed, and the preprocessing may include operations such as scaling, cropping, and rotating the image, as well as formatting and processing the labeled data to make it suitable for the training requirements of the target detection model. Then the initial target detection model can be selected, and the selected initial target detection model is trained using the sample data set. During the training process, the model will learn how to accurately detect the abnormal types in the image through multiple iterations. During the training process, it may be necessary to tune the hyperparameters of the model to obtain better performance. This may include adjustments to hyperparameters such as learning rate, batch size, and number of iterations. The trained target detection model needs to be evaluated. The model that performs best on the validation set evaluation index is then used as the final target detection model, which can be deployed in practical applications for urban facility anomalies.
[0094] In some embodiments, step S1022 may be implemented by the following steps:
[0095] Step S1, divide the sample data set into a training set and a validation set.
[0096] In the embodiment of the present application, the training set accounts for the majority of the total data set (eg, 70-80%), while the validation set accounts for a smaller portion (20-30%).
[0097] Step S2: training the initial target detection model based on the training set, and testing the trained initial target detection model through the validation set to obtain evaluation indicators.
[0098] In the embodiment of the present application, the initial target detection model is trained using the training set, and the model training and tuning are performed according to the steps mentioned above.
[0099] In the embodiment of the present application, the evaluation index may include: IOU (Intersection over Union), precision, recall, average precision, average precision mean or more, wherein the calculation method of the evaluation index is as follows:
[0100] IOU is an indicator for evaluating the degree of overlap between the true box and the predicted box. It calculates the ratio of the intersection and union of the two. It plays a key role in determining whether the box is correctly detected.
[0101] .
[0102] Precision (P), also known as the precision rate, refers to the proportion of samples predicted to be abnormal urban facilities that are actually abnormal. It is a metric, as shown in the formula:
[0103] .
[0104] Recall (R), also known as the recall rate, refers to the proportion of samples that are correctly detected from all samples that are actually abnormal urban facilities. It is a metric, as shown in the formula:
[0105] .
[0106] Average precision (AP) refers to the area under the precision-recall curve of the model output in the task of urban facility anomaly recognition. It is usually used to evaluate the performance of the model under a series of different IoU thresholds, as shown in the formula:
[0107] .
[0108] The mean average precision (mAP) refers to the average of the average precision AP of C different categories, which is set to 11 in this paper, as shown in the formula:
[0109] .
[0110] Step S3, when the evaluation index meets the optimal requirement, the trained initial target detection model is determined as the target detection model.
[0111] In the embodiment of the present application, if the performance of the model does not meet the requirements, it may be necessary to adjust the structure, hyperparameters, etc. of the model and then retrain and evaluate the model.
[0112] In the embodiment of the present application, the loss function of the target detection model consists of two parts: regression loss and classification loss. Among them, the classification loss is the binary cross entropy loss BCE Loss, which is used to determine the specific category in the anchor box. The regression loss is CIoU Loss and DFL loss, which are used to calculate the error between the predicted bounding box and the ground truth box. At the same time, the matching strategy between positive and negative samples adopts the TAL dynamic matching method.
[0113] The binary cross entropy loss BCE Loss can be expressed as:
[0114] ;
[0115] in, is the real category; is the predicted category.
[0116] The regression loss CIoU Loss is an improved version of the previous L1, L2, IoU and GIoU loss functions. CIOU adds a penalty term for the aspect ratio. When the center point of the predicted border coincides with the center point of the true border, it can better distinguish the errors in different situations and has scale invariance.
[0117] The regression loss can be expressed as:
[0118] ;
[0119] in, Used to measure the consistency of the relative proportions of two rectangular boxes. is the weight coefficient:
[0120] ;
[0121] ;
[0122] in, and Represents the center point of the two rectangular boxes. Represents the Euclidean distance between two rectangular boxes, Represents the distance between the diagonals of the enclosing area of two rectangular boxes.
[0123] The regression loss DFL Loss can be expressed as:
[0124] ;
[0125] in, is the cross entropy loss between the target true value and the predicted value on the left, It is the cross entropy loss between the true target value and the predicted value on the right.
[0126] The total loss Loss can be expressed as:
[0127] ;
[0128] in, , is the balance coefficient.
[0129] Based on the aforementioned target detection network, model training was performed on the self-built data set through the target detection network and the YOLOv8s network, and the performance on the validation set was statistically analyzed. The comparison of the evaluation indicators is shown in the following table. When verifying, the hardware environment for the experimental operation is: the processor is Intel(R) Xeon(R) Platinum8255C CPU, 314 G memory, the graphics card is NVIDIA Tesla V100 32 G, CentOS 8.5.2 64-bit operating system, the deep neural network is built on the pytorch deep learning framework, and the compiler is pycharm. Table 1 is a comparison table of evaluation indicators provided in an embodiment of the present application, as shown in Table 1,
[0130]
[0131] By analyzing the table, it can be found that compared with the YOLOv8s network, the target detection network has a 3% decrease in precision P, an increase of 0.7% in recall R, and an increase of 1.0% in mAP. It can be seen that the target detection network can significantly improve the recognition accuracy of abnormal urban facilities. For the YOLOv8s network, the recognition accuracy of the first category, the third type, and the ninth category is not high, and they are difficult categories. The target detection network has increased its precision P by 2%, 7.3%, and 7.2% respectively in these three categories, and its average precision mean mAP has increased by 0.5%, 1.9%, and 4.0% respectively. It can be seen that the target detection network provided in the embodiment of the present application has a good recognition effect for small targets, semantic fuzzy, and non-uniform scale categories.
[0132] Based on the foregoing embodiments, an embodiment of the present application provides an urban facility abnormality identification device, and the modules included in the device, as well as the units included in each module, can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0133] The present application provides a device for identifying abnormalities in urban facilities. Figure 6 A schematic diagram of the structure of a device for identifying abnormalities in urban facilities provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the urban facility abnormality identification device 600 includes:
[0134] The acquisition module 601 is used to acquire an image to be identified, wherein the image includes: urban facilities;
[0135] The determination module 602 is used to input the image into a pre-established target detection model to determine the abnormal category of the urban facility, wherein the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output the feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse the feature information of different scales of the image, and the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image.
[0136] In some embodiments, the residual focusing convolution module includes: a first residual focusing convolution module, a second residual focusing convolution module, a third residual focusing convolution module and a fourth residual focusing convolution module, the multi-scale fusion attention mechanism module includes: a first multi-scale fusion attention mechanism module, a second multi-scale fusion attention mechanism module, a third multi-scale fusion attention mechanism module, the backbone network also includes: a convolution module, a first CBS module, a second CBS module, a third CBS module, a fourth CBS module and a spatial pyramid pooling module, the convolution module is used to input an image, the convolution module, the first CBS module, the first residual focusing convolution module, the second CBS module, the The second residual focusing convolution module, the first multi-scale fusion attention mechanism module, the third CBS module, the third residual focusing convolution module, the second multi-scale fusion attention mechanism module, the fourth CBS module, the fourth residual focusing convolution module, the third multi-scale fusion attention mechanism module, and the spatial pyramid pooling module are connected in sequence, the first multi-scale fusion attention mechanism module is used to output feature information of the first scale to the neck network of the target detection model, the second multi-scale fusion attention mechanism module is used to output feature information of the second scale to the neck network, and the spatial pyramid pooling module is used to output feature information of the third scale to the neck network.
[0137] In some embodiments, the residual focusing convolution module includes: a residual focusing convolution block, a fifth CBS module and a sixth CBS module, the fifth CBS module is used to provide feature information of different scales to the residual focusing convolution block, the residual focusing convolution block is used to extract feature information of different scales, and perform nonlinear changes on the extracted feature information, and maintain the gradient flow of the target detection model, and input the processed feature information into the sixth CBS module.
[0138] In some embodiments, the residual focused convolution block includes: a first depthwise convolution of a first convolution kernel size, a second depthwise convolution of the first convolution kernel size, a LayerNorm layer, a convolution of a second convolution kernel size, a GELU unit, and a convolution of a second convolution kernel size, which are connected in sequence, wherein the input of the first depthwise convolution forms a residual connection with the first depthwise convolution, the input of the second depthwise convolution forms a residual connection with the second depthwise convolution, the GELU unit is used to introduce nonlinearity, and the convolution of the second convolution kernel size is used to integrate feature information and adjust the number of channels.
[0139] In some embodiments, the multi-scale fusion attention mechanism module includes: a multi-scale convolution module and an SE module connected in sequence, the multi-scale convolution module is used to obtain feature information of different scales, and splice the feature information of different scales, and output the spliced feature information, the SE module is used to extract attention weights for the spliced feature information, and determine a shared channel attention vector based on the attention weights, and re-calibrate the shared channel attention vector, and apply the re-calibrated attention vector to the multi-scale feature map, and output the result.
[0140] In some embodiments, the target detection model also includes: a detection head and a neck network, the neck network is used to output feature information of different scales input by the backbone network to the corresponding detection head, wherein feature information of different scales corresponds to different detection heads, and each detection head includes: a REG module, a first convolution shared BN separation layer, a second convolution shared BN separation layer, and a seventh CBS module, the input of the REG module is the output of the neck network, the output of the REG module is the input of the first convolution shared BN separation layer, the output of the first convolution shared BN separation layer is the input of the bounding box regression loss function, the input of the seventh CBS module is the output of the neck network, the output of the seventh CBS module is the input of the second convolution shared BN separation layer, the output of the second convolution shared separation layer is the input of the classification loss function, and the first convolution shared BN separation layer and the second convolution shared BN separation layer are used to share convolution weights between different layers.
[0141] In some embodiments, the neck network includes: a first concat module, a second concat module, a third concat module, a fourth concat module, a fifth residual focused convolution module, a sixth residual focused convolution module, a seventh residual focused convolution module, an eighth residual focused convolution module, an eighth CBS module, a ninth CBS module, a first upsampling module and a second upsampling module, the input of the first concat module is the output of the first multi-scale fusion attention mechanism module and the first upsampling module, the output of the first concat module is the input of the fifth residual focused convolution module, the output of the fifth residual focused convolution module is the input of the eighth CBS module and the detection head, the input of the second concat module is the second upsampling module and the second multi-scale fusion attention mechanism module Output, the output of the second concat module is the input of the sixth residual focused convolution module, the output of the sixth residual focused convolution module is the input of the first upsampling module and the third concat module, the input of the third concat module is the output of the eighth CBS module, the output of the third concat module is the input of the seventh residual focused convolution module, the output of the seventh residual focused convolution module is the input of the detection head and the ninth CBS module, the input of the fourth concat module is the output of the spatial pyramid pooling module and the ninth CBS module, the input of the second upsampling module is the output of the spatial pyramid pooling module, the output of the fourth concat module is the input of the eighth residual focused convolution module, and the output of the eighth residual focused convolution module is the input of the detection head.
[0142] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0143] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7As shown, the electronic device 3 of this embodiment may include: at least one processor 30 ( Figure 7 Only one processor 30 is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 1 Steps S101 to S102 in the illustrated embodiment. Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 6 Functions of modules 601 to 602 are shown.
[0144] Exemplarily, the computer program 32 may be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units may be a series of computer program 32 instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3.
[0145] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 32. When the computer program 32 is executed by the processor 30, the steps in the above-mentioned method embodiments can be implemented.
[0146] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. According to this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 32, and the computer program 32 can be stored in a computer-readable storage medium. When the computer program 32 is executed by the processor 30, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program 32 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0148] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0150] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0151] 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.
[0152] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for identifying abnormalities in urban facilities, characterized in that: include: Acquire an image to be identified, wherein the image includes: urban facilities; The image is input into a pre-established target detection model to determine the abnormal category of the urban facility, wherein the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image, and the residual focusing convolution module includes: a first residual focusing The multi-scale fusion attention mechanism module comprises: a first multi-scale fusion attention mechanism module, a second multi-scale fusion attention mechanism module, and a third multi-scale fusion attention mechanism module. The backbone network further comprises: a convolution module, a first CBS module, a second CBS module, a third CBS module, a fourth CBS module, and a spatial pyramid pooling module. The convolution module is used to extract features of different scales of the image. The convolution module, the first CBS module, the first residual focusing convolution module, the second CBS module, the second residual focusing convolution module, the first ... The difference focusing convolution module, the first multi-scale fusion attention mechanism module, the third CBS module, the third residual focusing convolution module, the second multi-scale fusion attention mechanism module, the fourth CBS module, the fourth residual focusing convolution module, the third multi-scale fusion attention mechanism module, and the spatial pyramid pooling module are connected in sequence, the first multi-scale fusion attention mechanism module is used to output the feature information of the first scale to the neck network of the target detection model, the second multi-scale fusion attention mechanism module is used to output the feature information of the second scale to the neck network, and the spatial pyramid pooling module is used to output the feature information of the third scale feature information to the neck network, the residual focusing convolution module includes: a residual focusing convolution block, a fifth CBS module and a sixth CBS module, the fifth CBS module is used to provide feature information of different scales to the residual focusing convolution block, the residual focusing convolution block is used to extract feature information of different scales, and perform nonlinear changes on the extracted feature information, and maintain the gradient flow of the target detection model, and input the processed feature information to the sixth CBS module, the residual focusing convolution block includes: a first depth convolution of the first convolution kernel size, a second depth convolution of the first convolution kernel size, a LayerNorm layer, a convolution of the second convolution kernel size, a GELU unit, and a convolution of the second convolution kernel size connected in sequence, wherein the input of the first depth convolution forms a residual connection with the first depth convolution, and the input of the second depth convolution forms a residual connection with the second depth convolution, and the GELU unit is used to introduce nonlinearity,The convolution of the second convolution kernel size is used to integrate feature information and adjust the number of channels. The multi-scale fusion attention mechanism module includes: a multi-scale convolution module and an SE module connected in sequence. The multi-scale convolution module is used to obtain feature information of different scales, and splice the feature information of different scales, and output the spliced feature information. The SE module is used to extract attention weights from the spliced feature information, and determine the shared channel attention vector based on the attention weights, and recalibrate the shared channel attention vector, and apply the recalibrated attention vector to the multi-scale feature map, and output the result.
2. The method according to claim 1, characterized in that Feature information of different scales corresponds to different detection heads, and each detection head includes: a REG module, a first convolution shared BN separation layer, a second convolution shared BN separation layer, and a seventh CBS module. The input of the REG module is the output of the neck network, the output of the REG module is the input of the first convolution shared BN separation layer, the output of the first convolution shared BN separation layer is the input of the bounding box regression loss function, the input of the seventh CBS module is the output of the neck network, the output of the seventh CBS module is the input of the second convolution shared BN separation layer, the output of the second convolution shared BN separation layer is the input of the classification loss function, and the first convolution shared BN separation layer and the second convolution shared BN separation layer are used to share convolution weights between different layers.
3. The method according to claim 2, characterized in that The neck network includes: a first concat module, a second concat module, a third concat module, a fourth concat module, a fifth residual focused convolution module, a sixth residual focused convolution module, a seventh residual focused convolution module, an eighth residual focused convolution module, an eighth CBS module, a ninth CBS module, a first upsampling module and a second upsampling module, the input of the first concat module is the output of the first multi-scale fusion attention mechanism module and the first upsampling module, the output of the first concat module is the input of the fifth residual focused convolution module, the output of the fifth residual focused convolution module is the input of the eighth CBS module and the detection head, the input of the second concat module is the output of the second upsampling module and the second multi-scale fusion attention mechanism module, The output of the second concat module is the input of the sixth residual focused convolution module, the output of the sixth residual focused convolution module is the input of the first upsampling module and the third concat module, the input of the third concat module is the output of the eighth CBS module, the output of the third concat module is the input of the seventh residual focused convolution module, the output of the seventh residual focused convolution module is the input of the detection head and the ninth CBS module, the input of the fourth concat module is the output of the spatial pyramid pooling module and the ninth CBS module, the input of the second upsampling module is the output of the spatial pyramid pooling module, the output of the fourth concat module is the input of the eighth residual focused convolution module, and the output of the eighth residual focused convolution module is the input of the detection head.
4. A device for identifying abnormalities in urban facilities, characterized in that: include: An acquisition module, used for acquiring an image to be identified, wherein the image includes: urban facilities; A determination module is used to input the image into a pre-established target detection model to determine the abnormal category of the urban facility, wherein the target detection model includes: a backbone network, a neck network and a detection head connected in sequence, the neck network is used to output feature information of different scales output by the backbone network to the corresponding detection head, the backbone network includes: a residual focusing convolution module and a multi-scale fusion attention mechanism module, the residual focusing convolution module is used to extract and fuse feature information of different scales of the image, the multi-scale fusion attention mechanism module is used to perform multi-scale convolution fusion operations on the feature information of the image, and the residual focusing convolution module includes: The first residual focusing convolution module, the second residual focusing convolution module, the third residual focusing convolution module and the fourth residual focusing convolution module, the multi-scale fusion attention mechanism module includes: the first multi-scale fusion attention mechanism module, the second multi-scale fusion attention mechanism module, the third multi-scale fusion attention mechanism module, the backbone network also includes: a convolution module, a first CBS module, a second CBS module, a third CBS module, a fourth CBS module and a spatial pyramid pooling module, the convolution module is used to extract features of different scales of the image, the convolution module, the first CBS module, the first residual focusing convolution module, the second CBS module, the The second residual focusing convolution module, the first multi-scale fusion attention mechanism module, the third CBS module, the third residual focusing convolution module, the second multi-scale fusion attention mechanism module, the fourth CBS module, the fourth residual focusing convolution module, the third multi-scale fusion attention mechanism module, and the spatial pyramid pooling module are connected in sequence, the first multi-scale fusion attention mechanism module is used to output the feature information of the first scale to the neck network of the target detection model, the second multi-scale fusion attention mechanism module is used to output the feature information of the second scale to the neck network, and the spatial pyramid pooling module is used to output the third The residual focusing convolution module comprises: a residual focusing convolution block, a fifth CBS module and a sixth CBS module, the fifth CBS module is used to provide feature information of different scales to the residual focusing convolution block, the residual focusing convolution block is used to extract feature information of different scales, and perform nonlinear changes on the extracted feature information, and maintain the gradient flow of the target detection model, and input the processed feature information to the sixth CBS module, the residual focusing convolution block comprises: a first depth convolution of the first convolution kernel size, a second depth convolution of the first convolution kernel size, a LayerNorm layer, a convolution of the second convolution kernel size, a GELU unit and a convolution of the second convolution kernel size connected in sequence, wherein the input of the first depth convolution forms a residual connection with the first depth convolution, and the input of the second depth convolution forms a residual connection with the second depth convolution, and the GELU unit is used to introduce nonlinearity,The convolution of the second convolution kernel size is used to integrate feature information and adjust the number of channels. The multi-scale fusion attention mechanism module includes: a multi-scale convolution module and an SE module connected in sequence. The multi-scale convolution module is used to obtain feature information of different scales, and splice the feature information of different scales, and output the spliced feature information. The SE module is used to extract attention weights from the spliced feature information, and determine the shared channel attention vector based on the attention weights, and recalibrate the shared channel attention vector, and apply the recalibrated attention vector to the multi-scale feature map, and output the result.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
