A method and device for lightweight remote sensing image target detection network
By applying the channel attention algorithm and training optimization to the remote sensing image target detection network, a lightweight network is constructed, which solves the problem of excessive computation and parameter quantity in the remote sensing image target detection model and enables effective deployment on resource-constrained devices.
Patent Information
- Application Number
- CN202310161745.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-02-23
AI Technical Summary
Existing remote sensing image target detection models have excessive computational and parameter requirements, making them unsuitable for deployment on resource-constrained devices.
By employing a channel attention algorithm, important feature channels in the remote sensing image target detection network are preserved, a lightweight target detection network is constructed, and Manhattan distance and cross-entropy are used for training and optimization.
It reduces the number of model parameters and computational load while maintaining detection accuracy, making it suitable for resource-constrained devices.
Smart Images

Figure CN116129270B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of remote sensing image detection, and particularly relates to a method and device for lightweight remote sensing image target detection network. BACKGROUND
[0002] With the development of science and technology, deep learning methods have a wide range of applications in the field of remote sensing image target detection. However, most of the target detection models with strong detection capabilities currently have quite high computational load and model parameter quantity, which cannot meet the needs of deployment on resource-limited devices such as satellites and aircrafts. Therefore, it is necessary to construct a lightweight network structure to reduce the parameter quantity and computational load of the neural network in the target detection model while maintaining the detection accuracy of the target detection model as much as possible. SUMMARY
[0003] The present application provides a method and device for lightweight remote sensing image target detection network. By performing lightweight processing on the remote sensing image target detection algorithm, important feature channels are retained, thereby constructing a lightweight target detection network for remote sensing images.
[0004] In a first aspect, the present application provides a method for lightweight remote sensing image target detection network, which comprises the following steps:
[0005] Based on the first target detection network for remote sensing images and the channel attention algorithm, a channel attention weight of at least one channel in the first target detection network is obtained, and the channel attention weight is used to indicate the importance of the corresponding channel to the first target detection network.
[0006] Channels in which the channel attention weight of at least one channel meets a preset condition are taken as reserved channels.
[0007] Based on the reserved channels, a second target detection network is obtained, which is the result of lightweight processing of the first target detection network.
[0008] Optionally, the preset condition comprises: greater than or equal to a preset weight threshold.
[0009] Optionally, taking the channels in which the channel attention weight of at least one channel meets the preset condition as the reserved channels comprises:
[0010] The channel attention weights of at least one channel are sorted in descending order to obtain a channel attention weight sequence.
[0011] The first N channels in the channel attention weight sequence are taken as the reserved channels, where N is the absolute value of the product of the preset proportion of the reserved channels in the total number of channels and the total number of channels, or N is the preset number of the reserved channels.
[0012] Optionally, the method further comprises:
[0013] training the second target detection network to obtain a third target detection network, the third target detection network being used for target detection on the remote sensing image.
[0014] Optionally, the training of the second target detection network comprises:
[0015] training the second target detection network based on the channel attention weight of the reserved channel.
[0016] Optionally, the training of the second target detection network comprises:
[0017] training the second target detection network based on the Manhattan distance of the first target detection network and the second target detection network.
[0018] Optionally, the process of calculating the Manhattan distance of the first target detection network and the second target detection network comprises:
[0019] obtaining a complex spatial attention map of the first target detection network and a first feature pyramid map, and obtaining a lightweight spatial attention map of the second target detection network and a second feature pyramid map;
[0020] obtaining the Manhattan distance of the first target detection network and the second target detection network based on the complex spatial attention map, the first feature pyramid map, the lightweight spatial attention map and the second feature pyramid map.
[0021] Optionally, the training of the second target detection network comprises:
[0022] training the second target detection network based on the cross-entropy of the first target detection network and the second target detection network.
[0023] Optionally, the process of calculating the cross-entropy of the first target detection network and the second target detection network comprises:
[0024] obtaining a first feature pyramid map of the first target detection network and a second feature pyramid map of the second target detection network;
[0025] performing classification and positioning output and Softmax function conversion on the first feature pyramid map in sequence to obtain a first soft label, and performing classification and positioning output and Softmax function conversion on the second feature pyramid map in sequence to obtain a second soft label;
[0026] calculating the first soft label and the second soft label by using a cross-entropy loss function to obtain the cross-entropy of the first target detection network and the second target detection network.
[0027] In a second aspect, the present application provides a device for lightweight remote sensing image target detection network, the device comprising:
[0028] a first obtaining unit configured to obtain channel attention weights of at least one channel in the first target detection network based on a first target detection network of a remote sensing image and a channel attention algorithm, the channel attention weights being used to indicate the importance of the corresponding channel to the first target detection network;
[0029] a first processing unit configured to take channels in which the channel attention weights of the at least one channel meet preset conditions as reserved channels;
[0030] a second obtaining unit configured to obtain a second target detection network based on the reserved channels, the second target detection network being a result of lightweighting the first target detection network.
[0031] Optionally, the first processing unit is specifically configured to:
[0032] sort the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence;
[0033] take the first N channels in the channel attention weight sequence as the reserved channels, the N being an absolute value of a product of a preset proportion of the reserved channels in a total number of channels and the total number of channels, or the N being a preset number of the reserved channels.
[0034] Optionally, the device further comprises:
[0035] a second processing unit configured to train the second target detection network to obtain a third target detection network, the third target detection network being used for target detection on a remote sensing image.
[0036] Optionally, the second processing unit specifically comprises:
[0037] training the second target detection network based on the channel attention weights of the reserved channels.
[0038] Optionally, the second processing unit specifically comprises:
[0039] training the second target detection network based on a Manhattan distance between the first target detection network and the second target detection network.
[0040] Optionally, the second processing unit specifically comprises:
[0041] training the second target detection network based on a cross-entropy between the first target detection network and the second target detection network.
[0042] In a third aspect, the present application provides a device for lightweight remote sensing image target detection network, the device comprising a memory and a processor:
[0043] The memory is configured to store the computer program.
[0044] The processor is configured to execute the method provided by the first aspect according to the computer program.
[0045] In a fourth aspect, the present application further provides a computer readable storage medium configured to store a computer program, the computer program being configured to execute the method provided by the first aspect.
[0046] Therefore, the present application has the following beneficial effects:
[0047] The present application provides a method and device for lightweight remote sensing image target detection network, based on a first target detection network of remote sensing image and a channel attention algorithm, obtaining the channel attention weight of at least one channel in the first target detection network, then taking the channel in which the channel attention weight of at least one channel meets the preset condition as a reserved channel, and finally, based on the reserved channel, a second target detection network of the first target detection network is obtained. In this process, the channel attention algorithm is used to retain important feature channels and delete unimportant feature channels, thereby constructing a lightweight target detection network for target detection of remote sensing images, so as to maximize the inheritance of the existing remote sensing image target detection method knowledge. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0049] Figure 1 A flowchart of a method for lightweight remote sensing image target detection network in an embodiment of the present application;
[0050] Figure 2 A flowchart of an embodiment of a method for lightweight remote sensing image target detection network in an embodiment of the present application;
[0051] Figure 3 A structural diagram of a device 300 for lightweight remote sensing image target detection network in an embodiment of the present application;
[0052] Figure 4 A structural diagram of a device 400 for lightweight remote sensing image target detection network in an embodiment of the present application. DETAILED DESCRIPTION
[0053] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of the present application.
[0054] The "first" in the names such as "first target detection network" and "first feature pyramid graph" mentioned in the embodiments of the present application is only used for name identification, and does not represent the first in order. The same rule applies to "second", "third", and the like.
[0055] At present, a network is usually simplified and constructed to make a complex network lightweight, for example, a deep separable convolution is used to replace a general convolution layer, and the number of convolution kernels and output features is separated, so as to reduce the parameter quantity and the calculation amount of the network. However, the lightweight network constructed by the current simplified design is not simplified based on a remote sensing image target detection network, so it cannot inherit the existing remote sensing image target detection method knowledge to the greatest extent.
[0056] In the embodiments of the present application, the channel attention mechanism is used to prune and lightweight the remote sensing image target detection network, and important feature channels are retained, so as to obtain a lightweight target detection network. For example, the method can include the following steps: based on a first target detection network of a remote sensing image and a channel attention algorithm, obtaining channel attention weights of at least one channel in the first target detection network, taking channels in which the channel attention weights meet a preset condition as reserved channels, and finally, based on the reserved channels, obtaining a second target detection network, which is a lightweight result of the first target detection network. It can be seen that the second target detection network obtained by the method provided in the present application can inherit the first target detection method knowledge of the remote sensing image to a certain extent, and the parameter quantity and the calculation amount required by the second target detection network are reduced compared with the first target detection network, which meets the demand of lightweight network.
[0057] To facilitate understanding of the specific implementation of the method for lightweight remote sensing image target detection network provided in the embodiments of the present application, the following will be described with reference to the accompanying drawings.
[0058] It should be noted that the subject implementing the method of the lightweight remote sensing image target detection network can be the lightweight remote sensing image target detection network device provided by the embodiments of the present application, and the lightweight remote sensing image target detection network device can be carried in an electronic device or a functional module of an electronic device. The lightweight remote sensing image target detection network device in the embodiments of the present application can be any device capable of implementing the method of the lightweight remote sensing image target detection network in the embodiments of the present application, for example, it can be an Internet of Things (IoT) device.
[0059] Figure 1 A flowchart of a method of a lightweight remote sensing image target detection network provided by the embodiments of the present application. The method can be applied to a lightweight remote sensing image target detection network device, which can be, for example, a lightweight remote sensing image target detection network device 300 as shown in Figure 3 The lightweight remote sensing image target detection network device can also be integrated into a functional module in an electronic device, for example, it can be integrated into a functional module in a lightweight remote sensing image target detection network device 400 as shown in Figure 4
[0060] As shown in Figure 1 The method comprises the following S101-S103:
[0061] S101: Based on the first target detection network of the remote sensing image and the channel attention algorithm, obtain the channel attention weight of at least one channel in the first target detection network, and the channel attention weight is used to indicate the importance of the corresponding channel to the first target detection network.
[0062] The first target detection network of the remote sensing image can be, for example, a target detection network with better detection performance in the remote sensing image.
[0063] In order to obtain the second target detection network of the lightweight first target detection network, first, based on the first target detection network of the remote sensing image and the channel attention algorithm, the channel attention weight of at least one channel in the first target detection network is obtained, then the channel attention weight of at least one channel is obtained. The channel that meets the preset condition is used as a reserved channel, and finally, based on the reserved channel, the second target detection network can be obtained. Therefore, the channel attention weight of at least one channel in the first target detection network is obtained by S101, which provides a precondition for determining the reserved channel.
[0064] As an example, S101 can include: adding a channel attention module after each convolution structure in the first target detection network, the channel attention module containing a calculation formula of channel attention, for extracting channel attention weights corresponding to a group of channels. Wherein, the size of the channel attention weight value represents the size of the channel attention, and the channel with large channel attention is more important to the first target detection network.
[0065] S102: Taking a channel in which the channel attention weight meets a preset condition as a reserved channel.
[0066] When the channel attention of a channel meets the preset condition, the channel can be taken as a reserved channel.
[0067] As an example, the preset condition can include: greater than or equal to a preset weight threshold. S102 may, for example, include: determining, from the channels, a channel whose channel attention weight is greater than or equal to a preset weight threshold, as the reserved channel.
[0068] As an example, the preset condition can include: the top N channels with the largest channel attention weights. Wherein, N can be a product of a preset proportion of reserved channels in the total number of channels and the total number of channels, for example, the preset proportion is 70%, then N can be 70% of the total number of channels, and the preset condition includes the top (70%*total number of channels) channels with the largest channel attention weights; or N can be a preset number of reserved channels, for example, the preset number is 5, then N can be 5, and the preset condition includes the top 5 channels with the largest channel attention weights. S102 can include: first, sorting the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence; and then, taking the top N channels in the channel attention weight sequence as the reserved channels.
[0069] S103: Obtaining a second target detection network based on the reserved channels, the second target detection network being a result of lightening the first target detection network.
[0070] The reserved channels of the first target detection network are reserved, and the remaining channels are deleted, and finally, the second target detection network is constructed from the reserved channels, wherein the second target detection network is a lightened result of the first target detection network.
[0071] After obtaining the second target detection network, in order to improve the accuracy of the lightened target detection network in target detection of a remote sensing image, the second target detection network can be further trained to obtain a third target detection network, the third target detection network being used for target detection of a remote sensing image.
[0072] As an example, the parameters trained for the second target detection network can include channel attention weights of reserved channels.
[0073] As an example, when the second target detection network is trained, the loss thereof can include a Manhattan distance of the first target detection network and the second target detection network and a cross-entropy of the first target detection network and the second target detection network. That is, the parameters in the second target detection network are adjusted based on the Manhattan distance of the first target detection network and the second target detection network and the cross-entropy of the first target detection network and the second target detection network.
[0074] The calculation process of the Manhattan distance of the first target detection network and the second target detection network can include obtaining a complex spatial attention map of the first target detection network and a first feature pyramid map, obtaining a lightweight spatial attention map of the second target detection network and a second feature pyramid map, and obtaining the Manhattan distance of the first target detection network and the second target detection network based on the complex spatial attention map, the first feature pyramid map, the lightweight spatial attention map and the second feature pyramid map.
[0075] The calculation process of the cross-entropy of the first target detection network and the second target detection network can include obtaining a first feature pyramid map of the first target detection network and a second feature pyramid map of the second target detection network, sequentially performing classification positioning output and Softmax function conversion on the first feature pyramid map to obtain a first soft label, and sequentially performing classification positioning output and Softmax function conversion on the second feature pyramid map to obtain a second soft label, and calculating the first soft label and the second soft label by using a cross-entropy loss function to obtain the cross-entropy of the first target detection network and the second target detection network.
[0076] The finally obtained third target detection network is the trained second target detection network, which improves the detection accuracy of the detection network and enhances the detection capability.
[0077] It can be seen that, by using the attention mechanism, the sparse network is realized. Firstly, the channel attention algorithm is used to calculate the first target detection network to obtain the channel attention weights of each channel. Then, the channels with channel attention weights meeting the preset condition are taken as the reserved channels. Finally, the second target detection network is constructed based on the reserved channels. The complex first target detection network is designed to be lightweight by using the structural pruning, and the obtained second target detection network reduces the parameter quantity and the calculation quantity of the target detection model.
[0078] In order to make the method provided by the embodiments of the present application clearer and easier to understand, the following will be described in combination with Figure 2 One specific example of the method is described.
[0079] S201: Obtain a channel attention weight of at least one channel in the target detection network 1 based on a target detection network 1 and a channel attention algorithm of a remote sensing image, the channel attention weight being used to indicate an importance of the corresponding channel to the target detection network 1.
[0080] The target detection network 1 is a target detection network with good detection capability in a remote sensing image, and can also be the first target detection network in the above method.
[0081] As an example, S201 can include adding a channel attention module after each convolution structure of the target detection network 1 to obtain the channel attention weight, the channel attention module including a channel attention algorithm, and the channel attention can be calculated by using the following formula (1):
[0082]
[0083] wherein X is a feature map of the target detection network 1, Max is a global average pooling operation, F1 and F2 are fully connected layers of the target detection network 1, and S is a channel attention weight corresponding to each channel.
[0084] S202: Sort the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence.
[0085] In order to perform pruning operation on the target detection network 1 to obtain a lightweight target detection network 1, the channel attention weights need to be sorted, and a threshold value is set in advance according to the required number of channels.
[0086] S203: The channels in the channel attention weight sequence that are greater than or equal to the preset threshold value are reserved channels.
[0087] As an example, S203 can include: if 75% of the channels in the target detection network 1 need to be reserved, the threshold value is set to be less than the channel attention weight of the 75th channel in the total channel number in the channel attention weight sequence, and greater than any value in the numerical range of the channel attention weight of another channel adjacent to the 75th channel in the total channel number in the channel attention weight sequence, the channel attention weight of the channel greater than the threshold value is reserved by the target detection network 1, and the channel less than the threshold value is deleted from the target detection network 1.
[0088] S204: Obtain a target detection network 2 based on the reserved channels, the target detection network 2 being a result of lightweight of the target detection network 1.
[0089] The target detection network 2 may be the second target detection network in the method described above, and the channel attention weight of the reserved channel is selected as the pre-training parameter of the constructed target detection network 2.
[0090] S205: Obtain the complex spatial attention map and the feature pyramid of the target detection network 1 Figure 1 , obtain the light spatial attention map and the feature pyramid of the target detection network 2 Figure 2 .
[0091] As an example, S205 may include: S2051, extracting the feature pyramid Figure 1 F teacher_n in the target detection network 1 and the feature pyramid Figure 2 F student_n in the target detection network 2 respectively, wherein n is the number of feature layers, in the embodiment of the present application, the target detection network 1 is a prompt layer, and the target detection network 2 is a guided layer, the feature pyramid Figure 1 may be the first feature pyramid in the method described above, and the feature pyramid Figure 2 may be the second feature pyramid in the method described above; S2052, obtaining the complex spatial attention map and the light spatial attention map respectively according to the feature pyramid Figure 1 and the feature pyramid Figure 2 , wherein the formula (2) and the formula (3) may be used to obtain the complex spatial attention map and the light spatial attention map respectively:
[0092] C n =LRelu(conv 3×3 (Avg C (F n ))) formula (2)
[0093]
[0094] wherein F n is the feature pyramid Figure 1 or the feature pyramid Figure 2 , Avg C is the channel dimension average pooling, conv 3×3 is the convolution kernel 3x3 convolution, the length and width dimensions of the feature pyramid are kept unchanged, and the complex attention map and the light spatial attention map are obtained through the activation function LRelu(x) respectively.
[0095] S206: Obtain the Manhattan distance of the target detection network 1 and the target detection network 2 based on the complex spatial attention map, the feature pyramid Figure 1 , the light spatial attention map and the feature pyramid Figure 2 .
[0096] In order to constrain the feature pyramid graph and the spatial attention graph of the feature pyramid graph of the target detection network 2 by using the Manhattan distance, the Manhattan distance needs to be added as a feature metric constraint in the training of the target detection network 2, so that the feature migration of the target detection network 1 to the target detection network 2 can be realized.
[0097] As an example, S206 can include: constraining the feature pyramid graph and the spatial attention graph of the feature pyramid graph by using the Manhattan distance I fd , which can be obtained by, for example, formula (4):
[0098] I fd =||C teacher_n ,C student_n ||1+||F teacher_n ,F student_n ||2,n=1,2… Formula (4)
[0099] S207: sequentially performing classification positioning output and Softmax function conversion on the feature pyramid Figure 1 to obtain soft label 1, and sequentially performing classification positioning output and Softmax function conversion on the feature pyramid Figure 2 to obtain soft label 2.
[0100] As an example, S207 can include: sequentially performing classification positioning output on the feature pyramid Figure 1 and the feature pyramid Figure 2 , and then converting them into soft label 1 and soft label 2 respectively by using the Softmax function, wherein the soft label 1 can be, for example, the first soft label in the above method, and the soft label 2 can be, for example, the second soft label in the above method.
[0101] S208: calculating the cross-entropy of the target detection network 1 and the target detection network 2 by using the cross-entropy loss function on the soft label 1 and the soft label 2.
[0102] As an example, S208 can include: calculating the cross-entropy of the target detection network 1 and the target detection network 2 by substituting the soft label 1 and the soft label 2 into the cross-entropy loss function, wherein the cross-entropy L lr can be obtained by, for example, formula (5) and formula (6):
[0103]
[0104]
[0105] wherein, is the artificial labeling position of the i-th candidate region of the classification label, is the predicted position of the i-th candidate region of the classification label, is the soft label 1 of the target detection network 1 for the i-th candidate region of the classification label, is the soft label 2 of the target detection network 1 for the i-th candidate region of the classification label. T is a temperature coefficient, which controls the smoothing degree of the soft label. label is the classification positioning output of the target detection network 1 or the target detection network 2.
[0106] S209: Based on the Manhattan distance of the target detection network 1 and the target detection network 2 and the cross entropy of the target detection network 1 and the target detection network 2, the target detection network 2 is trained to obtain a target detection network 3, which is used for target detection of a remote sensing image.
[0107] The obtained Manhattan distance and cross entropy are used to train the target detection network 2, so that a trained target detection network 3 is obtained. The target detection network 3 inherits the knowledge of the existing remote sensing image target detection method to a certain extent, and also improves the target detection capability through training. The target detection network 3 may be, for example, the third target detection network in the above method.
[0108] The embodiment of the present application provides a method for lightweight remote sensing image target detection network. First, based on an original target detection network 1 and a channel attention algorithm, channel attention weights of at least one channel in the target detection network 1 are obtained. Then, the channel attention weights are sorted in descending order to obtain a channel attention weight sequence. Next, channels in the channel attention weight sequence that are greater than or equal to a preset threshold are selected as reserved channels. Finally, based on the reserved channels, a target detection network 2 is obtained. In addition, the Manhattan distance of the target detection network 1 and the target detection network 2 and the cross entropy of the target detection network 1 and the target detection network 2 are obtained through corresponding algorithms. The Manhattan distance and the cross entropy are used as losses of the target detection network 2 to train the target detection network 2, so that a trained target detection network 3 is obtained.
[0109] In this process, the target detection network 1 is pruned and lightweighted using the attention mechanism, so that important feature channels are retained. The target detection network 2 can inherit the method knowledge of the target detection network to a certain extent. The target detection network 2 learns the intermediate layer features in the target detection network 1, and uses the output probability distribution of the target detection network 1 to constrain the output probability distribution of the target detection network 2, so as to improve the detection capability of the target detection network 2.
[0110] Referring to Figure 3 The embodiment of the present application provides a lightweight remote sensing target detection network device 300, which comprises:
[0111] The first obtaining unit 301 is configured to obtain a channel attention weight of at least one channel in the first target detection network based on a first target detection network of a remote sensing image and a channel attention algorithm, and the channel attention weight is used to indicate an importance of the corresponding channel to the first target detection network.
[0112] The first processing unit 302 is configured to take a channel in which the channel attention weight of the at least one channel meets a preset condition as a reserved channel.
[0113] The second obtaining unit 303 is configured to obtain a second target detection network based on the reserved channel, and the second target detection network is a result of lightening the first target detection network.
[0114] Optionally, the first processing unit 302 is specifically configured to:
[0115] sort the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence;
[0116] take the first N channels in the channel attention weight sequence as the reserved channel, where N is an absolute value of a product of a preset proportion of the reserved channel in a total number of channels and the total number of channels, or N is a preset number of the reserved channel.
[0117] Optionally, the apparatus 300 further includes:
[0118] The second processing unit is configured to train the second target detection network to obtain a third target detection network, and the third target detection network is used for target detection on a remote sensing image.
[0119] Optionally, the second processing unit specifically includes:
[0120] training the second target detection network based on the channel attention weight of the reserved channel.
[0121] Optionally, the second processing unit specifically includes:
[0122] training the second target detection network based on a Manhattan distance between the first target detection network and the second target detection network.
[0123] Optionally, the second processing unit specifically includes:
[0124] training the second target detection network based on a cross-entropy between the first target detection network and the second target detection network.
[0125] Embodiments of the present application also provide a device 400 for lightening a remote sensing image target detection network, as shown in Figure 4 The device 400 includes a memory 401 and a processor 402:
[0126] The memory 401 is configured to store a computer program.
[0127] The processor 402 is configured to execute the above-mentioned Figure 1 or Figure 2 provided method according to the computer program.
[0128] In addition, the present application further provides a computer readable storage medium, which is configured to store a computer program, and the computer program is configured to execute Figure 1 or Figure 2 provided method.
[0129] From the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus a universal hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network communication device such as a router) execute the methods described in various embodiments or some parts of the embodiments.
[0130] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the device embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments. The above-described device embodiments are only illustrative, and the modules described as separate components can be or can not be physically separated, and the components shown as modules can be or can not be physical modules, which can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the object of the present embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0131] The above description is only the exemplary embodiments of the present application, and is not used to limit the protection scope of the present application.
Claims
1. A method for lightweight remote sensing image object detection network, characterized in that, The method comprises: a first target detection network based on a remote sensing image and a channel attention algorithm are used to obtain channel attention weights of at least one channel in the first target detection network, and the channel attention weights are used to indicate the importance of the corresponding channel to the first target detection network; channels in which the channel attention weights meet preset conditions are taken as reserved channels, and the preset conditions include being greater than or equal to a preset weight threshold; wherein the taking the channels in which the channel attention weights meet the preset conditions as the reserved channels comprises: sorting the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence; and taking the first N channels in the channel attention weight sequence as the reserved channels, where N is an absolute value of a product of a preset proportion of the reserved channels in a total number of channels and the total number of channels, or N is a preset number of the reserved channels; a second target detection network is obtained based on the reserved channels, and the second target detection network is a result of lightening the first target detection network; a third target detection network is obtained by training the second target detection network, and the third target detection network is used for target detection on a remote sensing image.
2. The method of claim 1, wherein, The training of the second target detection network comprises: training the second target detection network based on the channel attention weights of the reserved channels.
3. The method of claim 1, wherein, The training of the second target detection network comprises: training the second target detection network based on a Manhattan distance of the first target detection network and the second target detection network.
4. The method of claim 3, wherein, The Manhattan distance of the first target detection network and the second target detection network comprises: a complex spatial attention map and a first feature pyramid map of the first target detection network are obtained, and a light spatial attention map and a second feature pyramid map of the second target detection network are obtained; a Manhattan distance of the first target detection network and the second target detection network is obtained based on the complex spatial attention map, the first feature pyramid map, the light spatial attention map and the second feature pyramid map.
5. The method of claim 1, wherein, The training of the second target detection network comprises: training the second target detection network based on a cross-entropy of the first target detection network and the second target detection network.
6. The method of claim 5, wherein, The cross-entropy of the first target detection network and the second target detection network comprises: a first feature pyramid map of the first target detection network and a second feature pyramid map of the second target detection network are obtained; first soft labels are obtained by sequentially performing classification positioning output and Softmax function conversion on the first feature pyramid map, and second soft labels are obtained by sequentially performing classification positioning output and Softmax function conversion on the second feature pyramid map; the cross-entropy of the first target detection network and the second target detection network is obtained by calculating the first soft labels and the second soft labels by using a cross-entropy loss function.
7. An apparatus of a lightweight remote sensing image object detection network, characterized in that, The method comprises: The first obtaining unit is configured to obtain a channel attention weight of at least one channel in the first target detection network based on a first target detection network of a remote sensing image and a channel attention algorithm, and the channel attention weight is used to indicate an importance of the corresponding channel to the first target detection network. The first processing unit is configured to take a channel in which the channel attention weight meets a preset condition as a reserved channel, and the preset condition includes being greater than or equal to a preset weight threshold. The first processing unit is specifically configured to sort the channel attention weights of the at least one channel in descending order to obtain a channel attention weight sequence, and take the first N channels in the channel attention weight sequence as the reserved channels, where N is an absolute value of a product of a preset proportion of the reserved channels in a total number of channels and the total number of channels, or N is a preset number of the reserved channels. The second obtaining unit is configured to obtain a second target detection network based on the reserved channels, and the second target detection network is a result of lightening the first target detection network. The second processing unit is configured to train the second target detection network to obtain a third target detection network, and the third target detection network is used for target detection on a remote sensing image.
8. A device of a lightweight remote sensing image target detection network, characterized in that, The device includes a memory and a processor, and the processor is used to execute a program stored in the memory to run the method of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium is used to store a computer program, and the computer program is used to execute the method of any one of claims 1-6.
Citation Information
Patent Citations
Image tampering detection method and device, and equipment
CN114092477A
Character recognition network model training method, character recognition method, apparatuses, terminal, and computer storage medium therefor
WO2021115159A1