Unmanned aerial vehicle target detection model lightweight method based on pruning algorithm
By optimizing the drone target detection model through the pruning algorithm, the problem of high model calculation complexity in the drone platform is solved, and the effects of lightweight and real-time detection are achieved, which is suitable for resource-constrained drone equipment.
Patent Information
- Application Number
- CN202510621277.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-09-12
AI Technical Summary
Existing drone target detection models have insufficient accuracy and high computational complexity in complex background and multi-scale small target detection tasks, making it difficult to meet the real-time and lightweight requirements of drone platforms.
A lightweight method based on pruning algorithm is adopted to optimize the model through structured and unstructured pruning techniques, including sparse training, dependency group pruning, random pruning and layer adaptive amplitude pruning, to remove redundant parameters and structural units and generate a lightweight model.
It significantly reduces model size and computational overhead, improves operational efficiency during the inference phase, and is suitable for deployment on resource-constrained UAV devices. It meets the needs of real-time small target detection in high-altitude aerial photography, while maintaining detection accuracy and structural stability.
Smart Images

Figure CN120633743A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of model pruning algorithms, and in particular to a lightweight method for unmanned aerial vehicle target detection models based on a pruning algorithm. Background Art
[0002] With the widespread application of deep learning in object detection tasks, algorithms based on the YOLO family have gained widespread adoption in drone aerial photography target recognition due to their efficient detection performance. However, traditional YOLO algorithms often suffer from insufficient accuracy when detecting complex backgrounds and small objects of multiple scales. To address this issue, researchers have proposed various improvement strategies, such as introducing feature enhancement modules, improving network structures, and integrating contextual information, to enhance the algorithm's performance in small object detection scenarios.
[0003] In previous research, a proposal constructed the STUAV-YOLO network model by improving the YOLOv8 architecture and introducing an attention mechanism and feature extraction module suitable for small object detection scenarios. Experimental results show that the improved STUAV-YOLO model achieves significantly improved detection accuracy compared to the original YOLOv8 model on the VisDrone2019 drone aerial photography dataset, particularly for small object recognition in complex backgrounds and multi-object scenarios.
[0004] However, despite the significant improvement in accuracy, the STUAV-YOLO model also experienced a significant increase in structural complexity and computational load, resulting in a decrease in the model's inference speed, making it difficult to meet the real-time and lightweight requirements of target detection tasks during high-altitude flight. UAV platforms, constrained by processor performance, battery life, and payload capacity, often struggle to deploy high-computational deep learning models. This is particularly true in scenarios where maintaining a high frame rate (FPS) for continuous target tracking in dynamic environments requires redundant model parameters and structure, becoming a key bottleneck restricting deployment.
[0005] Therefore, how to compress the model structure, reduce computational complexity, and improve inference speed while ensuring detection accuracy has become a technical problem that needs to be solved in the current research on drone target detection algorithms. Summary of the Invention
[0006] The present invention performs parameter and structure pruning optimization on the STUAV-YOLO model, removing redundant and unimportant connections and weights in the neural network to improve the model's operating efficiency, making it more suitable for deployment on resource-constrained UAV equipment and achieving real-time and accurate high-altitude target detection tasks.
[0007] The present invention is achieved through the following technical solutions:
[0008] A lightweight method for UAV target detection model based on pruning algorithm includes the following steps:
[0009] S1, initial training model, obtains the benchmark model through parameterized training;
[0010] S2, sparse training, introduces a sparse factor into the baseline model, imposes sparsity constraints on model parameters, and generates a sparse weight distribution;
[0011] S3, model pruning, based on the weight distribution after sparse training, uses structured pruning and unstructured pruning methods to remove redundant parameters or structural units;
[0012] S4, model fine-tuning, retraining on the pruned sparse model and restoring model accuracy through parameter adjustment;
[0013] S5. Generate a lightweight model and output a compressed model that meets the target hardware resource constraints, balancing the number of parameters, computational complexity, and detection accuracy.
[0014] Furthermore, the initial training model trains the benchmark model through a parameter network architecture so that the model achieves the highest detection accuracy in an unpruned state, wherein the training parameters include batch size, image input size, and training cycle.
[0015] Furthermore, a sparse factor is introduced to impose regularization constraints on the model weights, and a linear attenuation strategy is used to adjust the sparse factor, gradually reducing the sparsification intensity according to the attenuation step size and attenuation rate.
[0016] Furthermore, the structured pruning in the model pruning includes:
[0017] Dependency group pruning analyzes the dependencies between layers in the model, groups layers with parameter coupling, and removes low-importance groups.
[0018] Furthermore, the unstructured pruning in the model pruning includes:
[0019] Random pruning, randomly selecting and zeroing weight parameters, keeping at least one parameter per layer to ensure network continuity;
[0020] Based on layer-adaptive amplitude pruning, the normalized importance score within the layer is calculated based on the square of the weight magnitude, and the weight with the lowest score in each layer is removed.
[0021] Furthermore, the dependency grouping and pruning includes identifying inter-layer dependency types, where the identified inter-layer dependency types include basic dependency, residual dependency, connection dependency, and reduction dependency;
[0022] The coupling relationship is recorded through a binary grouping matrix, the aggregate importance score is calculated based on the L2 norm of the parameters within the group, and a consistent structure sparse training strategy is adopted to ensure the structural consistency of the pruned model.
[0023] Furthermore, the random pruning randomly selects convolution kernels or weight parameters in the convolution layer and sets them to zero, retaining at least one weight or convolution kernel in each layer to ensure network continuity, and synchronously adjusts the input dimension of the fully connected layer according to the number of channels after pruning.
[0024] Furthermore, the layer-adaptive amplitude pruning sets the pruning ratio layer by layer according to the global sparsity requirement, ensuring the relative importance of the retained weights of each layer, and retraining the pruned model through the fine-tuning stage to restore the accuracy lost due to pruning.
[0025] Furthermore, the model fine-tuning includes retraining on the pruned model, using the same batch size and image input size as the original training stage; disabling the Mosaic enhancement strategy in data enhancement to reduce training complexity; and gradually restoring model performance through a sparse factor linear attenuation strategy.
[0026] A preferred method includes a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, any one of the above-mentioned methods for lightweighting a drone target detection model based on a pruning algorithm is implemented.
[0027] Beneficial effects of the present invention:
[0028] (1) This paper proposes a lightweight method for drone target detection models based on a pruning algorithm. By combining structured pruning with unstructured pruning, the method significantly reduces redundant parameters and invalid connections in the model. While maintaining the detection accuracy of the original model, the model size and computational overhead are greatly compressed, thereby improving the model's operating efficiency in the inference phase.
[0029] (2) The present invention proposes a lightweight method for drone target detection models based on a pruning algorithm. The pruned model has a lighter network structure and is suitable for deployment on embedded drone devices with limited computing power. It meets the requirements for lightweight and efficient models in practical applications and is particularly suitable for scenarios such as real-time small target detection in high-altitude aerial photography.
[0030] (3) The present invention proposes a lightweight method for drone target detection model based on pruning algorithm. By introducing a dependency group pruning strategy and combining coupling relationship identification with L2 norm aggregation importance scoring, it effectively avoids the damage to the integrity of the network structure during the pruning process and ensures the stability and trainability of the model structure after pruning.
[0031] (4) The present invention proposes a lightweight method for drone target detection models based on a pruning algorithm. This method adopts a parallel design of random pruning and layer-based adaptive amplitude pruning. The pruning ratio is adaptively determined according to the weight importance of each layer to avoid excessive compression that causes a sudden drop in model performance. At the same time, the adaptability of the pruning strategy to different network hierarchies is improved.
[0032] (5) The present invention proposes a lightweight method for UAV target detection model based on pruning algorithm, which imposes sparse constraints on model weights during the training phase and combines the linear attenuation strategy of the sparsity factor to make the pruning process gradual and smooth, effectively preventing the performance degradation problem caused by mutation pruning.
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] Figure 1 This is the overall flow chart of a lightweight method for UAV target detection model based on pruning algorithm proposed in this invention;
[0035] Figure 2 This is a schematic diagram of the dependencies occurring in different structures of the Lai group pruning algorithm of the lightweight method for drone target detection model based on the pruning algorithm proposed in the present invention;
[0036] Figure 3 This is a consistent structure sparse graph of a lightweight method for UAV target detection model based on pruning algorithm proposed in this invention;
[0037] Figure 4 This is a schematic diagram of a terminal device for a lightweight method for drone target detection model based on a pruning algorithm proposed in the present invention;
[0038] Figure 5 A schematic diagram of a readable storage medium for a lightweight method for UAV target detection model based on a pruning algorithm proposed in the present invention;
[0039] In the figure, 200 - terminal device, 210 - memory, 211 - RAM, 212 - cache memory, 213 - ROM, 214 - program / utility, 215 - program module, 220 - processor, 230 - bus, 240 - external device, 250 - I / O interface, 260 - network adapter, 300 - program product. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.
[0041] Example 1
[0042] refer to Figure 1 , this embodiment proposes a lightweight method for drone target detection model based on pruning algorithm, including the following steps:
[0043] 1. Initial training model: A baseline model is obtained through parameterized training. In this embodiment, a clear compression target is set for pruning as a pruning plan before training the baseline model. The pruning rate speed up is selected as 2.0, 3.0, and 4.0, that is, the model is compressed to 1 / 2, 1 / 3, and 1 / 4 of the original model. The specific formula for the pruning rate speed up is as follows:
[0044]
[0045] GFLOPs stands for floating-point operations per second, or billion floating-point operations per second, and is used to measure the computational complexity of the model. The higher the GFLOPs, the more computationally intensive tasks the model needs to handle, such as feature extraction and prediction, which is directly related to the complexity, speed, and possible accuracy of the model. Lower GFLOPs means fewer operations, which usually results in faster speed and lower power consumption; higher GFLOPs may provide better accuracy but increase resource consumption. before Indicates the number of floating-point operations before model pruning, GFLOPs after Indicates the number of floating-point operations after model pruning.
[0046] In this embodiment, the batch size is set to 16, the image input size is set to 640×640, the training cycle is set to 300, and the specific pruning parameter settings are shown in Table 1.
[0047]
[0048] Table 1 Pruning parameter settings
[0049] 2. Sparse training: A sparse factor is introduced into the baseline model to impose sparsity constraints on the model parameters and generate a sparse weight distribution. The initial value of the sparse factor in this embodiment is 0.0005. A linear attenuation strategy is used to adjust the sparse factor with an attenuation step of 10 and an attenuation rate of 0.1, gradually reducing the sparsification intensity.
[0050] 3. Model pruning: Based on the weight distribution after sparse training, structured pruning and unstructured pruning methods are used to remove redundant parameters or structural units;
[0051] In this embodiment, the random pruning algorithm, the layer adaptive amplitude (LAMP) based pruning algorithm, and the network slimming pruning algorithm are used for pruning strategy and implementation. Specifically:
[0052] (1) As a method of model compression, the core of the random pruning algorithm is to reduce the number of model parameters by randomly selecting weights and setting them to zero, without relying on the importance of weights. This can be done directly by modifying the weight matrix or using the pruning tools in the existing deep learning framework.
[0053] This method uses random numbers as an indicator to measure the importance of convolution kernels to achieve random pruning of convolution kernels. The convolution layer is pruned according to the value of each convolution kernel, and the convolution kernels with smaller value are pruned to complete the pruning of the convolution layer. The reference formula is as follows:
[0054] value = random(0,1)
[0055] During pruning, the model layers must be restricted, retaining at least one convolution kernel per layer to prevent the entire convolutional layer from being pruned, preventing forward data propagation. Once all convolutional layers have been pruned, the fully connected layer is modified based on the changes to the last convolutional layer and attached to the pruned convolutional layer to create a new classification model, completing the pruning operation.
[0056] The advantages of random pruning algorithms include: Simplicity and ease of implementation: Random pruning algorithms have low implementation complexity and are easy to understand and apply. For example, random pruning can be achieved by simply randomly selecting weights or neurons. Random pruning is easily applicable in many deep learning frameworks, such as PyTorch. Computational efficiency: Randomized algorithms typically have low computational complexity and can quickly generate results. On large datasets, they can significantly reduce computation time and resource consumption. Enhanced model generalization: Randomness can introduce model diversity, reduce overfitting, and enhance model generalization.
[0057] (2) The layer-adaptive amplitude-based pruning algorithm is an amplitude-based pruning method. It is an unstructured pruning method that prunes the model through a new method of calculating weights. The layer-adaptive amplitude-based pruning algorithm adopts layer-adaptive sparsity technology. By analyzing the sensitivity of each layer in the model, it determines which layers or neurons contribute less to the performance of the model, and then prunes these layers or neurons to achieve the purpose of optimizing the model.
[0058] This algorithm is not only applicable to large language models (LLMs), but is also applied to other types of neural network models, such as U-Net generators, to improve the model's inference speed and efficiency.
[0059] The layer-adaptive amplitude pruning algorithm aims to reduce the computational load and storage requirements of the model by removing redundant parameters in the model while maintaining the performance of the model as much as possible. Its specific principle is to calculate the square of the weight amplitude of the target connection and normalize it to the sum of the square weight amplitudes of all surviving weights in the same layer. The specific scoring formula is:
[0060]
[0061] Where W t represents the weight, W t [u] and W t [v] represents the W item mapped by index u, and u and v represent the index mapping corresponding to the weights after sorting in ascending order.
[0062] The LAMP score measures the relative importance of the target connection among all surviving connections in the same layer, and prunes the weights with the lowest LAMP score in each layer until the pruning requirements are met. This pruning method can ensure that at least one weight is retained in each layer, and the most important weights are retained at the same time. The pruning method is shown in the following formula.
[0063]
[0064] The main process of pruning based on layer adaptive amplitude is as follows: obtain the algorithm weight file of the improved target detection STUAV-YOLO model for initialization operation;
[0065] The LAMP score is obtained by calculating the square of the connection's weight magnitude and normalizing it to the sum of the squared weight magnitudes of all surviving weights in the same layer;
[0066] According to the LAMP score, the connection with the smaller score is selected, and according to the pre-set global sparsity requirement, the corresponding number of connections are selected for pruning;
[0067] Remove the selected connections from the model, i.e. set their weights to zero;
[0068] Retrain the pruned model to recover the performance that may have been lost during pruning;
[0069] Finally, evaluate the performance.
[0070] Advantages of the layer-adaptive amplitude pruning algorithm: By taking into account the characteristics of each layer's parameters, the LAMP algorithm can more finely adjust the model structure, thereby achieving a higher ratio of model compression; the LAMP algorithm can reduce the computational load and storage requirements while maintaining model performance, making the model more competitive in resource-constrained environments; the LAMP algorithm is relatively simple to implement and can be easily applied to various deep learning models, and has achieved satisfactory results in practice. On mobile devices or embedded systems, the LAMP algorithm can help reduce the model's storage space and computational workload, thereby improving the model's real-time performance and response speed; the LAMP algorithm can also be used to deploy large-scale deep learning models in cloud environments, improving the model's training efficiency and inference speed through pruning optimization.
[0071] (3) The dependency group pruning algorithm is a pruning method for graph structured data. It is mainly used to reduce the complexity of graph structured data and improve the efficiency of data processing and analysis. The principle is to prune based on the dependency relationship of the graph.
[0072] In graph structure data, there are various dependencies between nodes. By analyzing these dependencies, some unimportant nodes or edges can be identified, so that the graph can be pruned. After pruning, the graph structure data can be processed and analyzed more concisely and efficiently. When pruning a structure in the model, all parts that are parameter-coupled with this structure need to be pruned. The phenomenon of parameter coupling is also called dependency. The specific types of dependency are as follows: Figure 2 As shown, the dark colored parts have dependencies.
[0073] Depend on Figure 2 It can be seen that the dependencies of parameter coupling include basic dependency (a), residual dependency (b), connection dependency (c), and reduction dependency (d). The basic dependency expresses the conventional and sequential processing of the neural network, in which each layer w l All followed by the next layer w l+1 , and so on, the output of each layer becomes the input of the next layer.
[0074] Residual dependency means bypassing one or more layers, i.e. the previous layer w l+1 The output is added to the next layer w l+2 The output is connected to the next layer.
[0075] Connection dependency is the process of merging the outputs of a layer before passing them to w l and w l+1 The output is passed to w l+2 Previously merged together.
[0076] Reduce dependency, indicating w lThe output of a layer is not passed directly to another layer, but is summed and passed to the subsequent layer.
[0077] This method first needs to group the model structure and then prune according to the classified groups. Therefore, it is necessary to introduce a binary grouping matrix G to record the coupling relationship between all parameter pairs. The formula is as follows:
[0078] g(i)={j|G ij =1}
[0079] In the formula, if the parameters of the i-th layer and the j-th layer are coupled with each other, G ij =1 indicates.
[0080] The basis of grouping is to judge according to the local dependency relationship of each layer in the model structure. Each layer of the network is represented as f i , and the input of this layer is represented as The output is represented as Its manifestation is as follows:
[0081]
[0082] As can be seen from the above formula, dependency relationships are mainly divided into inter-layer dependency and intra-layer dependency.
[0083] Inter-layer dependency means that the output of the previous layer and the input of the next layer correspond to the same feature, and therefore need to be pruned simultaneously. Intra-layer dependency is related to the properties of the layer itself. In neural networks, various layers can be divided into two categories: the first category of layers has inputs and outputs that can be pruned independently. For example, the parameter matrix of a fully connected layer and a convolutional layer have two different pruned layouts for their inputs and outputs, and are divided into different groups. The second category of layers has coupling between their inputs and outputs, which is the coupled dependency shown in the above equation. Both inputs and outputs have only one pruned layout and are grouped together.
[0084] Where D represents the local dependency graph between adjacent layers, and Represents the interdependence between layers, and Represents interdependencies within a layer.
[0085] By using the above formula to determine the mutual dependencies between layers and then grouping them, the same pruning method can be applied to each group with dependencies.
[0086] Because the general approach of using dependencies within neural networks mentioned above leads to group-level pruning issues, this embodiment proposes a preferred approach to establish a practical method for group-level pruning using a simple norm-based criterion. Given a parameter group g = {w1; w2;:::; w|g|}, existing criteria (such as L2-norm importance I(w) = ||w||2) can generate independent scores for each w∈g. Another preferred approach is to calculate an aggregate score to estimate group importance. The aggregate score formula is as follows:
[0087]
[0088] Due to differences in distribution and size, the importance scores estimated independently on different layers may not be additive. To enable this simple aggregation to be applicable to importance estimation, this embodiment uses a new sparse training method to sparsify parameters at the group level so that those zeroed groups can be safely removed from the network.
[0089] This method is a consistent structured sparse method that aims to ensure that the pruned model remains consistent and effective in structure by consistently sparsifying the parameters of multiple coupled layers. There are complex dependencies between the layers in the neural network, such as Figure 3 As shown, for each parameter with K prunable dimensions (indexed by w[k]), a sparse training regularization term is introduced, defined as:
[0090]
[0091] represents the importance of the k-th prunable dimension, γ k represents the contraction strength applied to these parameters, using a controllable exponential strategy to determine γ k , as shown in the following formula
[0092]
[0093] Among them, the normalized fraction is used to control the contraction strength α k , its range is [2 0 ; 2 α ], a constant hyperparameter α=4 is used in this embodiment, and after sparse training, a simple relative score is used to identify and remove unimportant parameters.
[0094] 4. Model fine-tuning: retraining on the pruned sparse model and restoring model accuracy through parameter adjustment. The model fine-tuning includes retraining on the pruned model with the same batch size and image input size as the original training stage; disabling the Mosaic enhancement strategy in data augmentation to reduce training complexity; and gradually restoring model performance through the linear attenuation strategy of the sparsity factor.
[0095] 5. Generate a lightweight model and output a compressed model that meets the target hardware resource constraints, balancing the number of parameters, computational complexity, and detection accuracy.
[0096] This example addresses the high computational complexity and insufficient inference speed of the improved STUAV-YOLO model by conducting lightweight research based on model pruning technology. By systematically analyzing the characteristics of structured and unstructured pruning, various lightweight pruning methods, including random pruning, LAMP, and Network Slimming, were used. Performance experiments comparing these three pruning algorithms with compression ratios of 2.0, 3.0, and 4.0 were conducted. In practical application scenarios, the pruned model that best suits the STUAV-YOLO model can be selected by comprehensively considering model performance and inference speed.
[0097] In this example, to select the most appropriate pruning method for the STUAV-YOLO model, a comprehensive evaluation strategy is used based on the specific requirements of the model application scenario and the performance of the pruned model at different compression rates (such as speed-up 2.0, 3.0, and 4.0). The strategy follows these steps:
[0098] First, clarify the actual scenario requirements for model deployment, including whether real-time inference is required, whether it will run on resource-constrained edge devices, and the sensitivity to detection accuracy. Different applications have different requirements for speed, accuracy, and model size, and these factors will directly influence the choice of pruning method.
[0099] Using the same training parameters and dataset, we then conducted sparse training, pruning, fine-tuning, and evaluation for three different pruning methods: random pruning, LAMP pruning, and Network Slimming. Each pruning method was tested at three different compression ratios, and the model size, inference speed, and detection accuracy of each combination were recorded.
[0100] Prioritize performance evaluation based on actual needs. For example, in scenarios with high real-time requirements, prioritize inference speed and model size, while in scenarios with higher detection accuracy requirements, prioritize mAP and Recall. By assigning weights to each performance metric and calculating a comprehensive score for each solution, we can effectively measure the pros and cons of different pruning methods and compression ratio combinations for the task at hand.
[0101] Ultimately, the pruning solution with the best overall score is selected as the lightweight solution for the STUAV-YOLO model. If multiple solutions have similar scores, further consideration is given to factors such as structural stability, deployability, and the recoverability of the pruned model to determine the optimal strategy.
[0102] The above method does not directly presuppose a certain pruning method as the only choice. Instead, through system evaluation and multi-scheme experiments, the pruned model that best suits the current application needs is selected in combination with the task characteristics, thereby achieving the optimal solution for balancing model lightweighting and performance.
[0103] Example 2
[0104] like Figure 4 Based on Example 1, this embodiment proposes a terminal device for a lightweight method of a drone target detection model based on a pruning algorithm. The terminal device 200 includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.
[0105] The memory 210 may include a readable medium in the form of a volatile memory, such as a RAM 211 and / or a cache memory 212 , and may further include a ROM 213 .
[0106] Among them, the memory 210 also stores a computer program, which can be executed by the processor 220, so that the processor 220 executes any of the above-mentioned lightweight methods for drone target detection models based on pruning algorithms in the embodiments of the present application. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiments of the above-mentioned applications, and some of the contents are not repeated here. The memory 210 can also include a program / utility 214 having a set (at least one) of program modules 215. Such program modules include but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each of these examples or some combination may include the implementation of a network environment.
[0107] Accordingly, the processor 220 may execute the aforementioned computer programs, as well as the program / utility 214 .
[0108] The bus 230 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0109] The terminal device 200 can also communicate with one or more external devices 240, such as keyboards, pointing devices, Bluetooth devices, etc., and can also communicate with one or more devices that can interact with the terminal device 200, and / or communicate with any device that enables the terminal device 200 to communicate with one or more other computing devices (such as routers, modems, etc.). Such communication can be carried out through the I / O interface 250. In addition, the terminal device 200 can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs) and / or public networks, such as the Internet) through the network adapter 260. The network adapter 260 can communicate with other modules of the terminal device 200 through the bus 230. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in conjunction with the terminal device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0110] Example 3
[0111] This embodiment proposes a computer-readable storage medium for a lightweight method for a drone target detection model based on a pruning algorithm. Instructions are stored on the computer-readable storage medium. When the instructions are executed by the processor, any of the above-mentioned lightweight methods for drone target detection models based on a pruning algorithm is implemented. The specific implementation method is consistent with the implementation method and the technical effect achieved in the above-mentioned application embodiments, and some contents are not repeated here.
[0112] Figure 5The program product 300 provided in this embodiment for implementing the above-mentioned application is shown. It can adopt a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not limited to this. In this embodiment, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, device or device. The program product 300 can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0113] A computer-readable storage medium may include a data signal transmitted in baseband or as part of a carrier wave, carrying readable program code. This transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which can transmit, transmit, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof. The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0114] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A lightweight method for UAV target detection model based on pruning algorithm, characterized by: The following steps are involved: S1, initial training model, obtains the benchmark model through parameterized training; S2, sparse training, introduces a sparse factor into the baseline model, imposes sparsity constraints on model parameters, and generates a sparse weight distribution; S3, model pruning, based on the weight distribution after sparse training, uses structured pruning and unstructured pruning methods to remove redundant parameters or structural units; S4, model fine-tuning, retraining on the pruned sparse model and restoring model accuracy through parameter adjustment; S5. Generate a lightweight model and output a compressed model that meets the target hardware resource constraints, balancing the number of parameters, computational complexity, and detection accuracy.
2. The lightweight method for drone target detection model based on pruning algorithm according to claim 1 is characterized in that: The initial training model trains the benchmark model through a parameter network architecture to achieve the highest detection accuracy in the unpruned state, where the training parameters include batch size, image input size, and training cycle.
3. The lightweight method for drone target detection model based on pruning algorithm according to claim 1 is characterized in that: A sparse factor is introduced to impose regularization constraints on the model weights, and a linear attenuation strategy is used to adjust the sparse factor, gradually reducing the sparsification intensity according to the attenuation step size and attenuation rate.
4. The lightweight method for drone target detection model based on pruning algorithm according to claim 1 is characterized in that: The structured pruning in the model pruning includes: Dependency group pruning analyzes the dependencies between layers in the model, groups layers with parameter coupling, and removes low-importance groups.
5. The lightweight method for drone target detection model based on pruning algorithm according to claim 1 is characterized in that: The unstructured pruning in the model pruning includes: Random pruning, randomly selecting and zeroing weight parameters, keeping at least one parameter per layer to ensure network continuity; Based on layer-adaptive amplitude pruning, the normalized importance score within the layer is calculated based on the square of the weight magnitude, and the weight with the lowest score in each layer is removed.
6. The lightweight method for drone target detection model based on pruning algorithm according to claim 4 is characterized in that: The dependency grouping pruning includes identifying inter-layer dependency types, where the identified inter-layer dependency types include basic dependency, residual dependency, connection dependency, and reduction dependency; The coupling relationship is recorded through a binary grouping matrix, the aggregate importance score is calculated based on the L2 norm of the parameters within the group, and a consistent structure sparse training strategy is adopted to ensure the structural consistency of the pruned model.
7. The lightweight method for drone target detection model based on pruning algorithm according to claim 5 is characterized in that: The random pruning randomly selects convolution kernels or weight parameters in the convolution layer and sets them to zero, retaining at least one weight or convolution kernel in each layer to ensure network continuity, and synchronously adjusts the input dimension of the fully connected layer according to the number of channels after pruning.
8. The lightweight method for drone target detection model based on pruning algorithm according to claim 5 is characterized in that: The layer-based adaptive amplitude pruning sets the pruning ratio layer by layer according to the global sparsity requirement, ensuring the relative importance of the retained weights of each layer, and retraining the pruned model through the fine-tuning stage to restore the accuracy lost due to pruning.
9. The lightweight method for drone target detection model based on pruning algorithm according to claim 1 is characterized in that: The model fine-tuning includes retraining on the pruned model, using the same batch size and image input size as the original training stage; disabling the Mosaic enhancement strategy in data enhancement to reduce training complexity; The model performance is gradually restored through the linear decay strategy of the sparsity factor.
10. A lightweight system for a drone target detection model based on a pruning algorithm, comprising a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, a lightweight method for a drone target detection model based on a pruning algorithm as described in any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Structure grouping de-correlation pruning method and infrared small target lightweight detection method
CN120806025A
Model deployment method and device for embedded equipment, equipment and storage medium
CN121562689A
Method, system, and computer program product for sparse quantization of model
CN121724075A
Method, system, and computer program product for sparse quantization of a model
CN121724075B