Cloud edge collaborative reasoning method based on auto-encoder and intelligent agent
By splitting and compressing complex deep neural network models and using agent generation inference strategies, the problems of insufficient computing power of edge devices and high cloud latency are solved, and efficient and low-latency deep learning inference is achieved.
Patent Information
- Application Number
- CN202510001708.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-02
AI Technical Summary
In deep learning inference tasks, edge devices cannot directly handle complex deep learning tasks due to computing power and storage capacity limitations. Forwarding all inference tasks to the cloud will lead to high latency and bandwidth consumption, which cannot meet real-time requirements.
The cloud-edge collaborative inference method based on autoencoder and agent is adopted to split the complex deep neural network model, compress the model using knowledge distillation technology, compress the transmission data of the intermediate layer based on the lightweight autoencoder structure, and train the agent to generate inference strategies in a multi-device and multi-task environment.
It significantly improves the inference efficiency, reduces the inference time, and optimizes the utilization rate of system resources, achieving optimization of both computing time and network transmission delay while ensuring model accuracy.
Smart Images

Figure CN119886219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer science, edge computing, deep learning and cloud-edge collaborative reasoning technology, and specifically to a cloud-edge collaborative reasoning method based on autoencoders and intelligent agents. Background Art
[0002] With the widespread application of deep learning technology, the complexity and computing requirements of deep neural network (DNN) models are increasing, making reasoning on resource-constrained devices difficult. Edge devices (such as mobile devices, IoT devices, etc.) are often unable to directly process complex deep learning tasks due to limitations in computing power and storage capacity. At the same time, cloud computing provides powerful computing power, but forwarding all reasoning tasks to the cloud will result in high latency and bandwidth consumption, which cannot meet real-time requirements.
[0003] Traditional solutions usually adopt edge-cloud collaborative reasoning, that is, assigning part of the reasoning tasks to edge devices, and the remaining tasks are processed by the cloud. However, this method still faces problems such as uneven resource allocation, load imbalance and data transmission delay in a multi-device, multi-task environment. Especially in application scenarios with high concurrency and high real-time requirements, how to efficiently split tasks, optimize data transmission and improve the computing resource utilization of edge devices has become a difficulty in cloud-edge collaborative reasoning. At the same time, traditional solutions cannot ensure model accuracy while optimizing computing time and network transmission delay. Summary of the invention
[0004] The purpose of the present invention is to provide a cloud-edge collaborative reasoning method based on autoencoders and intelligent agents, which can utilize the collaborative computing capabilities of cloud and edge devices in large-scale deep learning reasoning tasks, significantly improve reasoning efficiency, reduce reasoning time, and optimize the utilization of system resources;
[0005] The specific technical solution provided by the present invention is as follows: a cloud-edge collaborative reasoning method based on an autoencoder and an intelligent agent, comprising the following steps:
[0006] Step S1: split the complex deep neural network model according to the computational complexity and the hardware performance of the edge device;
[0007] Preferably, the method for splitting a complex deep neural network model specifically comprises the following steps:
[0008] S101: Perform preliminary layer-by-layer splitting of the complex deep neural network model, calculate the accuracy of the split model, and determine the preliminary splitting point according to the accuracy;
[0009] S102: Analyze the output scale of the model after the preliminary layer-by-layer splitting, and output the specific analysis results, wherein the specific analysis includes analyzing the parameter quantity and matrix size of each layer of the neural network, and the specific analysis results include the matrix size and computational complexity of the output of each layer of the model;
[0010] S103: confirming the final split point according to the specific analysis results;
[0011] S104: Synchronously making dynamic adjustments according to the load of the computing task.
[0012] Step S2: compress the split partial models using knowledge distillation technology;
[0013] Preferably, the method specifically comprises the following steps:
[0014] S201: Calculate the soft label loss. The student model is trained by minimizing the cross entropy with the teacher model on the soft labels.
[0015] S202: Calculate the hard label loss. The student model uses the difference between the true label and the teacher model output for optimization when outputting.
[0016] S203: Synchronously adjust the distillation temperature using a temperature adjustment mechanism, wherein the temperature adjustment mechanism adjusts the Loss in a binary fast iterative manner. soft The temperature T of distillation, that is, the degree of attention paid to negative labels during training;
[0017] S204: Finally, the student model is trained and optimized by adjusting the hyperparameters and temperature.
[0018] Step S3: compressing the transmission data of the middle layer of the model based on the lightweight autoencoder structure;
[0019] Preferably, the method specifically comprises the following steps:
[0020] S301: extracting transmission data from the model middle layer as training samples and preprocessing the sample data;
[0021] S302: An architecture combining a single-layer autoencoder and a quantization module is used;
[0022] S303: The autoencoder compresses the dimension of the intermediate data by learning the potential low-dimensional feature representation of the input data, and restores the number of feature channels based on the decoder;
[0023] S304: The intermediate features output by the encoder are further compressed using quantization technology, and the quantized values are dequantized at the edge server.
[0024] Step S4: synchronously train an agent to generate reasoning strategies in real time in a multi-device multi-task environment;
[0025] Preferably, the method specifically comprises the following steps:
[0026] S401: The deep neural network inference model is defined after being divided into layers or residual blocks;
[0027] S402: constructing a communication model, and a delay and energy consumption model based on the partitioning result;
[0028] S403: Formulate the original problem and transform it into a Markov problem, and construct a specific Markov solution model;
[0029] S404: Design an actor-critic optimization algorithm that enables the intelligent agent to make optimal decisions in real time based on its current state;
[0030] S405: configuring and training specific parameters of the actor-critic optimization algorithm;
[0031] S406: Finally, the system performance is evaluated based on the inference delay and energy consumption of different models under different numbers of user equipment UEs, and the balance hyperparameters are adjusted according to the evaluation results.
[0032] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: the present invention trains an intelligent agent to generate reasoning strategies in real time in a multi-device and multi-task environment. The intelligent agent generates the optimal reasoning strategy based on the reinforcement learning method, and selects the appropriate reasoning method (such as pure cloud reasoning, edge-cloud collaborative reasoning, or edge reasoning) after considering factors such as device load, network bandwidth, and task complexity. The intelligent agent can make adjustments based on real-time feedback to achieve the goals of energy saving, low latency, and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0034] In the attached picture:
[0035] Figure 1 A flowchart of a multi-device pipeline parallel reasoning method based on edge-cloud collaboration provided by an embodiment of the present invention;
[0036] Figure 2 A flowchart of a complex deep neural network splitting method provided by an embodiment of the present invention;
[0037] Figure 3 A specific data example diagram using ResNet-152 as an example provided in an embodiment of the present invention;
[0038] Figure 4 A flowchart of partial knowledge distillation for edge networks provided by an embodiment of the present invention;
[0039] Figure 5 A flowchart of a process for compressing and transmitting data using a lightweight autoencoder provided in an embodiment of the present invention;
[0040] Figure 6 A flowchart of the process of training an intelligent agent for generating a reasoning solution provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] In this embodiment, combined Figures 1 to 6 , providing the following technical solution: a cloud-edge collaborative reasoning method based on autoencoders and agents, comprising the following steps:
[0043] Step S1: split the complex deep neural network model according to the computational complexity and the hardware performance of the edge device;
[0044] In this embodiment, combined with Figure 2 , Figure 2 It is represented as a process framework of the complex deep neural network splitting method. The core idea of model splitting is to reasonably split the original deep learning model according to the computational complexity and the hardware performance of the edge device to ensure the load balance of computing tasks between the cloud and edge devices.
[0045] Preferably, the specific steps of splitting the original deep learning model further include:
[0046] S101: Split the complex deep neural network layer by layer, calculate the accuracy of the split model, and determine the initial split point according to the accuracy;
[0047] Exemplarily, a complex deep neural network is split layer by layer, and the method for splitting the deep neural network is: first, split each layer and count the model accuracy after segmentation, and determine the preliminary segmentation point according to the accuracy; secondly, analyze the output scale of each preliminary segmentation of the complex deep neural network; then analyze the cumulative scale of each preliminary segmentation point of the complex deep neural network; finally, comprehensively analyze the performance of the edge device and the ratio of the output scale and the cumulative scale of each preliminary segmentation point, and determine the edge-cloud segmentation point, and count the changes in the model accuracy after the splitting of each layer, and combine and combine the model structure analysis to find the indivisible characteristics of the specific structure. The ResNet-152 used in this specific implementation method, as a residual neural network, is composed of a stack of residual structures. When split into a residual structure, the model accuracy drops drastically. Therefore, considering the indivisible characteristics of the specific structure, the position of the preliminary splitting point is determined to be adjacent to each indivisible structure in the model.
[0048] S102: Analyze the output scale of each preliminary segmentation of the complex deep neural network, and specifically analyze and output the parameter quantity and matrix size of each layer of the neural network;
[0049] Exemplarily, the number of parameters and output matrix size of each layer of the neural network are analyzed. For computationally intensive layers (such as convolutional layers and fully connected layers), since strong computing power is required, it is suitable to allocate these layers to the cloud. For layers with relatively small computational workloads (such as pooling layers, batch normalization layers, etc.), they can be allocated to edge devices for processing. That is, by analyzing the computational complexity of the deep learning model and the hardware performance of the edge device, the model's tasks are allocated to the cloud and edge devices for execution. Specifically, the model is first analyzed in layers, and the most appropriate split point is selected. The part with higher computational complexity is deployed to the cloud, and the part with lower computational complexity is deployed to the edge device. This split is based on the performance of the device to ensure load balance between the cloud and edge devices, thereby reducing the computational bottleneck in the reasoning process. The specific data of ResNet-152 is taken as an example. Figure 3 shown.
[0050] S103: Determine the final split point based on the matrix size and computational complexity of each layer output by the analysis model;
[0051] Exemplarily, according to the matrix size and computational complexity of each layer output by the analysis model, combined with the hardware resources of the edge device (such as CPU, GPU, memory, storage, etc.), a suitable split point is selected. Generally speaking, the part with higher computational complexity will be split to the cloud, and the part with lower computational complexity and not requiring large storage will be processed by the edge device.
[0052] S104: Synchronously dynamically adjusting according to the load of the computing task;
[0053] For example, during actual operation, if the load on some edge devices is too high, the system will dynamically adjust the task allocation and transfer some computing tasks to the cloud to ensure the stability of the reasoning process.
[0054] S2: Use knowledge distillation technology to compress some models;
[0055] In this embodiment, combined with Figure 4 , Figure 4 It is a process framework for partial knowledge distillation of edge networks. The knowledge distillation technology aims to train a simplified student model to make it close to the prediction accuracy of the teacher model while significantly reducing the computational overhead. In other words, in order to reduce the computational burden on edge devices, the knowledge distillation technology is used to train a simplified "student model" with a high-precision "teacher model" so that the student model can be as close to the output accuracy of the teacher model as possible, but the amount of computation is significantly reduced. During the reasoning process, the student model can ensure that a high reasoning accuracy can be obtained with lower computing resources.
[0056] As a preference, in this embodiment, the accuracy of the student model is gradually improved through a multi-stage distillation method, and the model performance is optimized by using two training methods, soft label and hard label, so that the reasoning time and computing resource consumption of the student model are further reduced. Figure 4 As shown, the compression process of part of the model specifically includes the following steps:
[0057] S201: training soft labels;
[0058] Exemplarily, the teacher model generates soft labels (i.e., probability distribution processed by softmax) to guide the student model to train, and the student model approximates the prediction result of the teacher model by minimizing the cross entropy with the output of the teacher model;
[0059]
[0060] Among them, Loss soft represents the cross entropy between the student model prediction value and the soft target at the same temperature T. The temperature T indicates the degree of attention paid to negative labels during training. N1 is the total number of labels. represents the softmax output of the jth layer of the teacher model, and represents the corresponding output of the student model at temperature T, and Calculated by the following formula:
[0061]
[0062] in are the logits of the teacher model, are the logits of the student model.
[0063] S202: training hard labels;
[0064] For example, when the student model receives the true label, it uses the hard label to compare with the output features of the teacher model. Based on this, the student model not only learns the feature representation of the teacher model, but also avoids the accuracy loss caused by the distillation process.
[0065] Preferably, considering that the teacher model itself has errors, in order to reduce the propagation of erroneous information to the student model, it is necessary to calculate the error between the output of the student model itself and the true label when T=1. Take the softmax function as an example:
[0066]
[0067] Therefore, the error Loss between the output of the model itself and the true label is calculated by the cross entropy loss function. hard ,get:
[0068]
[0069] Among them, γ j is a realistic value. Considering the inherent error rate of the teacher model, using realistic values helps to significantly limit the possibility of errors propagating to the student model.
[0070] Furthermore, the loss function used to train the student model under response-based knowledge distillation is shown in the following formula:
[0071] Loss = αLoss soft +βLoss hard
[0072] Among them, α and β represent hyperparameters;
[0073] S203: synchronously adjusting the distillation temperature using a temperature adjustment mechanism;
[0074] For example, in order to balance the impact of knowledge distillation on model accuracy and computational burden, the present invention provides a temperature adjustment mechanism to adjust the Loss in a binary fast iterative manner. soft The distillation temperature T, that is, the degree of attention paid to negative labels during training, enables the student model to reduce the amount of computation while maintaining accuracy.
[0075] S204: further training and optimizing the student model by adjusting hyperparameters and temperature;
[0076] For example, through continuous training and parameter adjustment process, the student model gradually approaches the prediction effect of the teacher model, but its computational overhead is only a part of that of the teacher model, which is suitable for running on edge devices.
[0077] S3: compresses the transmission data of the middle layer based on the lightweight autoencoder structure;
[0078] In this embodiment, combined with Figure 5 , Figure 5 The process framework for compressing and transmitting data using lightweight autoencoders. Lightweight autoencoders are used to compress data in the middle layer into low-dimensional representations, thereby reducing the amount of data transmitted. This process not only optimizes bandwidth usage but also maintains reasoning accuracy. The encoder part of the autoencoder maps the data to a low-dimensional space, while the decoder reconstructs the data as much as possible to ensure reasoning accuracy.
[0079] Preferably, if Figure 4 As shown, the specific steps for implementing compressed transmission data based on the lightweight autoencoder structure include:
[0080] S301: Feature selection and preprocessing
[0081] Exemplarily, the output data of each layer is first analyzed through the feature selection step, and the most important features for the inference results are screened out and standardized. The goal of this step is to ensure that the autoencoder can focus on the most meaningful data and reduce redundancy and noise.
[0082] S302: An architecture combining a single-layer autoencoder and a quantization module is used;
[0083] Exemplarily, the compression method of the present invention adopts an architecture that combines a single-layer autoencoder with a quantization module. The autoencoder, as an unsupervised learner, consists of two parts: an encoder and a decoder. The encoder converts the input data into a low-dimensional representation, and the decoder restores it to output. Through this structure, the middle layer data of the network is effectively compressed and the bandwidth requirement for data transmission is reduced, that is, they respectively assume the functions of feature compression and recovery, and the quantization module is responsible for representing the feature map output by the encoder with fewer bits, thereby further improving the compression effect.
[0084] S303: The autoencoder compresses the dimension of the intermediate data by learning the potential low-dimensional feature representation of the input data, and restores the number of feature channels based on the decoder;
[0085] For example, both the encoder and decoder consist of only one convolutional layer (kernel size is 1*1). For the intermediate features of shape (bs,ch,w,h) (representing batch size, number of channels, width and height respectively), the convolutional layer reduces the number of channels from ch to (ch'), and its compression rate is The corresponding convolution kernel shape in the decoder is (ch,ch′,1,1), which is used to restore the number of feature channels. This design effectively learns compact feature representation with limited overhead and is insensitive to small offsets in the input domain, enhancing the effectiveness and robustness of feature compression.
[0086] S304: further compressing the intermediate features output by the encoder using a quantization technique, and dequantizing the quantized values at the edge server end;
[0087] For example, at the user equipment UE, a quantization technique is used to further compress the intermediate features output by the encoder. The quantization process is performed by a specific formula: Implementation, where x is the intermediate feature to be quantified, x i is the i-th value in x, y i For x i Quantized output integer, c q is the bit width used for quantization, x i The maximum and minimum values of can be replaced by the results calculated from the pre-collected feature map set;
[0088] Specifically, at the edge server, the quantized value is dequantized to restore the approximate original eigenvalue. The dequantization formula is: where x′ i is the approximate value after recovery. Due to the rounding operation in the quantization process, x′ i Usually not equal to x i .
[0089] S4: Generate reasoning policies in real time by training an agent in a multi-device multi-task environment;
[0090] In this embodiment, combined with Figure 6 , Figure 6The process framework of the agent training for generating reasoning solutions is represented, that is, a multi-device, multi-task reasoning scenario is constructed through a simulation environment. The system includes multiple user equipment terminals UE, wireless base stations BS and edge servers. The user equipment terminal UE communicates with the wireless base station BS through a wireless channel, and the wireless base station BS is connected to the edge server through an optical fiber network. Each user equipment terminal UE has multiple DNN reasoning tasks. The edge server decides whether the task is executed locally on the user equipment terminal UE or on the edge server. The system makes decisions and updates at a fixed frequency, dividing time into non-overlapping frames. At the beginning of each frame, the edge server decides the task processing according to the user equipment terminal UE status (such as the number of remaining tasks, the size of data to be unloaded, etc.). The user equipment UE performs operations accordingly, and finally the edge server returns the result. The intelligent agent is trained to select the appropriate reasoning strategy under the given task load and device status. That is, the intelligent agent generates the optimal reasoning strategy based on the reinforcement learning method, considering factors such as device load, network bandwidth, and task complexity, and selects the appropriate reasoning method (such as pure cloud reasoning, edge-cloud collaborative reasoning, or edge reasoning). The intelligent agent can make adjustments based on real-time feedback to achieve the goals of energy saving, low latency, and high efficiency. At the same time, the actor-critic optimization algorithm enables the intelligent agent to make the best decision in real time based on the current state to achieve the goal of reducing reasoning time and saving energy;
[0091] Preferably, if Figure 6 As shown, the method for the agent to generate a multi-task reasoning strategy further includes the following steps:
[0092] S401: The DNN inference model is defined after being divided into residual blocks;
[0093] For example, the definition of DNN can be divided into layers or residual blocks. For a system with N user equipment UEs, UE n The above model can be divided into B n +1 for Part B, Partition Decision n ∈{0, 1, ..., B n +1}, b n =0 means that the user equipment UE directly offloads the original input to the edge server, b n =B n +1 means that the user equipment UE performs reasoning locally;
[0094] S402: constructing a communication model, and a delay and energy consumption model based on the partitioning result;
[0095] Exemplarily, the user equipment UE transmits data via a specific offloading channel, channel c n ∈1,...,C, transmission power p n >0, combined with partition point b n, the reasoning action of the user equipment UE is expressed as (b n , c n , p n ), the uplink data rate between the user equipment UE and the edge server r n The calculation formula for (π) is
[0096]
[0097] in, is the channel bandwidth, g n For UE n The channel gain with the wireless base station BS, is the channel background noise power.
[0098] Exemplarily, constructing a delay and energy consumption model based on delay and energy consumption specifically includes:
[0099] Considering the inference delay and energy consumption of each sample, ignoring the overhead of collecting the UE status, UE n At partition point b n The size of the compressed intermediate feature is fn bits (when n=0, it means the original input sample size), and the inference delay of a single sample is determined by the local inference delay Feature Compression Delay and data transmission delays Composition, the calculation formula is:
[0100]
[0101] The energy consumption calculation formula is:
[0102]
[0103] in, and Can be measured on the device,
[0104] S403: Formulate the original problem and transform it into a Markov problem formulation, and construct a specific Markov solution model;
[0105] For example, the goal of this embodiment is to find a strategy π that minimizes the delay and energy consumption when all tasks are completed. n Receive K n In the case of a task, the optimization problem is expressed as The constraints are where p max is the maximum transmit power of a single UE, is the β-balance hyperparameter;
[0106] As a preferred solution, the original problem is a mixed integer nonlinear programming problem, which is difficult to solve using traditional methods. DRL needs to express it as an MDP, but because it contains the sum of the delay and energy consumption of each task, there may be unfinished tasks during state transition, resulting in unavailability of delay and energy consumption. Therefore, considering the average delay and energy consumption of each completed task in each time frame, ignoring the overhead of unfinished tasks, the problem is reformulated as The constraints are (C1), (C2), and (C3), where T0 represents the duration of a time frame;
[0107] Exemplarily, constructing a Markov specific solution model specifically includes: MDP consists of state S, action A, state transition probability P and reward r, state s t It consists of four parts: the number of remaining tasks k t , remaining local computing time l t , remaining uninstall data size n t and the distance d from the user equipment UE to the edge server, i.e. s t ={k t ,l t ,n t ,d}, action a t = {b t ,c t ,p t}, where b t is the partition point, c t For the offloading channel, p t For the transmission power, reward Accumulated Rewards Solve the problem by maximizing the cumulative reward;
[0108] S404: Design an actor-critic optimization algorithm that enables the intelligent agent to make optimal decisions in real time based on its current state;
[0109] Exemplarily, the method of this embodiment adopts an actor-critic structure. For multiple user equipment UEs in a multi-agent collaborative reasoning scenario, multiple actor networks are used to provide reasoning decisions. The number of actor networks is equal to the number of user equipment UEs. To process the mixed action space, each actor network adds three output branches to obtain mixed actions. The branches share the encoding state information of the first few layers, and output the partition point, offloading channel and transmission power decision respectively. The parameters of the critic network and the actor network are represented by and respectively (θ n For UE n The corresponding actor network parameters), the actor-critic network input state s t , which is composed of four vectors connected, and the critic network outputs the predicted state value Guide the actor network to update, the actor network outputs strategy π θ (at |s t ), discrete actions output action probabilities by adding a softmax function Continuous actions output mean and standard deviation, actions are distributed from Medium sampling;
[0110] S405: configuring and training specific parameters of the actor-critic optimization algorithm;
[0111] Exemplarily, each actor network consists of a fully connected layer, the first two layers are shared (containing 256 and 128 neurons respectively), the output branch has two layers each, the first layer contains 64 neurons, and the last layer structure is determined by the action type and dimension. The critic network consists of 4 fully connected layers (containing 256, 128, 64 and 1 neurons respectively). Both the actor and critic networks are trained for 50,000 steps using a learning rate of 0.0001, a memory buffer size of 1024, a batch size of 256, sample reuse times of 10, and hyperparameters λ=0.95,∈=0.2,ζ=0.001. During the training process, trajectories are continuously collected, state values and advantage functions are calculated, and the actor and critic network parameters are updated according to the loss function.
[0112] S406: Finally, the system performance is evaluated based on the inference delay and energy consumption of different models under different numbers of user equipment UEs, and the balance hyperparameters are adjusted according to the evaluation results;
[0113] Exemplarily, the system performance is evaluated by measuring the inference delay and energy consumption of different models (such as ResNet18, VGG11, MobileNetV2, etc.) under different numbers of user equipment UEs. According to the evaluation results, the balance hyperparameters are adjusted to balance the delay and energy consumption to meet the needs of different application scenarios. At the same time, the autoencoder structure can be further optimized according to actual conditions or other compression methods can be used to improve the compression rate and optimize the system performance.
[0114] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0115] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A cloud-edge collaborative reasoning method based on autoencoders and agents, characterized by: The method comprises the following steps: Step S1: split the complex deep neural network model according to the computational complexity and the hardware performance of the edge device; Step S2: compress the split partial models using knowledge distillation technology; Step S3: compressing the transmission data of the middle layer of the model based on the lightweight autoencoder structure; Step S4: Synchronously train an agent in a multi-device multi-task environment to generate reasoning strategies in real time.
2. According to claim 1, a cloud-edge collaborative reasoning method based on autoencoders and agents is characterized in that: The method for splitting a complex deep neural network model specifically comprises the following steps: S101: Perform preliminary layer-by-layer splitting of the complex deep neural network model, calculate the accuracy of the split model, and determine the preliminary splitting point according to the accuracy; S102: Analyze the output scale of the model after the preliminary layer-by-layer splitting, and output the specific analysis results, wherein the specific analysis includes analyzing the parameter quantity and matrix size of each layer of the neural network, and the specific analysis results include the matrix size and computational complexity of the output of each layer of the model; S103: confirming the final split point according to the specific analysis results; S104: Synchronously making dynamic adjustments according to the load of the computing task.
3. According to claim 2, a cloud-edge collaborative reasoning method based on autoencoders and agents is characterized in that: The method of compressing the split partial model by using the knowledge distillation technology specifically comprises the following steps: S201: Calculate the soft label loss. The student model is trained by minimizing the cross entropy with the teacher model on the soft labels. S202: Calculate the hard label loss. The student model uses the difference between the true label and the teacher model output for optimization when outputting. S203: Synchronously adjust the distillation temperature using a temperature adjustment mechanism, wherein the temperature adjustment mechanism adjusts the Loss in a binary fast iterative manner. soft The temperature T of distillation, that is, the degree of attention paid to negative labels during training; S204: Finally, the student model is trained and optimized by adjusting the hyperparameters and temperature.
4. According to claim 3, the cloud-edge collaborative reasoning method based on autoencoder and intelligent agent is characterized in that: The S201 further includes: the teacher model guides the student model to train by generating soft labels, and the student model obtains the prediction result of the teacher model by minimizing the cross entropy output with the teacher model. The specific calculation formula is as follows: Among them, Loss soft represents the cross entropy between the student model prediction value and the soft target at the same temperature T. The temperature T indicates the degree of attention paid to negative labels during training. N1 is the total number of labels. represents the softmax output of the jth layer of the teacher model, and represents the corresponding output of the student model at temperature T, and Calculated by the following formula: in are the logits of the teacher model, are the logits of the student model.
5. According to claim 4, a cloud-edge collaborative reasoning method based on autoencoders and agents is characterized in that: The step S202 further includes: when the student model receives the real label, it uses the hard label to compare with the output feature of the teacher model, and when the temperature T=1, it calculates the error between the output of the student model itself and the real label The specific calculation formula is as follows: The cross entropy loss function is used to further calculate the error Loss between the output of the model itself and the true label. hard , Loss hard The formula for calculation is as follows: Among them, γ j is the actual value; The loss function used when training the student model is as follows: Loss=αLoss soft +βLoss hard Among them, α and β represent hyperparameters.
6. The cloud-edge collaborative reasoning method based on autoencoder and agent according to claim 5, characterized in that: The method of compressing the transmission data of the middle layer of the model based on the lightweight autoencoder structure specifically includes the following steps: S301: extracting transmission data from the model middle layer as training samples and preprocessing the sample data; S302: An architecture combining a single-layer autoencoder and a quantization module is used; S303: The autoencoder compresses the dimension of the intermediate data by learning the potential low-dimensional feature representation of the input data, and restores the number of feature channels based on the decoder; S304: The intermediate features output by the encoder are further compressed using quantization technology, and the quantized values are dequantized at the edge server.
7. The cloud-edge collaborative reasoning method based on autoencoder and agent according to claim 6, characterized in that: The training of an intelligent agent to generate a reasoning strategy in real time specifically includes the following steps: S401: The deep neural network inference model is defined after being divided into layers or residual blocks; S402: constructing a communication model, and a delay and energy consumption model based on the partitioning result; S403: Formulate the original problem and transform it into a Markov problem, and construct a specific Markov solution model; S404: Design an actor-critic optimization algorithm that enables the intelligent agent to make optimal decisions in real time based on its current state; S405: configuring and training specific parameters of the actor-critic optimization algorithm; S406: Finally, the system performance is evaluated based on the inference delay and energy consumption of different models under different numbers of user equipment UEs, and the balance hyperparameters are adjusted according to the evaluation results.
8. The cloud-edge collaborative reasoning method based on autoencoder and agent according to claim 7, characterized in that: The step S404 specifically includes: adopting an actor-critic structure, for multiple user equipment UEs in a multi-agent collaborative reasoning scenario, using multiple actor networks to provide reasoning decisions, the number of actor networks is equal to the number of user equipment UEs, to process the mixed action space, each actor network adds three output branches to obtain mixed actions, the branches share the first few layers of coding state information, and output partition points, offloading channels and transmission power decisions respectively, and use and to represent the parameters of the critic network and the actor network respectively, that is, θ n For UE n The corresponding actor network parameters, actor-critic network input state s t , which is composed of four vectors connected, and the critic network outputs the predicted state value Guide the actor network to update, the actor network outputs strategy π θ (a t |s t ), discrete actions output action probabilities by adding a softmax function Continuous actions output mean and standard deviation, actions are distributed from Medium sampling.
9. The cloud-edge collaborative reasoning method based on autoencoder and agent according to claim 8, characterized in that: The step S405 specifically includes: each actor network consists of a fully connected layer, the first two layers are shared, the output branches each have two layers, the first layer contains 64 neurons, and the last layer structure is determined by the action type and dimension. The critic network consists of 4 fully connected layers. The connection layer is composed of two layers. During the training process, the trajectory is continuously collected, the state value and the advantage function are calculated. Update the actor and critic network parameters according to the loss function.
Citation Information
Patent Citations
Edge cloud collaborative deep learning model training method with classification precision maintenance and bandwidth protection
CN111222532A
Edge cloud extensible task unloading method based on multiple agents
CN113064671A
Cloud edge collaborative data processing method, system and device and storage medium
CN119211229A
Cited By
Communication edge cloud segmentation reasoning method and device for large language model, equipment, product and medium
CN120166112A
A communication edge-cloud segmentation inference method, device, equipment, product and medium for large language models
CN120166112B
Model operation method and device based on multiple devices, and electronic device
CN120781975A