AI model adaptive compression method and system for mobile application scenarios
By tracking computing power and memory changes in real time, calculating the priority weight rate of the compression strategy, the delay and accuracy of the AI model in the maneuvering edge environment is solved, and the dynamic matching of resource constraints and compression strategies is achieved, improving the task completion rate and model accuracy.
Patent Information
- Application Number
- CN202510653036.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-05-21
AI Technical Summary
The existing AI model compression technology fails to effectively respond to resource dynamic characteristics and burst task loads in maneuverable edge environments, resulting in a surge in model response delay and a decrease in recognition accuracy.
Adaptive compression method of AI model for maneuver application scenarios is adopted. By tracking computing power fluctuations and memory changes in real time, the priority weight rate of the compression strategy is calculated to determine the optimal compression strategy, and dynamic matching between resource constraints and compression strategies is achieved.
While ensuring model accuracy, it reduces delay and energy consumption, improves task completion rate, and avoids the cliff-like decline in accuracy in traditional methods.
Smart Images

Figure CN120179421B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of AI models, and in particular relates to an AI model adaptive compression method and system for mobile application scenarios. Background Art
[0002] As an important optimization method in the field of artificial intelligence, AI model compression technology mainly reduces model complexity through algorithms such as parameter pruning and quantization reconstruction. The current mainstream compression methods are mainly designed for cloud servers or fixed computing nodes, and their optimization goals are focused on improving computing efficiency in static scenarios. In typical mobile edge scenarios such as drone cluster collaboration and on-board real-time decision-making, the dynamic network environment and heterogeneous device resources form unique constraints: on the one hand, the volatility of computing power of mobile devices in mobile environments is essentially different from the stable resource configuration of fixed nodes; on the other hand, the real-time switching requirements of tasks and the parallel operation of multiple models require more complex dynamic adaptation of memory bandwidth and computing units.
[0003] Existing compression technologies generally employ global static compression strategies, which fail to account for the dynamic resource characteristics of edge nodes and struggle to cope with the elastic scaling demands of sudden task loads. This results in significant accuracy loss in compressed models in mobile environments. This technological misalignment often results in traditional compression solutions failing due to surges in model response latency or a sharp drop in recognition accuracy when addressing scenarios such as the real-time environmental perception of drone formations. To address this core contradiction, there is an urgent need to establish a dynamic compression mechanism that is deeply adapted to mobile edge environments, thereby achieving a dynamic balance between model accuracy and resource consumption. Summary of the Invention
[0004] The main problem solved by the present invention is how to compress the model in a mobile environment with limited resources while ensuring the normal operation of AI recognition tasks and minimizing accuracy loss. It provides an AI model adaptive compression method and system for mobile application scenarios.
[0005] In order to solve the above technical problems, the technical solutions adopted are:
[0006] An AI model adaptive compression method for mobile application scenarios includes the following steps:
[0007] Step 1: Obtain a task set and a compression strategy set, wherein each task in the task set has a task resource requirement, including a task CPU resource requirement and a memory resource requirement, and the compression strategy set includes multiple compression strategies;
[0008] Step 2: Calculate the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task;
[0009] Step 3: Calculate the priority weight of each compression strategy in the compression strategy set based on the total CPU resource usage and total memory resource usage at time t.
[0010] Step 4: Calculate the optimal compression strategy value based on the priority weight rate and precision loss rate of each compression strategy, where the precision loss rate is a property of each compression strategy;
[0011] Step 5: Obtain the optimal compression strategy corresponding to the optimal compression strategy value according to the optimal compression strategy value;
[0012] Step 6: Compress the model according to the optimal compression strategy and use the compressed model to perform the task.
[0013] Furthermore, the method for calculating the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task is:
[0014] ;
[0015] in, for The total CPU resource usage of the mobile environment at all times, for The total memory resource usage of the mobile environment at all times, and is the sliding average coefficient used to smooth resource fluctuations, For the The real-time CPU computing resource requirements of each task, For the The memory requirement of each task, m is the number of tasks in the task set.
[0016] Furthermore, the method for calculating the priority weight ratio of each compression strategy in the compression strategy set is:
[0017] ;
[0018] in, For the The priority weight ratio of the compression strategy; and They are the total CPU resource usage threshold and the total memory resource usage threshold, As an indicative function, the priority weight ratio is only It takes effect when the threshold is not exceeded. For the The accuracy loss rate of the compression strategy.
[0019] Furthermore, the optimal compression strategy selects the value:
[0020] , , N is the total number of strategies.
[0021] The present invention also provides an AI model adaptive compression system for mobile application scenarios, which is implemented using the steps of an AI model adaptive compression method for mobile application scenarios.
[0022] By adopting the above technical solution, the present invention has the following beneficial effects:
[0023] The present invention provides an AI model adaptive compression method and system for mobile application scenarios. By real-time tracking of computing power fluctuations and memory changes, the priority weight rate of each compression strategy in the compression strategy set is calculated to determine the optimal compression strategy. Compared with the traditional fixed threshold based on static compression, it realizes the dynamic matching of resource constraints and compression strategies, and solves the problem of delay surge under sudden tasks of edge devices.
[0024] Through the priority weight rate and optimal selection mechanism, the accuracy loss rate is decoupled from the resource threshold, making the accuracy loss rate independent of the resource threshold. This method allows for a precision-resource trade-off. Compared with the traditional method that couples the two and results in forced precision reduction when exceeding the limit, the present invention allows more strategies to be selected when the memory constraint is activated. The optimal strategy maximizes the set of available strategies under the same resources. Compared with the traditional global compression, it increases the feasible solution space and improves the task completion rate under the same resources, avoiding the defect of the traditional method of a cliff-like drop in precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a flow chart of the system of the present invention. DETAILED DESCRIPTION
[0026] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0027] Figure 1 The present invention shows an AI model adaptive compression method for mobile application scenarios, including the following steps:
[0028] Step 1: Obtain a task set and a compression strategy set. Each task in the task set has a task resource requirement, including a task CPU resource requirement and a memory resource requirement. The compression strategy set includes multiple compression strategies.
[0029] Step 2: Calculate the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task.
[0030] In this embodiment, the method for calculating the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task is:
[0031] ;
[0032] in, for The total CPU resource usage of the mobile environment at all times, for The total memory resource usage of the mobile environment at all times, and is the sliding average coefficient used to smooth resource fluctuations, For the The real-time CPU computing resource requirements of each task, For the The memory requirement of each task, m is the number of tasks in the task set.
[0033] By calculating the total CPU resource usage and total memory resource usage at time t, you can track computing power fluctuations and memory changes in real time.
[0034] Step 3: Calculate the priority weight of each compression strategy in the compression strategy set based on the total CPU resource usage and total memory resource usage at time t.
[0035] In this embodiment, the method for calculating the priority weight ratio of each compression strategy in the compression strategy set is:
[0036] ;
[0037] in, For the The priority weight ratio of the compression strategy; and They are the total CPU resource usage threshold and the total memory resource usage threshold, As an indicative function, the priority weight ratio is only It takes effect when the threshold is not exceeded. For the The accuracy loss rate of the compression strategy.
[0038] The priority weight rate is calculated based on the precision loss rate. When calculating the priority weight rate, the precision loss rate is decoupled from the resource threshold. This allows for a precision-resource trade-off, while traditional methods couple the two, forcing precision to drop when exceeding the limit. By using the optimal strategy to maximize the set of available strategies under the same resources (more strategies can be selected when memory constraints are activated), compared to traditional global compression, this increases the feasible solution space and improves the task completion rate under the same resources, avoiding the defect of the traditional method of drastically decreasing precision.
[0039] Step 4: Calculate the optimal compression strategy value based on the priority weight rate and precision loss rate of each compression strategy, where the precision loss rate is a property of each compression strategy.
[0040] In this embodiment, the optimal compression strategy selection value is:
[0041] , , N is the total number of strategies.
[0042] Through priority weight rate and real-time computing power and memory When the memory does not exceed the threshold, the compression strategy values are calculated respectively, and the minimum value is taken as the optimal compression strategy value. The compression strategy corresponding to this minimum value is used as the optimal compression strategy. When encountering sudden task switching in a mobile resource-constrained environment, the optimal compression strategy is used to achieve stable inference of the model with low latency and low energy consumption.
[0043] Step 5: Obtain the optimal compression strategy corresponding to the optimal compression strategy value according to the optimal compression strategy value.
[0044] Step 6: Compress the model according to the optimal compression strategy and use the compressed model to perform the task.
[0045] The following is specifically described by an embodiment:
[0046] <1> Case Background
[0047] When a drone swarm performs search and rescue missions in the wild, it needs to process high-resolution infrared images in real time to identify trapped people. However, due to limitations on onboard computing resources (CPU computing power fluctuation range is ±20%, and memory capacity is only 4GB) and sudden task switching (such as the temporary increase in multi-target tracking requirements), traditional static compression models cannot meet the real-time and low-energy requirements.
[0048] <2> Implementation Process
[0049] a. Dynamic resource modeling and compression strategy triggering.
[0050] Input conditions: ① Initial resource threshold: CPU computing power threshold ( =85%), memory threshold ( =12GB)
[0051] ② Burst tasks: The number of tasks increases from 10 to 15, and the CPU requirements of new tasks are increased ( ), memory requirements ( ). Dynamic modeling results: Calculate real-time resource status through the formula:
[0052] ①CPU resources: Jumped from 60% to 65.67%, the sliding average coefficient =0.8;②Memory resources: From 11GB to 11.85GB, sliding average coefficient =0.9, memory does not exceed the threshold ; Because the memory does not exceed the threshold ( ), characteristic function Π( )=1, all compression strategies participate in weight calculation.
[0053] b. Priority Weight Rate and Strategy Selection Strategy Pool and Parameter Configuration In this embodiment, there are five compression strategies in the compression strategy set, as shown in Table 1.
[0054] Table 1 Five compression strategies
[0055]
[0056] Optimal strategy calculation:
[0057] According to the formula:
[0058] , , N is the total number of strategies.
[0059] Substitute real-time data ( =11.85 / 65.67≈0.180), calculate the value of each strategy:
[0060] KD: (0.180+0.08) / 0.92=0.2826; LR: (0.180+0.15) / 0.85=0.3882; LS: (0.180+0.12 ) / 0.88=0.3409; NAS: (0.180+0.18) / 0.82=0.4390; MP: (0.180+0.10) / 0.90=0.3111.
[0061] Select the strategy corresponding to the minimum value: KD strategy (κ=0.2826).
[0062] <3> Comparison of execution effects
[0063]
[0064] It can be seen that the model's inference delay is reduced from 420ms to 285ms, and energy consumption, task completion rate, and memory usage error are all improved.
[0065] This case verifies the effectiveness of dynamic compression strategies in resource-constrained edge scenarios. Its core is to push compression technology from "offline optimization" to "online decision-making" through real-time modeling and weight rate mechanisms, providing a new paradigm for the elastic deployment of AI models.
[0066] The present invention breaks through the fixed threshold limit of traditional static compression by tracking computing power fluctuations and memory changes in real time. It dynamically scales the policy weight only when the memory does not exceed the threshold, realizes dynamic matching of resource constraints and compression strategies, and solves the problem of delay surge under sudden tasks of edge devices.
[0067] The present invention also provides an AI model adaptive compression system for mobile application scenarios, which is implemented using the steps of an AI model adaptive compression method for mobile application scenarios.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An AI model adaptive compression method for mobile application scenarios, characterized by: The following steps are involved: Step 1: Obtain a task set and a compression strategy set, wherein each task in the task set has a task resource requirement, including a task CPU resource requirement and a memory resource requirement, and the compression strategy set includes multiple compression strategies; Step 2: In the mobile task scenario, calculate the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task; The method to calculate the total CPU resource usage and total memory resource usage at time t based on the task resource requirements of each task is: ; in, for The total CPU resource usage of the mobile environment at all times, for The total memory resource usage of the mobile environment at all times, and is the sliding average coefficient used to smooth resource fluctuations, For the The real-time CPU computing resource requirements of each task, For the The memory requirement of each task, m is the number of tasks in the task set; Step 3: Calculate the priority weight of each compression strategy in the compression strategy set based on the total CPU resource usage and total memory resource usage at time t. The method for calculating the priority weight ratio of each compression strategy in the compression strategy set is: ; in, For the The priority weight ratio of the compression strategy; and They are the total CPU resource usage threshold and the total memory resource usage threshold, As an indicative function, the priority weight ratio is only It takes effect when the threshold is not exceeded. For the The accuracy loss rate of the compression strategy; Step 4: Calculate the optimal compression strategy value based on the priority weight rate and precision loss rate of each compression strategy, where the precision loss rate is a property of each compression strategy; Optimal compression strategy selection value: , , N is the total number of strategies; Step 5: Obtain the optimal compression strategy corresponding to the optimal compression strategy value according to the optimal compression strategy value; Step 6: Compress the model according to the optimal compression strategy and use the compressed model to perform the task.
2. An AI model adaptive compression system for mobile application scenarios, characterized by: The steps of the AI model adaptive compression method for mobile application scenarios described in claim 1 are implemented.
Citation Information
Patent Citations
Deep learning model compression method and system for micro unmanned aerial vehicle platform
CN117744742A