Optical image foreign object detection method and device based on end-to-end deep network
By adopting an end-to-end deep network-based method in Deformable DETR and combining spatial and channel attention weights to weight feature vectors, the problem of excessive feature weights in the ResNet network is solved and the accuracy and reliability of foreign object detection at the airport are improved. .
Patent Information
- Application Number
- CN202411095406.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-12
AI Technical Summary
When the existing Deformable DETR uses the ResNet network in the feature extraction part, the feature weights are equivalent, and the background feature weights occupy a dominant position, affecting the detection performance, resulting in insufficient accuracy and reliability of foreign object detection at the airport.
A method based on end-to-end deep networks is used to extract feature vectors from the input feature maps of optical images, compress them along different dimensional directions, calculate spatial offsets and perform deformable convolution to generate spatial attention weights; at the same time, through global Pooling and a two-layer fully connected network generate channel attention weights, combine spatial and channel attention weights to weight feature vectors, and generate weighted feature maps to improve target feature salience and reduce background noise interference.
It significantly improves the accuracy and reliability of foreign object detection at the airport, enhances the feature salience of the target area, reduces background noise interference, and improves detection performance.
Smart Images

Figure CN118628486B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of foreign object detection, and in particular to a method, device, computer equipment, storage medium and computer program product for detecting foreign objects in an airport using optical images based on an end-to-end deep network. Background Art
[0002] Foreign Objects Debris (FOD) refers to foreign objects located on the airport runway that may damage aircraft, equipment, and threaten the safety of personnel. FOD on the airport pavement often punctures tires, causes engine failures, affects landing gear flap operations, and damages aircraft, which not only causes great economic losses to airlines, but also poses great risks to flight safety and personnel safety. At present, FOD detection technologies mainly include optoelectronic and radar technologies. Optical-based detection systems can provide high-resolution images and can be arranged near the runways of the entire airport to achieve full coverage. However, optical systems are easily affected by changes in external lighting, and there is a risk of false detection and missed detection. Common FOD are small in size, and existing optical-based detection systems cannot distinguish target features from background features, and thus cannot achieve the preset indicators. Therefore, improving target discrimination and enhancing target features are the key to improving the performance of foreign object detection systems.
[0003] DETR (Detection Transformer) is a pure end-to-end detection architecture, which is widely used in target monitoring. Deformable DETR is a Transformer architecture designed for small target detection where DETR cannot be applied. Applying Deformable DETR to FOD detection has natural advantages: first, the image resolution is high and the features are rich; second, it is a pure end-to-end architecture, without the need to invest additional resources in designing manual components; third, the model architecture is simple and easy to deploy; fourth, it has high detection accuracy and can meet the needs of most scenarios.
[0004] However, Deformable DETR only uses ResNet for feature extraction. For example, the patent with publication number CN116543409A discloses a method for extracting target from a certificate, including modeling using the geometric properties of the edge segments of the certificate image as straight lines, combining the contextual information of the global image for reasoning; using the ResNet network to extract global image features, and then using the DeformableDETR encoder for encoding. Since the feature weights extracted by the ResNet network are comparable, and even the background feature weights occupy a dominant position, the detection performance is affected. Therefore, like other optical systems, DeformableDETR still cannot achieve the performance of conventional target detection for weak targets. Summary of the invention
[0005] Based on this, it is necessary to provide an optical image airport foreign object detection method, device, computer equipment, computer-readable storage medium and computer program product based on an end-to-end deep network to address the technical problem that the feature weights extracted by the existing Deformable DETR using the ResNet network in the feature extraction part are equivalent, or even the background feature weights occupy a dominant position, which affects the detection performance.
[0006] In a first aspect, the present application provides a method for detecting foreign objects in optical images based on an end-to-end deep network. The method comprises:
[0007] Step S1, extracting a feature vector from an input feature map of an optical image;
[0008] Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction;
[0009] Step S3, calculating the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network;
[0010] Step S4, performing deformable convolution on each feature plane based on each spatial offset to obtain a spatial attention weight of each feature plane;
[0011] Step S5, globally pooling the feature vector to obtain channel information statistics;
[0012] Step S6, inputting the channel information statistics into the first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimensionality reduction;
[0013] Step S7, using the ReLU activation function to perform nonlinear transformation on the channel information statistics after dimension reduction;
[0014] Step S8, inputting the channel information statistics obtained in step S7 into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels;
[0015] Step S9, using the sigmoid activation function to map the channel information statistics obtained in step S8 to between 0 and 1 to generate a channel attention weight for each channel;
[0016] Step S10, adding the spatial attention weight of each feature plane and the channel attention weight of each channel to the feature vector to obtain the attention vectors in different dimensional directions;
[0017] Step S11, performing shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map;
[0018] Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
[0019] In one embodiment, step S1 comprises:
[0020] Step S110, extracting feature vectors of different scales from the input feature map;
[0021] Step S120, performing channel alignment processing on feature vectors of different scales.
[0022] In one embodiment, step S2 comprises:
[0023] Step S21, compressing the feature vector along the height dimension direction to obtain a first feature plane in the height dimension direction; the expression of the first feature plane is:
[0024]
[0025] In the formula, represents the first feature plane, H represents the height of the input feature map, represents the eigenvalue of the i-th row and j-th column in the eigenvector;
[0026] Step S22, compressing the feature vector along the width dimension to obtain a second feature plane in the width dimension; the expression of the second feature plane is:
[0027]
[0028] In the formula, represents the second feature plane, and W represents the width of the input feature map.
[0029] In one embodiment, step S5 comprises:
[0030] Step S51, perform global average pooling on the feature vector to obtain channel information statistics; the expression of channel information statistics is:
[0031]
[0032] In the formula, Represents channel information statistics.
[0033] In one embodiment, the first fully connected layer and the second fully connected layer are both 1×1 convolutional layers.
[0034] In one embodiment, step S3 comprises:
[0035] Step S31, calculating the initial offset of the feature plane according to the convolution kernel parameters of the offset generation network;
[0036] Step S32, performing bilinear interpolation on the initial offset to obtain the spatial offset of the feature plane.
[0037] In a second aspect, the present application also provides an optical image foreign object detection device based on an end-to-end deep network. The device comprises:
[0038] A feature vector compression module is used to extract feature vectors from an input feature map of an optical image; compress the feature vectors along different dimensional directions to obtain feature planes in each dimensional direction;
[0039] A spatial attention weight calculation module is used to calculate the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network; based on each spatial offset, a deformable convolution is performed on each feature plane to obtain the spatial attention weight of each feature plane;
[0040] The feature vector global pooling module is used to perform global pooling on the feature vector to obtain channel information statistics;
[0041] The channel attention weight calculation module is used to perform nonlinear transformation on the channel information statistics after dimension reduction using the ReLU activation function; the channel information statistics after dimension reduction are input into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels; the channel information statistics restored to the original number of channels are mapped to between 0 and 1 using the sigmoid activation function to generate the channel attention weight of each channel;
[0042] The weighted feature map generation module is used to weight the spatial attention weights of each feature plane and the channel attention weights of each channel to the feature vector to obtain the attention vectors in different dimensional directions; the attention vectors in different dimensional directions are shaped aligned to obtain the weighted feature map;
[0043] The optical image airport foreign object detection module is used to obtain the optical image airport foreign object detection result according to the weighted feature map.
[0044] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0045] Step S1, extracting a feature vector from an input feature map of an optical image;
[0046] Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction;
[0047] Step S3, calculating the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network;
[0048] Step S4, performing deformable convolution on each feature plane based on each spatial offset to obtain a spatial attention weight of each feature plane;
[0049] Step S5, globally pooling the feature vector to obtain channel information statistics;
[0050] Step S6, inputting the channel information statistics into the first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimensionality reduction;
[0051] Step S7, using the ReLU activation function to perform nonlinear transformation on the channel information statistics after dimension reduction;
[0052] Step S8, inputting the channel information statistics obtained in step S7 into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels;
[0053] Step S9, using the sigmoid activation function to map the channel information statistics obtained in step S8 to between 0 and 1 to generate a channel attention weight for each channel;
[0054] Step S10, adding the spatial attention weight of each feature plane and the channel attention weight of each channel to the feature vector to obtain the attention vectors in different dimensional directions;
[0055] Step S11, performing shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map;
[0056] Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
[0057] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0058] Step S1, extracting a feature vector from an input feature map of an optical image;
[0059] Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction;
[0060] Step S3, calculating the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network;
[0061] Step S4, performing deformable convolution on each feature plane based on each spatial offset to obtain a spatial attention weight of each feature plane;
[0062] Step S5, globally pooling the feature vector to obtain channel information statistics;
[0063] Step S6, inputting the channel information statistics into the first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimensionality reduction;
[0064] Step S7, using the ReLU activation function to perform nonlinear transformation on the channel information statistics after dimension reduction;
[0065] Step S8, inputting the channel information statistics obtained in step S7 into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels;
[0066] Step S9, using the sigmoid activation function to map the channel information statistics obtained in step S8 to between 0 and 1 to generate a channel attention weight for each channel;
[0067] Step S10, adding the spatial attention weight of each feature plane and the channel attention weight of each channel to the feature vector to obtain the attention vectors in different dimensional directions;
[0068] Step S11, performing shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map;
[0069] Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
[0070] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0071] Step S1, extracting a feature vector from an input feature map of an optical image;
[0072] Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction;
[0073] Step S3, calculating the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network;
[0074] Step S4, performing deformable convolution on each feature plane based on each spatial offset to obtain a spatial attention weight of each feature plane;
[0075] Step S5, globally pooling the feature vector to obtain channel information statistics;
[0076] Step S6, inputting the channel information statistics into the first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimensionality reduction;
[0077] Step S7, using the ReLU activation function to perform nonlinear transformation on the channel information statistics after dimension reduction;
[0078] Step S8, inputting the channel information statistics obtained in step S7 into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels;
[0079] Step S9, using the sigmoid activation function to map the channel information statistics obtained in step S8 to between 0 and 1 to generate a channel attention weight for each channel;
[0080] Step S10, adding the spatial attention weight of each feature plane and the channel attention weight of each channel to the feature vector to obtain the attention vectors in different dimensional directions;
[0081] Step S11, performing shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map;
[0082] Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
[0083] The optical image foreign object detection method, device, computer equipment, storage medium and computer program product based on end-to-end deep network extract feature vectors from the input feature map of the optical image, compress the feature vectors along different dimensional directions to obtain feature planes in different dimensional directions, calculate the spatial offset of each feature plane using the convolution kernel parameters generated by the offset generation network, and assign spatial attention weights to each feature plane through deformable convolution, which can dynamically adjust the spatial attention of the feature plane so that the feature area related to the target gets a higher weight, thereby enhancing the feature significance of the target area; at the same time, the channel attention weight of each channel is generated through global pooling and a two-layer fully connected network, which not only realizes the feature screening of the channel dimension, but also ensures the accuracy and effectiveness of the channel attention weight through nonlinear transformation and dimensional recovery. Finally, by weighting the spatial attention weight and the channel attention weight to the feature vector, an attention vector containing rich and accurate attention information is generated, and the shape alignment of the attention vectors in different dimensional directions is performed to obtain a weighted feature map. The feature map not only highlights the characteristics of foreign objects, but also reduces the interference of background noise, thereby greatly improving the accuracy and reliability of airport foreign object detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 1 is a flow chart of a method for detecting foreign objects in optical images based on an end-to-end deep network in one embodiment;
[0085] Figure 2is a flow chart of a method for detecting foreign objects in optical images based on an end-to-end deep network in another embodiment;
[0086] Figure 3 A schematic diagram of a portion of images of a training set in one embodiment;
[0087] Figure 4 A schematic diagram of mAP curves of Deformable DETR combined with different channel attention mechanisms in one embodiment;
[0088] FIG5( a ) is a schematic diagram of a portion of images of a test set in one embodiment;
[0089] FIG5( b ) is a schematic diagram of the original Deformable DETR detection result in one embodiment;
[0090] FIG5(c) is a schematic diagram of the detection result after Deformable DETR is combined with MDDC (Multi-DirectionalDeformable Channel Attention, multi-directional deformable attention module) in one embodiment;
[0091] FIG5(d) is a schematic diagram of the detection result after Deformable DETR is combined with SE (Squeeze-and-ExcitationAttention) in one embodiment;
[0092] FIG5(e) is a schematic diagram of the detection result after Deformable DETR is combined with ECA (Efficient Channel Attention, efficient channel attention mechanism) in one embodiment;
[0093] FIG5(f) is a schematic diagram of the detection result after Deformable DETR is combined with CBAM (Convolutional Block Attention Module) in one embodiment;
[0094] FIG5(g) is a schematic diagram of the detection result after Deformable DETR is combined with CA (Coordinate Attention) in one embodiment;
[0095] Figure 6 is a structural block diagram of an optical image foreign object detection device based on an end-to-end deep network in one embodiment;
[0096] Figure 7 Schematic diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0097] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0098] In one embodiment, Figure 1 As shown, a method for detecting foreign objects in optical images based on an end-to-end deep network is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0099] Step S1, extracting a feature vector from an input feature map of an optical image.
[0100] Specifically, an optical image of the airport runway is obtained and preprocessed into a size suitable for network input, such as 256×256 pixels, and then a pre-trained convolutional neural network (CNN) is used as a feature extractor. This network can be a standard CNN architecture, such as VGG, ResNet, etc., but it needs to be run separately on images of different scales to extract features. For each scale of image, different layers of CNN will output feature maps of different levels. High-level feature maps contain rich semantic information, but have low spatial resolution, while low-level feature maps have high spatial resolution and retain more location information. In order to utilize this information simultaneously, multiple levels of feature maps can be extracted from images of each scale, and the feature maps can be further pooled or convolved to obtain feature vectors corresponding to the feature maps.
[0101] Then, in order to better combine high-level semantic information and low-level position information, feature fusion between feature vectors of different scales can be considered. This can be achieved through architectures such as Feature Pyramid Network (FPN). The high-level features are fused with low-level features through upsampling to generate multi-scale feature vectors that contain both rich semantics and precise position information. Ultimately, the output of step S1 will be a set of multi-scale feature vectors, which will be used as input for subsequent steps (such as deformable convolution, attention mechanism, etc.) to further process and detect small-sized objects in the image.
[0102] Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction.
[0103] Specifically, the feature vector is compressed by pooling operation along the width or height dimension direction to obtain feature planes in the height dimension direction and the width dimension direction respectively. The compression operation may include averaging, maximum value, minimum value, summation, etc. Exemplarily, the feature vector may be kept unchanged in each width and channel dimension, and average pooling may be performed in the height dimension direction to obtain the feature plane in the height dimension direction; the feature vector may be kept unchanged in each height and channel dimension, and average pooling may be performed in the width dimension direction to obtain the feature plane in the width dimension direction.
[0104] Step S3, calculating the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network.
[0105] Specifically, a lightweight convolutional network is designed, such as one or several convolutional layers, and the feature planes in each dimensional direction obtained in step S2 are input into the designed lightweight convolutional network. The network outputs the spatial offset of each feature point, or sampling point, on the feature plane. These offsets are used to adjust the sampling position of the feature plane in subsequent convolution operations. The specific calculation formula of the spatial offset is shown in formula (1):
[0106] (1)
[0107] In formula (1), Indicates the spatial offset, represents the characteristic plane, Represents the convolution kernel parameters of the offset generation network.
[0108] Step S4, performing deformable convolution on each feature plane based on each spatial offset to obtain the spatial attention weight of each feature plane.
[0109] Specifically, the spatial offset generated in step S3 is used to perform deformable convolution on each feature plane. Deformable convolution allows the convolution kernel to dynamically adjust its shape and position according to the spatial offset during sampling, so as to more accurately capture the geometric deformation of the target. The enhanced feature maps are obtained by deformable convolution, and these feature maps contain spatial attention weight information. Among them, when the feature plane includes a feature plane in the height dimension direction and a feature plane in the width dimension direction, the specific calculation formula for the spatial attention weight of the feature plane in the height dimension direction is shown in formula (2); the specific calculation formula for the spatial attention weight of the feature plane in the width dimension direction is shown in formula (3):
[0110] (2)
[0111] (3)
[0112] In formula (2) and formula (3), Represents the spatial attention weight of the feature plane in the height dimension, represents the spatial attention weight of the feature plane in the width dimension, represents the ReLU activation function, represents the sigmoid activation function, represents the normalization function, and are the weight matrices of the two deformable convolutional layers, respectively, where , , r represents the dimension attenuation factor, C represents the number of original channels, and C / r represents the number of intermediate channels when obtaining attention. The weight matrix of the two deformable convolutional layers can be calculated by the formula shown in formula (4):
[0113] (4)
[0114] In formula (4), It indicates the specific position of the convolution kernel when it slides on the input feature plane, that is, the sampling position. Representation and sampling location The corresponding spatial offset, Indicates that the convolution kernel slides to the The weight value of the convolution kernel at the position, Represents the input feature plane The eigenvalues of the positions, Represents the output feature plane The eigenvalue of the location.
[0115] Step S5, globally pooling the feature vector to obtain channel information statistics.
[0116] Specifically, a global pooling operation is performed on the feature vector obtained in step S1 to obtain statistics that only retain channel information, such as mean, maximum value, etc.; channel information statistics represent the importance of feature vectors on different channels. Exemplarily, global average pooling can be performed on the spatial information of each channel. Through global average pooling, the information statistics of each channel represent the global response of the channel on the entire feature map.
[0117] Step S6: input the channel information statistics to the first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimensionality reduction.
[0118] Specifically, the channel information statistics obtained in step S5 are input into two fully connected layers. The first fully connected layer is used for dimensionality reduction, reducing the number of parameters and extracting key information; the second fully connected layer is used to restore the output dimension to the original number of channels so as to correspond one-to-one with the channels of the input feature map.
[0119] Step S7, using the ReLU activation function to perform nonlinear transformation on the channel information statistics after dimensionality reduction.
[0120] Step S8, inputting the channel information statistics obtained in step S7 into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels.
[0121] Step S9, using the sigmoid activation function to map the channel information statistics obtained in step S8 to between 0 and 1, so as to generate the channel attention weight of each channel.
[0122] After the first fully connected layer, the ReLU activation function is used to increase nonlinearity to help the network learn complex features. Then, after the second fully connected layer, the sigmoid activation function is used to map the output value to between 0 and 1 as the attention weight of each channel. Specifically, steps S7 to S9 can be expressed by the formula shown in formula (5):
[0123] (5)
[0124] In formula (5), represents the channel attention weight, represents the channel information statistic, 1 represents the first fully connected layer, 2 represents the second fully connected layer.
[0125] Step S10, add the spatial attention weight and the channel attention weight to the feature vector to obtain the attention vectors in different dimensional directions.
[0126] The spatial attention weights of each feature plane obtained in step S4 are combined with the channel attention weights of each channel obtained in step S9 to perform weighted processing on the feature vector. Specifically, the two can be fused by element-by-element multiplication to obtain the final attention vector. For example, the spatial attention weights of the feature plane in the height dimension are , the spatial attention weight of the feature plane in the width dimension And the attention weight of each channel The specific calculation formula for weighted processing of feature vectors is shown in formula (6):
[0127] (6)
[0128] In formula (6), represents the attention vector, represents the feature vector extracted from the input feature map of the optical image, Represents an extended reweighting operation, which extends the deformable spatial attention and channel attention to be compatible with the shape of the feature vector, and multiplies them element by element to obtain the weighted result. The final attention vector may include the attention vector in the height dimension direction, the attention vector in the width dimension direction, and the attention vector in the channel direction.
[0129] Step S11, shape alignment is performed on the attention vectors in different dimensional directions to obtain a weighted feature map.
[0130] In order to balance the richness of feature representation and computational complexity, the attention vectors in each dimensional direction obtained in step S10 are concatenated in the channel dimension to obtain a weighted feature map. Specifically, the attention vectors in different dimensional directions can be concatenated along the channel dimension to obtain a concatenated attention vector, and then the concatenated attention vector is reduced to the same shape as the input feature map to obtain a weighted feature map. For example, as shown in equations (7) and (8), the attention vector in the height dimensional direction is first concatenated. , the attention vector in the width dimension and the attention vector in the channel direction Perform splicing to obtain the spliced attention vector , and then the concatenated attention vector A dimensionality reduction is performed along one dimension, namely the channel dimension, to restore the same shape as the input feature map:
[0131] (7)
[0132] (8)
[0133] In formula (8), Represents a weighted feature map.
[0134] Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
[0135] The weighted feature map is input into the subsequent detection network (such as the target detector). The detection network can predict whether there are foreign objects in the optical image and the location, size and other properties of the foreign objects based on the feature information in the weighted feature map, and finally output the detection result of the foreign objects in the optical image airport. The detection result may include the location, size, category and other information of the foreign objects.
[0136] The optical image foreign object detection method based on end-to-end deep network in this embodiment extracts feature vectors from the input feature map of the optical image, compresses the feature vectors along different dimensional directions to obtain feature planes in different dimensional directions, calculates the spatial offset of each feature plane using the convolution kernel parameters generated by the offset generation network, and assigns spatial attention weights to each feature plane through deformable convolution, which can dynamically adjust the spatial attention of the feature plane so that the feature areas related to the target get higher weights, thereby enhancing the feature significance of these areas; at the same time, the channel attention weights of each channel are generated through global pooling and two-layer fully connected networks, which not only realizes the feature screening of the channel dimension, but also ensures the accuracy and effectiveness of the channel attention weights through nonlinear transformation and dimensional recovery. Finally, by weighting the spatial attention weights and channel attention weights to the feature vectors, an attention vector containing rich and accurate attention information is generated, and the attention vectors in different dimensional directions are aligned to obtain a weighted feature map. This feature map not only highlights the characteristics of foreign objects, but also reduces the interference of background noise, thereby greatly improving the accuracy and reliability of airport foreign object detection.
[0137] In one embodiment, step S1 includes:
[0138] Step S110, extracting feature vectors of different scales from the input feature map.
[0139] Specifically, different sizes of convolution kernels or pooling layers can be used to extract features of different scales from the input feature map. For example, by applying convolution layers with different strides or padding, or using different sizes of maximum pooling or average pooling layers to extract feature vectors of different scales from the input feature map.
[0140] Step S120, performing channel alignment processing on feature vectors of different scales.
[0141] Check whether the number of channels of all feature vectors extracted from step S110 is consistent. If not, adjustments need to be made to ensure compatibility of subsequent processing. For example, if some feature vectors have fewer channels, the number of channels can be increased by filling zeros or random values in the channel dimension; if the number of channels is too large, some channels can be selectively cropped.
[0142] This embodiment makes channel features more standardized by aligning channels of feature vectors of different scales, which can improve the computational efficiency in subsequent multi-channel feature fusion or other processing steps, and also facilitates modular development and integration of feature vectors, improving the readability and maintainability of the code.
[0143] In one embodiment, step S2 includes:
[0144] Step S21, compress the feature vector along the height dimension to obtain a first feature plane in the height dimension. Specifically, average pooling is performed on the feature vector in the height dimension to obtain the first feature plane in the height dimension of the feature vector. The expression of the first feature plane is shown in formula (9):
[0145] (9)
[0146] In formula (9), represents the first feature plane, H represents the height of the input feature map, Represents the eigenvalue of the i-th row and j-th column in the eigenvector.
[0147] Step S22, compress the feature vector along the width dimension to obtain a second feature plane in the width dimension. Specifically, average pooling is performed on the feature vector in the width dimension to obtain the second feature plane in the width dimension of the feature vector. The expression of the second feature plane is shown in formula (10):
[0148] (10)
[0149] In formula (10), represents the second feature plane, and W represents the width of the input feature map.
[0150] After obtaining the first feature plane in the height dimension and the second feature plane in the width dimension, the spatial offset of the first feature plane and the spatial offset of the second feature plane can be calculated according to formula (1). Then, the spatial attention weight corresponding to the first feature plane can be calculated according to formula (2) and formula (3). The spatial attention weight corresponding to the second feature plane Then, according to formula (6), the spatial attention weight corresponding to the first feature plane is , the spatial attention weight corresponding to the second feature plane , channel attention weight Weighted to feature vector , respectively get the attention vector in the height dimension direction , the attention vector in the width dimension and the attention vector in the channel dimension Finally, the weighted feature map is obtained according to equations (7) and (8).
[0151] This embodiment performs average pooling on the feature vector in the height and width dimensions respectively to achieve compression of the feature vector along different dimensional directions. This can reduce the amount of calculation in subsequent steps while retaining the information of the original input feature map in different spatial dimensions, thereby further improving the efficiency and reliability of airport foreign object detection.
[0152] In one embodiment, step S5 includes:
[0153] Step S51, perform global average pooling on the feature vector to obtain channel information statistics. Specifically, as shown in formula (11):
[0154] (11)
[0155] In formula (11), Represents the channel information statistic. The output value of each channel represents the global response of the channel on the entire feature map.
[0156] This embodiment performs global average pooling on feature vectors to obtain channel information statistics, which can reduce the amount of calculation and improve the detection efficiency of foreign object detection in optical images.
[0157] In one embodiment, the first fully connected layer and the second fully connected layer are both 1×1 convolutional layers. The output expression of the convolutional layer is shown in formula (12):
[0158] (12)
[0159] In formula (12), Indicates the specific position of the convolution kernel when sliding, Indicates that the convolution kernel is The weight of the position, Represents channel information statistics The eigenvalues of the positions, Represents the output feature map The eigenvalue of the location.
[0160] This embodiment can achieve the same dimensionality compression, feature extraction and weight generation functions by setting the first fully connected layer and the second fully connected layer to be 1×1 convolutional layers, thereby retaining more original feature information and improving detection reliability.
[0161] In one embodiment, step S3 includes:
[0162] Step S31, calculating the initial offset of the feature plane according to the convolution kernel parameters of the offset generation network.
[0163] Step S32, performing bilinear interpolation on the initial offset to obtain the spatial offset of the feature plane.
[0164] Specifically, the initial offset of the feature plane calculated according to the formula shown in formula (1) usually does not point to a complete value position, and a bilinear interpolation is required to obtain the corresponding position value. Exemplarily, for the initial offset of each position, find the four nearest neighbor pixels on the corresponding feature map, and calculate the weighted sum of the four nearest neighbor pixels. Repeat the above process, perform bilinear interpolation on each position on the feature map, and finally obtain the spatial offset of all positions in the feature plane. Among them, the weight can be determined by the relative position between the initial offset and the nearest neighbor pixel point. For example, the closer the relative position between the initial offset and the nearest neighbor pixel point is, the higher the weight. Furthermore, when the initial offset causes the sampling position to exceed the boundary of the feature plane, appropriate padding or truncation processing can be performed to improve the accuracy of the sampling, thereby ensuring the accuracy of the spatial offset calculation result.
[0165] In this embodiment, the spatial offset of the feature plane is obtained by performing bilinear interpolation on the initial offset, so that the accuracy of subsequent deformable convolution operations can be improved.
[0166] In order to better understand the optical image foreign object detection method based on end-to-end deep network in the above embodiment, a more detailed embodiment is provided below for illustration.
[0167] In one embodiment, Figure 2 As shown in the figure, a method for detecting foreign objects in optical images based on an end-to-end deep network is provided. This method proposes MDDC (Multi-Directional Deformable Channel Attention) to make the end-to-end model Deformable DETR suitable for airport FOD detection. The specific steps are as follows:
[0168] 1. Channel alignment: In the network model, to detect small-sized targets, it is necessary to use feature vectors of different scales to extract high-level semantic information while integrating the underlying position information. Channel alignment makes channel features more standardized, which facilitates the modular development and integration of feature vectors in subsequent multi-channel feature fusion or other processing steps, and improves the readability and maintainability of the code.
[0169] 2. Spatial compression: Align the feature vectors (H×W×C) compresses channels along different dimensions, that is, calculates the feature vector The average value in the dimension direction is used to obtain the feature plane in the dimension direction. Specifically, as shown in equations (9)-(10), the feature vector is calculated. The average value in the height dimension direction obtains the characteristic plane in the height dimension direction (1×W×C), i.e., the first characteristic plane in the above embodiment; calculate the characteristic vector The average value in the width dimension direction obtains the characteristic plane in the width dimension direction (H×1×C), which is the second characteristic plane in the above embodiment.
[0170] 3. Deformable spatial attention: After obtaining the feature planes in the height and width directions of the feature vector, the spatial offsets of the two feature planes are calculated according to formula (1). When the spatial offset is obtained, it usually does not point to a complete value position, and a bilinear interpolation is required to obtain the corresponding position value. Specifically, as shown in formulas (2)-(4), after obtaining the spatial offset, the deformable spatial attention can be obtained by combining the channel attention mechanism and the deformable convolution mechanism. Deformable convolution is used to dynamically adjust the sampling position of the convolution kernel to pay more attention to the local details in the image.
[0171] 4. Global pooling: By globally compressing the feature vector, a statistic that only retains the channel information is obtained. Specifically, as shown in formula (11), the spatial information of each channel is globally averaged pooled. Through global average pooling, the output value of each channel represents the global response of the channel on the entire feature map.
[0172] 5. Channel Attention: As shown in Equations (5) and (12), a 1×1 convolutional layer with fewer output neurons (i.e., Y 1 The output channel number is usually set to C / r, where C is the original number of channels and r is the scaling ratio), and the C-dimensional channel information statistics are compressed. This step not only significantly reduces the number of parameters, but also naturally introduces nonlinearity through the compression process, which helps the model capture more complex information. Then, the ReLU activation function is applied to the compressed channel information statistics to further enhance its nonlinear expression ability, allowing the model to learn more sophisticated and complex inter-channel relationships. Next, the second 1×1 convolutional layer (i.e., Y 2 The second 1×1 convolutional layer is used to map the output of the second 1×1 convolutional layer to between 0 and 1 through the sigmoid function to generate the channel attention weight for each channel. This combination of linear and nonlinear transformations can capture the relationship between different channels and help learn more complex features.
[0173] 6. Feature weighting: As shown in formula (6), the obtained spatial attention weight and channel attention weight are weighted to the subsequent feature vector.
[0174] 7. Shape alignment: As shown in formula (7), in order to balance the richness of feature representation and computational complexity, the three weighted feature vectors obtained in step 6 are concatenated along the channel dimension. Then, according to formula (8), the dimension is reduced to the same shape as the input feature map.
[0175] 8. Output: Unlike the traditional channel attention mechanism, when MDDC processes channel information in the H (height) and W (width) directions, it abandons the common Linear layer or 1×1 convolution to complete the extraction of channel attention and instead adopts deformable convolution technology. The spatial information in each channel is better extracted through optimal sparse spatial sampling, and the subsequent weight distribution is intelligently adjusted based on this spatial information, thereby enhancing the representation ability of the feature. However, this method of extracting spatial information focusing on a single channel, although it improves spatial sensitivity, may inadvertently ignore the interactive information between channels, thereby weakening the overall importance of channel information. To make up for this potential defect, MDDC cleverly introduces a parallel processing mechanism to perform an additional global channel attention extraction in the channel dimension. This step aims to fully capture the dependencies between channels and ensure that important channel information is not missed. Finally, MDDC weightedly fuses the attention vectors in these three dimensions (including spatial attention in the H and W directions and global channel attention) to generate a new and richer feature representation. This multi-dimensional attention fusion strategy not only retains the refinement of spatial information, but also strengthens the information interaction between channels, making the output weighted feature map highly sensitive and accurate at multiple levels.
[0176] In order to accurately analyze the changes in the performance of Deformable DETR before and after adding MDDC, the FOD dataset is used for analysis. Some images are shown in Figure 2. Figure 3 As shown. Among them, Figure 3 The part selected in the middle box is a foreign object. The constructed training set contains 468 images, the validation set contains 118 images, and the test set contains 44 images. In order to reflect the progress of the invention, a comparative experiment is conducted with other channel attention mechanisms. Figure 4 The mAP curves of Deformable DETR combined with different channel attention mechanisms on the dataset are given, and Table 1 gives the experimental indicators of Deformable DETR combined with different channel attention mechanisms. Figure 4As can be seen from Table 1, the mAP, F1 and confidence score of Deformable DETR are improved after combining with MDDC. In Table 1, the mAP of the original Deformable DETR model is 79.9%, which is increased to 84.8% after combining with MDDC, an increase of 5.1 percentage points. In addition, since mAP is a key indicator for measuring the performance of the target detection model, this embodiment uses Deformable DETR to detect the test set before and after combining different channel attention mechanisms. The results are shown in Figures 5 (a) to 5 (g) and Table 2. Among them, Figure 5 (a) is the original image of an airport in the test set, and the boxes in the figure are all foreign objects in the airport. Figure 5 (b) is the detection result of foreign object detection on the airport image of Figure 5 (a) by the original DeformableDETR, Figure 5 (c) is the detection result of foreign object detection on the airport image of Figure 5 (a) after Deformable DETR combined with MDDC, Figure 5 (d) is the detection result of foreign object detection on the airport image of Figure 5 (a) after Deformable DETR combined with SE, Figure 5 (e) is the detection result of foreign object detection on the airport image of Figure 5 (a) after Deformable DETR combined with ECA, Figure 5 (f) is the detection result of foreign object detection on the airport image of Figure 5 (a) after Deformable DETR combined with CBAM, and Figure 5 (g) is the detection result of foreign object detection on the airport image of Figure 5 (a) after Deformable DETR combined with CA. In Figure 5 (a) to Figure 5 (g), "insect" indicates that the identified category is an insect, and the percentage next to it indicates the probability that the target is identified as an insect. Table 2 shows the test set indicators of Deformable DETR combined with different channel attention mechanisms. From Figure 5 (a) to Figure 5 (g) and Table 2, it can be seen that under the premise of consistent parameters, the detection performance of Deformable DETR is improved after combining the MDDC algorithm.
[0177] Table 1
[0178]
[0179] Table 2
[0180]
[0181] This embodiment uses the Deformable DETR model to detect foreign objects on the runway. The significant advantage is that it does not require cumbersome manual component design and is easy to integrate quickly. This model not only has excellent detection accuracy, but also has a simple architecture and can be flexibly deployed in most detection systems. In addition, this embodiment describes in detail the steps of multi-dimensional decomposition of feature vectors, implementation of deformable spatial attention calculations, channel attention calculations, and feature weighting and shape alignment. This series of refined processing effectively enhances the weight of target features, thereby greatly improving the detection performance of the model and ensuring efficient and accurate foreign object detection capabilities.
[0182] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0183] Based on the same inventive concept, the embodiment of the present application also provides an optical image foreign object detection device based on an end-to-end deep network for implementing the optical image foreign object detection method based on an end-to-end deep network involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the optical image foreign object detection device based on an end-to-end deep network provided below can refer to the limitations of the optical image foreign object detection method based on an end-to-end deep network above, and will not be repeated here.
[0184] In one embodiment, Figure 6 As shown, an optical image foreign object detection device 600 based on an end-to-end deep network is provided, comprising: a feature vector compression module 610, a spatial attention weight calculation module 620, a feature vector global pooling module 630, a channel attention weight calculation module 640, a weighted feature map generation module 650 and an optical image airport foreign object detection module 660, wherein:
[0185] The feature vector compression module 610 is used to extract feature vectors from the input feature map of the optical image; compress the feature vectors along different dimensional directions to obtain feature planes in each dimensional direction.
[0186] The spatial attention weight calculation module 620 is used to calculate the spatial offset of each feature plane according to the convolution kernel parameters of the offset generation network; based on each spatial offset, deformable convolution is performed on each feature plane to obtain the spatial attention weight of each feature plane.
[0187] The feature vector global pooling module 630 is used to perform global pooling on the feature vector to obtain channel information statistics.
[0188] The channel attention weight calculation module 640 is used to perform nonlinear transformation on the channel information statistics after dimensionality reduction using the ReLU activation function; input the channel information statistics after dimensionality reduction into the second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels; and use the sigmoid activation function to map the channel information statistics restored to the original number of channels to between 0 and 1 to generate the channel attention weight of each channel.
[0189] The weighted feature map generation module 650 is used to weight the spatial attention weights of each feature plane and the channel attention weights of each channel to the feature vector to obtain the attention vectors in different dimensional directions; and perform shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map.
[0190] The optical image airport foreign object detection module 660 is used to obtain the optical image airport foreign object detection result according to the weighted feature map.
[0191] In one embodiment, the feature vector compression module 610 includes a feature vector extraction unit and a channel alignment unit, wherein:
[0192] The feature vector extraction unit is used to extract feature vectors of different scales from the input feature map.
[0193] The channel alignment unit is used to perform channel alignment processing on feature vectors of different scales.
[0194] In one embodiment, the feature vector compression module 610 further includes a height direction compression unit and a width direction compression unit, wherein:
[0195] The height direction compression unit is used to compress the feature vector along the height dimension direction to obtain the first feature plane in the height dimension direction.
[0196] The width direction compression unit is used to compress the feature vector along the width dimension to obtain a second feature plane in the width dimension.
[0197] In one embodiment, the feature vector global pooling module 630 further includes a global average pooling unit, wherein:
[0198] The global average pooling unit is used to perform global average pooling on the feature vector to obtain channel information statistics.
[0199] In one embodiment, the spatial attention weight calculation module 620 includes an initial offset calculation unit and a spatial offset calculation unit, wherein:
[0200] An initial offset calculation unit, used to calculate the initial offset of the feature plane according to the convolution kernel parameters of the offset generation network;
[0201] The spatial offset calculation unit is used to perform bilinear interpolation on the initial offset to obtain the spatial offset of the feature plane.
[0202] Each module in the optical image foreign object detection device 600 based on end-to-end deep network can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0203] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting foreign objects in an optical image based on an end-to-end deep network is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the computer device, or an external keyboard, touchpad or mouse.
[0204] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0205] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0206] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0207] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0208] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0209] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0210] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting foreign objects in optical images based on an end-to-end deep network, characterized in that: The method comprises: Step S1, extracting a feature vector from an input feature map of an optical image; Step S2, compressing the feature vector along different dimensional directions to obtain feature planes in each dimensional direction; Step S3, respectively calculating the spatial offset of each of the feature planes according to the convolution kernel parameters of the offset generation network; Step S4, performing deformable convolution on each of the feature planes based on each of the spatial offsets to obtain a spatial attention weight of each of the feature planes; Step S5, performing global pooling on the feature vector to obtain channel information statistics; Step S6, inputting the channel information statistics into a first fully connected layer, and the first fully connected layer outputs the channel information statistics after dimension reduction; Step S7, using a ReLU activation function to perform a nonlinear transformation on the channel information statistics after dimension reduction; Step S8, inputting the channel information statistics obtained in step S7 into a second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels; Step S9, mapping the channel information statistic obtained in step S8 to between 0 and 1 using a sigmoid activation function to generate a channel attention weight for each channel; Step S10, weighting the spatial attention weights of each feature plane and the channel attention weight of each channel to the feature vector to obtain attention vectors in different dimensional directions; Step S11, performing shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map; Step S12, obtaining the optical image airport foreign object detection result according to the weighted feature map.
2. The optical image foreign object detection method based on end-to-end deep network according to claim 1 is characterized in that: The step S1 comprises: Step S110, extracting feature vectors of different scales from the input feature map; Step S120: performing channel alignment processing on the feature vectors of different scales.
3. The optical image foreign object detection method based on end-to-end deep network according to claim 1 is characterized in that: The step S2 comprises: Step S21, compressing the feature vector along the height dimension direction to obtain a first feature plane in the height dimension direction; the expression of the first feature plane is: ; In the formula, represents the first feature plane, H represents the height of the input feature map, represents the eigenvalue of the i-th row and j-th column in the eigenvector; Step S22, compressing the feature vector along the width dimension to obtain a second feature plane in the width dimension; the expression of the second feature plane is: ; In the formula, represents the second feature plane, and W represents the width of the input feature map.
4. The method according to claim 1, characterized in that: The step S5 comprises: Step S51, performing global average pooling on the feature vector to obtain the channel information statistic; the expression of the channel information statistic is: ; In the formula, represents the channel information statistic.
5. The method according to claim 1, characterized in that The first fully connected layer and the second fully connected layer are both 1×1 convolutional layers.
6. The optical image foreign object detection method based on end-to-end deep network according to claim 1 is characterized in that: The step S3 comprises: Step S31, calculating the initial offset of the feature plane according to the convolution kernel parameters of the offset generation network; Step S32: performing bilinear interpolation on the initial offset to obtain the spatial offset of the feature plane.
7. An optical image foreign object detection device based on an end-to-end deep network, characterized in that: The device comprises: A feature vector compression module is used to extract feature vectors from an input feature map of an optical image; compress the feature vectors along different dimensional directions to obtain feature planes in each dimensional direction; A spatial attention weight calculation module, used to calculate the spatial offset of each of the feature planes according to the convolution kernel parameters of the offset generation network; and perform deformable convolution on each of the feature planes based on each of the spatial offsets to obtain the spatial attention weight of each of the feature planes; A feature vector global pooling module, used to perform global pooling on the feature vector to obtain channel information statistics; A channel attention weight calculation module is used to perform a nonlinear transformation on the channel information statistics after dimensionality reduction using a ReLU activation function; input the channel information statistics after dimensionality reduction into a second fully connected layer, and the second fully connected layer restores the dimension of the channel information statistics to the original number of channels; and map the channel information statistics restored to the original number of channels to between 0 and 1 using a sigmoid activation function to generate a channel attention weight for each channel; A weighted feature map generation module is used to weight the spatial attention weights of each feature plane and the channel attention weights of each channel to the feature vector to obtain attention vectors in different dimensional directions; and to perform shape alignment on the attention vectors in different dimensional directions to obtain a weighted feature map; The optical image airport foreign object detection module is used to obtain the optical image airport foreign object detection result according to the weighted feature map.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
