An ai terminal perception model matching method based on multi-target soft and hard constraints
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ECONOMIC RES INST
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-07
AI Technical Summary
这种后期优化方法存在显著的局限性:效率低下且过程繁琐;压缩过程往往伴随着模型精度的不可控损失;更重要的是,这种方案未能从模型架构的源头考虑硬件在延迟、内存占用和功耗上的硬性约束,导致最终部署的模型并非为该类设备“量身定制”,其实际性能、效率和稳定性往往难以达到最优
[0009]其有益效果在于,本发明明确划分硬约束和软约束,硬约束是不可触碰的执行红线,软约束是择优的驱动方向,为筛选提供了清晰的法律边界。
Smart Images

Figure CN122529013A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and embedded computing technology, and in particular relates to an AI terminal perception model matching method based on multi-objective soft and hard constraints. Background Technology
[0002] Traditional deployment methods typically follow a "design first, compress later" paradigm. This involves first training a large and accurate floating-point model on a powerful server, then compressing and accelerating the model using techniques such as pruning, quantization, and knowledge distillation to adapt it to the limited memory, computing power, and power consumption of embedded devices. This post-optimization approach has significant limitations: it is inefficient and cumbersome; the compression process often involves uncontrollable loss of model accuracy; and more importantly, this approach fails to consider the hardware's hard constraints in terms of latency, memory usage, and power consumption from the source of the model architecture. This results in a final deployed model that is not "tailor-made" for such devices, and its actual performance, efficiency, and stability often fall short of optimal levels. This invention deeply integrates multi-objective constraints from the early stages of modeling, achieving an integrated solution for automated search and refined deployment. Summary of the Invention
[0003] To address the problems mentioned in the background section, this invention discloses an AI terminal perception model matching method based on multi-objective soft and hard constraints. This method can deeply integrate multi-objective constraints in the early stages of modeling and achieve an integrated solution for automated search and refined deployment. To achieve the above objectives, the technical solution adopted by this invention is as follows: A method for matching AI terminal perception models based on multi-objective soft and hard constraints, characterized by the following steps: S1, Construct a multi-layer search model library adapted to embedded devices; The model library organizes various neural network models according to task type, and clusters them according to model complexity, accuracy and memory usage, and stores the models in layers and serialization. S2, execute the model selection strategy under multi-objective soft and hard constraints; by jointly evaluating the model's memory usage, latency, and accuracy in a real hardware environment, and setting a latency hard threshold and optimal memory usage, select feasible models that meet the constraints from the model library; latency evaluation is achieved in the following way: construct an operator latency lookup table and train a surrogate model, use the surrogate model to calculate the inference latency of each module in the model computation graph, and combine the fixed latency generated by chip data transfer to calculate the total latency, and compare the total latency with the latency hard threshold set based on the data acquisition frequency; S3 employs a quadratic FSS strategy for non-dominated model sets; a fuzzy optimization strategy is executed for models with the same or similar scores, and the model is dynamically selected according to the scenario. The dynamic selection model includes: determining the dynamic weights of each evaluation index using a triangular fuzzy function based on the feature vector of the terminal scenario, and then calculating the fuzzy comprehensive preference degree of the model to select the model to be deployed. S4 executes a refined deployment process suitable for the selected model, including computation graph optimization, compilation to generate hardware native instructions, runtime temperature monitoring, and dynamic adjustment.
[0004] Its beneficial effect is that, through a systematic approach of selection and adaptation, this invention ensures that the established model can run efficiently on the target embedded hardware from the very beginning. Compared with the traditional "design first, compress later" AI model deployment method, this invention can deeply integrate multi-objective constraints in the early stage of modeling and realize an integrated solution of automated search and refined deployment.
[0005] Furthermore, step S1 specifically includes: S11: Define clustering metrics and constraints, including accuracy metrics, latency constraints, and resource consumption constraints; S12, establish a multi-library model search space, establish a task-based guidance library through clustering, divide it into regression model library and classification model library according to task type, and calculate the accuracy and resource consumption index of the model in the same test environment, and initially divide the model into sub-libraries distinguished by soft and hard constraints. S13, the construction phase, divides the existing models into classification models and regression models, constructs the structural layers of the models, including the network depth, input and output, and convolutional kernel size; trains and tests the models on the same platform using the same dataset to obtain the hard constraint parameters of the models, and tests the models on embedded hardware to obtain the soft constraint parameters of the models; according to the hard and soft constraints of the models, the models are serialized and stored according to storage, memory, accuracy, and latency to form a model sub-library with gradients, and each layer of the model library is numbered from top to bottom; the configuration of the neural networks in the model library is defined using the vector α.
[0006] Furthermore, the neural network models in the multilayer search model library in S1 include one or more of the following: multilayer perceptron, GRU model, LSTM model, convolutional neural network, recurrent neural network, graph neural network, generative adversarial network, and multi-composite neural network. The model specifications include the network depth, the number of channels in each layer, and the input and output width.
[0007] Furthermore, step S2 specifically includes: S21, obtain the memory parameters of the hardware device being used; S22, Match the model sub-library suitable for the hardware and the task based on the required task information; S23, Establish a scoring method for hard constraint indicators, including hard constraint scoring for storage, hard constraint scoring for peak model memory usage, and hard constraint scoring for delay parameters; S24, Establish a scoring method for soft constraint indicators, including accuracy constraint scoring; S25. When the model satisfies all hard constraints, an overall evaluation is performed using a reward function, and the model with the highest score is selected as the model to be deployed. The relevant formula for the reward function is:
[0008] in, It represents the score for various constraints, where n is the number of constraints.
[0009] Its beneficial effect is that the present invention clearly distinguishes between hard constraints and soft constraints. Hard constraints are the inviolable red lines of execution, while soft constraints are the driving direction for selection, providing clear legal boundaries for screening.
[0010] Furthermore, in step S23, the storage hard constraint score specifically means that the model's storage usage must be less than the maximum storage space that the hardware can accommodate; the model's peak memory usage hard constraint score specifically includes: S2321, obtain the hardware memory size. ; S2322, Calculate the maximum peak memory usage during model runtime. ; S2323 specifies the optimal memory usage. It is 70% of the hardware memory size; S2324, Construct a memory hard constraint scoring system, the relevant formula is: .
[0011] Its beneficial effect is that the present invention creatively sets the concept of "optimal memory usage" in the hard constraint of memory. Compared with the existing technology, which usually only sets a maximum memory usage limit, the design of optimal memory usage in the present invention does not simply judge whether it exceeds the limit, but guides the selection of a model that utilizes resources more efficiently, thereby improving resource utilization efficiency.
[0012] Furthermore, the delay parameter constraint scoring in step S23 specifically includes: S2331, Obtain the computation graph of various models, decompose each module in the model architecture, define a monitoring function for each sub-module, the monitoring function calculates the time and scale of data inflow and outflow, and measures the latency running on the specified embedded device; S2332, Construct a lookup table, test the latency for each model and operator, and record the type, size, and features of the operator; S2333, Train the agent model, use data from the lookup table to train the model for inference latency; S2334, parse the computation graph of the new architecture, traverse all components in the graph, find the basic model and find the corresponding delay, and for the missing model sub-block, call the proxy model to perform the calculation and add it to the lookup table. S2335, calculate the total delay, the relevant formula is: ;in Indicates a delay in total reasoning. This represents the inference latency of the i-th computation module under the corresponding data size. This indicates the fixed delay caused by data transfer from the chip, where A represents the batch, i.e., the total number of times input data is received. S2336, Set the latency hard threshold , The time for the data collection unit to input data; S2337, Latency Score: Calculates the latency score under the condition of meeting the latency hard threshold. Related formula:
[0013] Where k is the penalty coefficient; otherwise, the delay score is 0.
[0014] Furthermore, step S24, establishing the soft constraint index scoring method, specifically includes: S241, define the accuracy of model α as Acc(α), and calculate Acc(α) using the GAM method. The relevant formula is:
[0015] Where N represents the total number of samples in the test set. Let the value be the true value of the i-th sample. The predicted value of the model. Let P be the sample weight, P be the order parameter, and L have relevant formulas for different tasks:
[0016] Where δ is the indicator function, For small positive numbers, the denominator is guaranteed to be non-zero; S242, select the accuracy Acc(α) of the actual test set to calculate the model architecture, which is the accuracy score.
[0017] Furthermore, step S3, which involves implementing a fuzzy optimization strategy for models with the same or similar scores, further includes: S31, Obtain neural network models with the same or similar scores, and construct a comprehensive evaluation vector for each neural network model; S32 converts the indicators into fuzzy membership degrees; S33 introduces dynamic weights based on the application scenarios of the terminal. S34. For any two models, calculate the fuzzy comprehensive preference degree, use the centroid method to defuzzify the fuzzy comprehensive preference degree, obtain the preference degree relation matrix, and perform consistency checks on the matrix until the matrix is consistent. S35, calculate the outflow and inflow of each model, further calculate the net flow of the model, and select the model with the highest net flow as the model to be deployed.
[0018] Furthermore, in step S33, the dynamic weights are determined through the scene feature vector, and the weights of the indicators are triangular fuzzy functions about the scene feature vector.
[0019] Its beneficial effect is that, by designing dynamic weights, the present invention achieves real-time binding between model selection and task scenario, unlike the existing technology where the weights of each evaluation index are usually fixed during model selection. The dynamic weights of the present invention are dynamically generated by the scene feature vector.
[0020] Furthermore, step S4 specifically includes: S41. Obtain the ONNX file of the model to be deployed, verify the compatibility of the model structure and operators, use model optimization methods to integrate the data processing stage into the original computation graph, and fuse the operators to form a new computation graph, and verify the accuracy of the optimized model. S42 compiles the computation graph for the specific architecture of the embedded target hardware, generating native execution instructions optimized for that hardware; S43, perform benchmark tests on the model in a real operating environment; S44 monitors the chip temperature during operation. If overheating occurs, it sets up a start / stop function or activates the heat dissipation device, and monitors the storage status. Attached Figure Description
[0021] Figure 1 This is the basic flowchart of the AI terminal perception model matching method based on multi-objective soft and hard constraints of the present invention.
[0022] Figure 2 This is an overall flowchart of the AI terminal perception model matching method based on multi-objective soft and hard constraints of the present invention.
[0023] Figure 3 This is an architecture diagram of the multi-layer search model library of the present invention. Detailed Implementation
[0024] To facilitate understanding by those skilled in the art, the present invention will be further described below in conjunction with embodiments and accompanying drawings.
[0025] This embodiment provides a method for matching AI terminal perception models based on multi-objective soft and hard constraints. (See attached document.) Figure 1 , Figure 2 The method includes the following steps: S1, the construction of a multi-layer search model library adapted for embedded devices; see [link / reference]. Figure 3 The construction of the multi-layer search model library specifically includes S11, Define clustering metrics and constraints; Accuracy metric: The target accuracy that the model is expected to achieve on this hardware.
[0026] Latency constraint: The maximum acceptable latency incurred by processing the task on the target embedded chip.
[0027] Resource consumption constraints: The peak memory consumption and storage space required by the model when running the specified model on the target chip.
[0028] The indicators and constraints can be refined and adjusted according to the actual tasks, resulting in more sub-indicators.
[0029] S12, Establish a multi-library search space for the model; Establish a library of selectable models for specific chips. Models can include multilayer perceptrons, GRU models, LSTM models, convolutional neural networks, recurrent neural networks, graph neural networks, generative adversarial networks, and multi-complex neural networks. The models are applicable to a wide range of tasks, and their specifications can be selected, including network depth, the number of channels in each layer, and the width of inputs and outputs.
[0030] First, a task-based guidance library is established through clustering, which can be divided into regression model library and classification model library according to task type. Each library contains the broadest models suitable for that type of task. For different models, parameters such as the number of channels in each layer, network depth, convolution kernel size, and activation function type can be customized.
[0031] Furthermore, within each model library, the accuracy and resource consumption of the model are calculated under the same testing environment, and based on this, the models are initially divided into sub-libraries distinguished by soft and hard constraints to adapt to embedded chip devices with different needs.
[0032] By constructing the model library in this way, when multiple devices need to be searched and models are built, it is only necessary to collect and verify the models in the target subspace according to the requirements of the task, thus avoiding a lot of redundant search work.
[0033] S13, Construction Phase; S131 divides the existing models into classification models and regression models, and constructs the structural layer of the model. The structural layer includes parameters such as network depth, input and output, and convolution kernel size, ensuring that each model has three forms: simple, general, and complex.
[0034] S132, if the model allows, use the same dataset to train and test on the same platform to obtain the hard constraint parameters of this model: peak memory usage, storage usage, model latency, and operator compatibility; test on the embedded hardware used to obtain the soft constraint parameters: model accuracy.
[0035] S133, based on the soft and hard constraints of the model, the model can be further classified: the model is serialized and stored according to storage, memory, accuracy and latency to form a model sub-library with gradients, which facilitates model search and reading.
[0036] S134, number each layer of the model library from top to bottom.
[0037] S135, use vector α to define the configuration of the neural network in the model library. ,in It represents the Lth layer. Each model is essentially a coordinate representation. Any possible values within the vector α constitute the entire model search library.
[0038] S2: Model selection strategy under multi-objective soft and hard constraints; Currently, the process of deploying models for embedded devices typically involves building the model and then performing operations such as quantization and compression. This method is inefficient and is merely a reduction of an existing large model. Our proposed method, however, considers various constraints during the modeling phase, resulting in a highly practical model. When establishing model constraints, we categorize them into hard constraints and soft constraints. Hard constraints are the conditions that the model must meet, while soft constraints are the conditions that the model should strive to meet under specific tasks.
[0039] S21, obtain the memory parameters of the hardware device being used, specifically including the total memory size and the memory usage during startup.
[0040] S22. Based on the required requirements, obtain the task information needed by the search model, including task type, task objective, etc., match the model sub-library suitable for the hardware and the task, and further score the indicators within the sub-library.
[0041] S23, Establish a scoring method for hard constraint indicators; S231, Hard storage constraint: The model's storage footprint must be less than the maximum storage space the hardware can accommodate. This represents the current FLASH size occupied by the model. The maximum model FLASH size that the target hardware can accommodate.
[0042]
[0043] S232, Hard constraint on peak model memory usage: S2321, obtain the hardware memory size. ; S2322, Calculate the maximum peak memory usage during model runtime. (Including the memory size occupied by the model itself and the memory size occupied by the hardware system); S2323 specifies the optimal memory usage. It should be 70% of the hardware memory size (with a 30% safety margin). S2324, Constructing a memory hard constraint scoring system:
[0044] S233, Delay parameter constraint;
[0045] S2331: Obtain the computation graph of various models, decompose each module in the model architecture, define a monitoring function for each sub-module, calculate the time and scale of data inflow and outflow, and measure the latency on the specified embedded device.
[0046] S2332, Construct a lookup table: For each model and operator, test the delay of each and its corresponding delay, and record the type, size and features of the operator.
[0047] S2333, Training the surrogate model: The model is trained and tested using data from the lookup table. The model considers the benefits of latency reduction brought about by operations such as operator fusion. After training, the model receives various data from the operators and infers the latency.
[0048] S2334: Whenever a new architecture α is used, the computation graph of that architecture is parsed, all components in the graph are traversed, the underlying model that makes it up is found, and all corresponding delays are identified. For sub-blocks without a model, a proxy model is called for calculation and added to the lookup table.
[0049] S2335, calculate total delay: ;in Indicates a delay in total reasoning. This represents the inference latency of the i-th computation module under the corresponding data size. This indicates the fixed delay caused by data transfer from the chip, and A represents the batch, i.e., the total number of times input data is received.
[0050] S2336, Delay Hard Threshold: In models with dynamic data acquisition, the sensor's data acquisition frequency must be lower than the model's data processing frequency; this is the critical delay value. , This represents the time required for the data to be input by the data acquisition unit. The above formula helps prevent data accumulation caused by the model's data processing speed lagging behind the sensor's data acquisition speed.
[0051] S2337, Latency Rating: Under the condition that the hard threshold of delay is met, we have:
[0052] Where k is the penalty coefficient. Otherwise, the delayed score is zero.
[0053] S24, Establish a scoring method for soft constraint indicators; S241, Construct accuracy constraints; define the accuracy of model α as Acc(α), and calculate Acc(α) using the GAM method.
[0054] Where N represents the total number of samples in the test set. Let the value be the true value of the i-th sample. The predicted value of the model. Let L be the sample weights and P be the order parameter. For different tasks, L has the following:
[0055] Where δ is the indicator function, The denominator is guaranteed to be non-zero if the result is a small positive number.
[0056] S242, select the accuracy Acc(α) of the actual test set to calculate the model architecture, which is the accuracy score.
[0057] S25, Overall Model Evaluation; If the model satisfies all hard constraints, the following reward function is executed for scoring.
[0058] IDS reward function:
[0059] in It represents the score for various constraints, where n is the number of constraints;
[0060] The model with the highest score from the calculated models is selected as the model to be deployed.
[0061] S3: A quadratic FSS strategy for non-dominated model sets; If models have the same or similar scores, they will be further filtered and ranked according to the indicators.
[0062] S31, Obtain neural network models with similar or identical scores. For each neural network model, construct its comprehensive evaluation vector:
[0063] in The model corresponds to constraints and indicators.
[0064] Convert the indicators into fuzzy membership degrees: ;
[0065] in, a and c are slope parameters, and b and d are inflection point parameters.
[0066] S32, introducing dynamic weights Dynamic weights are introduced based on the application scenario of the terminal. Let the feature vector of the application scenario be... t is the value after numerical mapping and normalization of scene features, and the weights of each indicator for this scene are: ,in It is a triangular blur function with respect to scene T.
[0067]
[0068] in The dynamic width of the triangular fuzzy number. Weights of scene features The initial weights are selected empirically.
[0069] S33, for any two models and Calculate the fuzzy comprehensive preference degree ;
[0070]
[0071] in .
[0072] S34, to The centroid method is used to resolve fuzzy conditions and obtain the preference relation matrix. The matrix is then subjected to a consistency check until it is consistent (the superiority or inferiority among similar elements is consistent). Otherwise, the weights or membership functions are adjusted and recalculated.
[0073] S35, calculate the outflow and inflow rates for each model, and further calculate the net flow rate of the model. Select the model with the highest net flow rate as the model to be deployed.
[0074]
[0075] S4: A refined deployment process suitable for screening models; S41: Obtain the ONNX file of the model to be deployed, verify the compatibility of the model structure and operators, and further adopt model optimization methods to integrate the data processing stage into the original computation graph, and perform operations such as operator fusion to form a new computation graph, and verify the accuracy of the optimized model.
[0076] S42: For the specific architecture of the embedded target hardware, compile the above computation graph to generate native execution instructions optimized for that hardware.
[0077] S43: Perform benchmark tests on the model in a real operating environment.
[0078] S44: Monitors chip temperature during operation. If overheating is detected, it sets up a start / stop function, or if the chip is equipped with external heat dissipation, it activates the heat dissipation device; it also monitors storage status.
[0079] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A method for matching AI terminal perception models based on multi-objective soft and hard constraints, characterized in that, The method includes the following steps: S1, Construct a multi-layer search model library adapted to embedded devices; The model library organizes various neural network models according to task type, and clusters them according to model complexity, accuracy and memory usage, and stores the models in layers and serialization. S2, execute the model selection strategy under multi-objective soft and hard constraints; by jointly evaluating the model's memory usage, latency, and accuracy in a real hardware environment, and setting a latency hard threshold and optimal memory usage, select feasible models that meet the constraints from the model library; latency evaluation is achieved in the following way: construct an operator latency lookup table and train a surrogate model, use the surrogate model to calculate the inference latency of each module in the model computation graph, and combine the fixed latency generated by chip data transfer to calculate the total latency, and compare the total latency with the latency hard threshold set based on the data acquisition frequency; S3 employs a quadratic FSS strategy for non-dominated model sets; a fuzzy optimization strategy is executed for models with the same or similar scores, and the model is dynamically selected according to the scenario. The dynamic selection model includes: determining the dynamic weights of each evaluation index using a triangular fuzzy function based on the feature vector of the terminal scenario, and then calculating the fuzzy comprehensive preference degree of the model to select the model to be deployed. S4 executes a refined deployment process suitable for the selected model, including computation graph optimization, compilation to generate hardware native instructions, runtime temperature monitoring, and dynamic adjustment.
2. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 1, characterized in that, Step S1 specifically includes: S11, Define clustering metrics and constraints, including accuracy metrics, latency constraints, and resource consumption constraints; S12, establish a multi-library model search space, establish a task-based guidance library through clustering, divide it into regression model library and classification model library according to task type, and calculate the accuracy and resource consumption index of the model in the same test environment, and initially divide the model into sub-libraries distinguished by soft and hard constraints. S13, the construction phase, divides the existing models into classification models and regression models, constructs the structural layers of the models, including the network depth, input and output, and convolutional kernel size; trains and tests the models on the same platform using the same dataset to obtain the hard constraint parameters of the models, and tests the models on embedded hardware to obtain the soft constraint parameters of the models; according to the hard and soft constraints of the models, the models are serialized and stored according to storage, memory, accuracy, and latency to form a model sub-library with gradients, and each layer of the model library is numbered from top to bottom; the configuration of the neural networks in the model library is defined using the vector α.
3. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 1, characterized in that, The neural network models in the multilayer search model library in S1 include one or more of the following: multilayer perceptron, GRU model, LSTM model, convolutional neural network, recurrent neural network, graph neural network, generative adversarial network, and multi-composite neural network. The model specifications include the network depth, the number of channels in each layer, and the input and output width.
4. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 1, characterized in that, Step S2 specifically includes: S21, obtain the memory parameters of the hardware device being used; S22, Match the model sub-library suitable for the hardware and the task based on the required task information; S23, Establish a scoring method for hard constraint indicators, including hard constraint scoring for storage, hard constraint scoring for peak model memory usage, and hard constraint scoring for delay parameters; S24, Establish a scoring method for soft constraint indicators, including accuracy constraint scoring; S25. When the model satisfies all hard constraints, an overall evaluation is performed using a reward function, and the model with the highest score is selected as the model to be deployed. The relevant formula for the reward function is: , in, It represents the score for various constraints, where n is the number of constraints.
5. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 4, characterized in that, In step S23, the hard constraint scoring of storage specifically means that the model storage occupancy must be less than the maximum storage space that the hardware can accommodate. The hard constraint score for peak model memory usage specifically includes: S2321, obtain the hardware memory size. ; S2322, Calculate the maximum peak memory usage during model runtime. ; S2323 specifies the optimal memory usage. It is 70% of the hardware memory size; S2324, Construct a memory hard constraint scoring system, the relevant formula is: 。 6. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 4, characterized in that, The delay parameter constraint scoring in step S23 specifically includes: S2331, Obtain the computation graph of various models, decompose each module in the model architecture, define a monitoring function for each module, the monitoring function calculates the time and scale of data inflow and outflow, and measures the latency running on the specified embedded device; S2332, Construct a lookup table, test the latency for each model and operator, and record the type, size, and features of the operator; S2333, Train the agent model, use data from the lookup table to train the model for inference latency; S2334, parse the computation graph of the new architecture, traverse all components in the graph, find the basic model and find the corresponding delay, and for the missing model sub-block, call the proxy model to perform the calculation and add it to the lookup table. S2335, calculate the total delay, the relevant formula is: ;in Indicates a delay in total reasoning. This represents the inference latency of the i-th computation module under the corresponding data size. This indicates the fixed delay caused by data transfer from the chip, where A represents the batch, i.e., the total number of times input data is received. S2336, Set the latency hard threshold , The time for the data collection unit to input data; S2337, Latency Score: Calculates the latency score under the condition of meeting the latency hard threshold. Related formula: , Where k is the penalty coefficient; otherwise, the delay score is 0.
7. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 4, characterized in that, The specific steps in step S24, establishing a soft constraint index scoring method, include: S241, define the accuracy of model α as Acc(α), and calculate Acc(α) using the GAM method. The relevant formula is: , Where N represents the total number of samples in the test set. Let the value be the true value of the i-th sample. The predicted value of the model. Let P be the sample weight, P be the order parameter, and L have relevant formulas for different tasks: , Where δ is the indicator function, For small positive numbers, the denominator is guaranteed to be non-zero; S242, select the accuracy Acc(α) of the actual test set to calculate the model architecture, which is the accuracy score.
8. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 1, characterized in that, Step S3, which involves implementing a fuzzy optimization strategy for models with the same or similar scores, further includes: S31, Obtain neural network models with the same or similar scores, and construct a comprehensive evaluation vector for each neural network model; S32 converts the indicators into fuzzy membership degrees; S33 introduces dynamic weights based on the application scenarios of the terminal. S34. For any two models, calculate the fuzzy comprehensive preference degree, use the centroid method to defuzzify the fuzzy comprehensive preference degree, obtain the preference degree relation matrix, and perform consistency checks on the matrix until the matrix is consistent. S35, calculate the outflow and inflow of each model, further calculate the net flow of the model, and select the model with the highest net flow as the model to be deployed.
9. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 8, characterized in that, In step S33, the dynamic weights are determined by the scene feature vectors, and the weights of the indicators are triangular fuzzy functions about the scene feature vectors.
10. The AI terminal perception model matching method based on multi-objective soft and hard constraints according to claim 1, characterized in that, Step S4 specifically includes: S41. Obtain the ONNX file of the model to be deployed, verify the compatibility of the model structure and operators, use model optimization methods to integrate the data processing stage into the original computation graph, and fuse the operators to form a new computation graph, and verify the accuracy of the optimized model. S42 compiles the computation graph for the specific architecture of the embedded target hardware, generating native execution instructions optimized for that hardware; S43, perform benchmark tests on the model in a real operating environment; S44 monitors the chip temperature during operation. If overheating occurs, it sets up a start / stop function or activates the heat dissipation device, and monitors the storage status.