A cloud-edge collaborative reasoning method based on autoencoders and agents
By using a collaborative reasoning method involving autoencoders and agents, deep neural networks are decomposed, compressed, and optimized, solving the problem of limited resources on edge devices and achieving efficient, low-latency, and energy-saving computing in multi-device, multi-tasking environments.
Patent Information
- Application Number
- CN202510001708.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-01-02
AI Technical Summary
When performing complex deep learning tasks on resource-constrained edge devices, limitations in computing power and storage capacity lead to difficulties in inference. Traditional edge-cloud collaborative inference methods face problems such as uneven resource allocation, unbalanced load, and data transmission latency in multi-device, multi-task environments, making it difficult to optimize computation time and network transmission latency while ensuring model accuracy.
We employ a cloud-edge collaborative reasoning method using autoencoders and agents. This method involves splitting the deep neural network model, compressing the model using knowledge distillation, compressing intermediate layer data using a lightweight autoencoder, and training agents to generate real-time reasoning strategies in a multi-device, multi-task environment, thereby optimizing resource utilization and reasoning efficiency.
It significantly improves inference efficiency, reduces inference time, optimizes system resource utilization, and achieves low-latency and high-performance computing in a multi-device, multi-tasking environment.
Smart Images

Figure CN119886219B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer science, edge computing, deep learning, and cloud-edge collaborative reasoning, specifically a cloud-edge collaborative reasoning method based on autoencoders and agents. Background Technology
[0002] With the widespread application of deep learning technology, the complexity and computational requirements of deep neural network (DNN) models are increasing, making inference on resource-constrained devices difficult. Edge devices (such as mobile devices and IoT devices) are often unable to directly handle complex deep learning tasks due to limitations in computing power and storage capacity. At the same time, cloud computing provides powerful computing capabilities, but forwarding all inference tasks to the cloud will result in high latency and bandwidth consumption, which cannot meet real-time requirements.
[0003] Traditional solutions typically employ edge-cloud collaborative inference, which involves assigning some inference tasks to edge devices while the remaining tasks are processed in the cloud. However, this approach still faces challenges such as uneven resource allocation, load imbalance, and data transmission latency in multi-device, multi-task environments. This is especially true in high-concurrency and real-time application scenarios. Efficiently splitting tasks, optimizing data transmission, and improving the utilization of computing resources on edge devices have become key challenges for cloud-edge collaborative inference. Furthermore, traditional solutions cannot simultaneously ensure model accuracy while optimizing computation time and network transmission latency. Summary of the Invention
[0004] The purpose of this invention is to provide a cloud-edge collaborative inference method based on autoencoders and intelligent agents, which can significantly improve inference efficiency, reduce inference time, and optimize the utilization of system resources by utilizing the collaborative computing capabilities of cloud and edge devices in large-scale deep learning inference tasks.
[0005] The specific technical solution provided by this invention is as follows: A cloud-edge collaborative reasoning method based on autoencoders and agents, comprising the following steps:
[0006] Step S1: Decompose the complex deep neural network model according to the computational complexity and the hardware performance of the edge device;
[0007] Preferably, the method for decomposing a complex deep neural network model specifically includes the following steps:
[0008] S101: Perform preliminary layer-by-layer decomposition on the complex deep neural network model, calculate the accuracy of the decomposed model, and determine the preliminary segmentation point based on the accuracy.
[0009] S102: Perform a detailed analysis on the output scale of the model after the initial layer-by-layer decomposition, and output the detailed analysis results. The detailed analysis includes the analysis of the number of parameters and the matrix size of each layer of the neural network. The detailed analysis results include the matrix size and computational complexity of the output of each layer of the model.
[0010] S103: Confirm the final split point based on the specific analysis results;
[0011] S104: Synchronize and dynamically adjust according to the load of computing tasks.
[0012] Step S2: Compress the split parts of the model using knowledge distillation techniques;
[0013] Preferably, the procedure specifically includes the following steps:
[0014] S201: Perform soft label loss calculation. The student model is trained by minimizing the cross-entropy with the teacher model on soft labels.
[0015] S202: Perform hard label loss calculation. When the student model outputs, it optimizes the output by using the difference between the real label and the teacher model output.
[0016] S203: Simultaneously adjust the distillation temperature using a temperature regulation mechanism, wherein the temperature regulation mechanism adjusts the loss in a binary rapid iteration manner. soft The distillation temperature T represents the degree of attention paid to negative labels during training.
[0017] S204: Finally, the student model was trained and optimized by adjusting hyperparameters and temperature.
[0018] Step S3: Compress the transmitted data of the intermediate layer of the model based on the lightweight autoencoder structure;
[0019] Preferably, the procedure specifically includes the following steps:
[0020] S301: Extract transmission data from the intermediate layer of the model as training samples, and preprocess the sample data;
[0021] S302: Adopts an architecture combining a single-level autoencoder and a quantization module;
[0022] S303: By learning the latent low-dimensional feature representation of the input data, the autoencoder compresses the dimension of the intermediate data and restores the number of feature channels based on the decoder;
[0023] S304: Employs quantization technology to further compress the intermediate features output by the encoder, while simultaneously performing inverse quantization on the edge server.
[0024] Step S4: Simultaneously train an agent to generate inference strategies in real time in a multi-device, multi-task environment;
[0025] Preferably, the procedure specifically includes the following steps:
[0026] S401: The deep neural network inference model is defined after being divided into layers or residual blocks;
[0027] S402: Construct a communication model based on the partitioning results, as well as a latency and energy consumption model;
[0028] S403: Formulate the original problem and transform it into a Markov problem formulation, while constructing a concrete Markov solution model;
[0029] S404: An actor-critic optimization algorithm designed to enable intelligent agents to make optimal decisions in real time based on the current state;
[0030] S405: Configure and train specific parameters for the actor-critic optimization algorithm;
[0031] S406: Finally, the system performance is evaluated based on the inference latency and energy consumption of different models under different numbers of user equipment (UEs), and the balancing 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 inference strategies in real time in a multi-device, multi-task environment. Based on reinforcement learning, the intelligent agent generates the optimal inference strategy after considering factors such as device load, network bandwidth, and task complexity, and selects an appropriate inference method (such as pure cloud inference, edge-cloud collaborative inference, or edge inference). The intelligent agent can adjust according to real-time feedback to achieve the goals of energy saving, low latency, and high efficiency. Attached Figure Description
[0033] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0034] In the attached diagram:
[0035] Figure 1 This is a flowchart of a multi-device pipeline parallel inference method based on edge-cloud collaboration provided in an embodiment of the present invention.
[0036] Figure 2 A flowchart illustrating a method for decomposing complex deep neural networks as provided in an embodiment of the present invention;
[0037] Figure 3 This is a specific data example diagram using ResNet-152 as an example, provided as an embodiment of the present invention;
[0038] Figure 4 A flowchart illustrating the knowledge distillation process for edge networks provided in this embodiment of the invention;
[0039] Figure 5 A flowchart illustrating the use of a lightweight autoencoder to compress and transmit data, as provided in an embodiment of the present invention.
[0040] Figure 6 This is a flowchart illustrating the training process of an agent for generating inference schemes, as provided in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] In this embodiment, combined with Figures 1 to 6 The following technical solution is provided: A cloud-edge collaborative reasoning method based on autoencoders and agents, comprising the following steps:
[0043] Step S1: Decompose 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 This is represented as a process framework for decomposing complex deep neural networks. The core idea of model decomposition is to rationally split the original deep learning model based on computational complexity and the hardware performance of edge devices, ensuring a balanced computational load between the cloud and edge devices.
[0045] Preferably, the specific steps for splitting the original deep learning model further include:
[0046] S101: By decomposing the complex deep neural network layer by layer, the accuracy of the decomposed model is statistically analyzed, and the initial segmentation point is determined based on the accuracy.
[0047] For example, a complex deep neural network is decomposed layer by layer. The method for decomposing the deep neural network is as follows: First, the accuracy of the model after each layer is statistically analyzed, and the initial segmentation point is determined based on the accuracy. Second, the output scale of each initial segmentation of the complex deep neural network is analyzed. Then, the cumulative scale of each initial segmentation point of the complex deep neural network is analyzed. Finally, the edge device performance and the ratio of the output scale of each initial segmentation point to the cumulative scale are comprehensively analyzed to determine the edge cloud segmentation point, and the change in model accuracy after each layer is decomposed is statistically analyzed. Combined with the analysis of the model structure, the indivisible characteristics of a specific structure are found. The ResNet-152 used in this specific implementation method is a residual neural network composed of stacked residual structures. When decomposing to the residual structure, the model accuracy drops sharply. Therefore, considering the indivisible characteristics of the specific structure, the position of the initial segmentation point is determined to be the adjacent position of each indivisible structure in the model.
[0048] S102: Analyze the output scale of each preliminary segment of a complex deep neural network, specifically analyzing the number of parameters and the size of the matrix for each layer of the neural network.
[0049] For example, analyzing the number of parameters and the size of the output matrix of each layer of the neural network reveals that computationally intensive layers (such as convolutional and fully connected layers) are best deployed to the cloud due to their high computational requirements. Layers with relatively low computational demands (such as pooling and batch normalization layers) can be assigned to edge devices. This involves analyzing the computational complexity of the deep learning model and the hardware performance of edge devices to distribute the model's tasks between the cloud and edge. Specifically, the model is first layered, and the most suitable split point is selected. The computationally complex parts are deployed to the cloud, while the less complex parts are deployed to edge devices. This split is based on device performance to ensure load balance between the cloud and edge devices, thereby reducing computational bottlenecks during inference. Specific data from ResNet-152 can be used as an example. Figure 3 As shown.
[0050] S103: Based on the size of the matrix output by each layer of the analysis model and the computational complexity, determine the final split point;
[0051] For example, based on the matrix size and computational complexity of each layer of the analysis model, and 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 parts with higher computational complexity will be split to the cloud, while the parts with lower computational complexity and no need for large amounts of storage will be processed by the edge device.
[0052] S104: Synchronize dynamically based on the workload of the computing task;
[0053] For example, in 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 inference process.
[0054] S2: Knowledge distillation technique is used to compress some parts of the model;
[0055] In this embodiment, combined with Figure 4 , Figure 4 This document outlines a framework for knowledge distillation in edge networks. Knowledge distillation aims to train a simplified student model to achieve prediction accuracy close to that of the teacher model while significantly reducing computational overhead. Specifically, to reduce the computational burden on edge devices, knowledge distillation trains a simplified student model using a high-precision "teacher model." This allows the student model to approach the output accuracy of the teacher model as closely as possible while significantly reducing computational load. During inference, the student model can still achieve high inference accuracy with lower computational resources.
[0056] Preferably, in this embodiment, a multi-stage distillation method is used to gradually improve the accuracy of the student model. Both soft-label and hard-label training methods are employed to optimize model performance, further reducing the inference time and computational resource consumption of the student model. Figure 4 As shown, the compression process for a portion of the model includes the following steps:
[0057] S201: Training soft tags;
[0058] For example, the teacher model guides the student model to train by generating soft labels (i.e., probability distributions processed by softmax), and the student model approximates the teacher model's prediction by minimizing the cross-entropy with the teacher model's output.
[0059]
[0060] Among them, Loss soft This represents the cross-entropy between the student model's predicted value and the soft target at the same temperature T. Temperature T indicates the degree of attention given to negative labels during training, and N1 is the total number of labels. This represents the softmax output of the j-th layer of the teacher model, while This represents the corresponding output of the student model at temperature T. and Calculated using the following formula:
[0061]
[0062] in It is the logits of the teacher model. It is the logits of the student model.
[0063] S202: Training on hard labels;
[0064] For example, when the student model receives the real label, it compares the hard label 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 the inherent errors in the teacher model, to reduce the propagation of erroneous information to the student model, it is necessary to calculate the error between the student model's output and the true label when T=1. Taking the softmax function as an example:
[0066]
[0067] Therefore, the error loss between the generated model's output and the true label is calculated using the cross-entropy loss function. hard ,get:
[0068]
[0069] Where, γ j These are actual values. Considering the inherent error rate of the teacher model, using actual 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 finally obtained as shown in the following formula:
[0071] Loss = αLoss soft +βLoss hard
[0072] Where α and β represent hyperparameters;
[0073] S203: The distillation temperature is adjusted simultaneously using a temperature regulation mechanism;
[0074] For example, to balance the impact of knowledge distillation on model accuracy and computational burden, this invention provides a temperature adjustment mechanism that adjusts the loss using a binary, fast iterative approach. soft The distillation temperature T represents the degree of attention paid to negative labels during training, enabling the student model to reduce computational load while maintaining accuracy.
[0075] S204: Further training and optimization of the student model by adjusting hyperparameters and temperature;
[0076] For example, through continuous training and parameter tuning, the student model gradually approaches the predictive performance of the teacher model, but its computational cost is only a fraction of that of the teacher model, making it suitable for running on edge devices.
[0077] S3: Compress the transmitted data of the intermediate layer based on a lightweight autoencoder structure;
[0078] In this embodiment, combined with Figure 5 , Figure 5 To utilize the lightweight autoencoder to compress transmitted data, a lightweight autoencoder is used to compress the data in the intermediate layer into a low-dimensional representation, thereby reducing the amount of data transmitted. This process not only optimizes bandwidth usage but also maintains inference 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 inference accuracy.
[0079] Preferably, such as Figure 4 As shown, the specific implementation steps for compressed data transmission based on a lightweight autoencoder structure include:
[0080] S301: Feature Selection and Preprocessing
[0081] For example, the output data of each layer is first analyzed through a feature selection step to filter out the features that are most important to the inference result and perform standardization. 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: Adopts an architecture combining a single-level autoencoder and a quantization module;
[0083] For example, the compression method of the present invention adopts an architecture that combines a single-level autoencoder with a quantization module. The autoencoder, as an unsupervised learner, consists of an encoder and a decoder. The encoder converts the input data into a low-dimensional representation, and the decoder restores it to the output. Through this structure, the intermediate layer data of the network is effectively compressed, and the bandwidth requirements during data transmission are reduced. That is, the autoencoder undertakes the functions of feature compression and restoration respectively. The quantization module is responsible for representing the feature map output by the encoder with fewer bits, further improving the compression effect.
[0084] S303: By learning the latent low-dimensional feature representation of the input data, the autoencoder compresses the dimension of the intermediate 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 1*1). For an intermediate feature 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'), achieving a compression ratio of [missing information]. The corresponding convolutional kernel shape in the decoder is (ch, ch′, 1, 1), which is used to recover the number of feature channels. This design effectively learns compact feature representations with limited overhead and is insensitive to small offsets in the input domain, thus enhancing the effectiveness and robustness of feature compression.
[0086] S304: Employs quantization technology to further compress the intermediate features output by the encoder, while simultaneously performing inverse quantization on the edge server.
[0087] For example, at the user equipment (UE) end, quantization technology is used to further compress the intermediate features output by the encoder. The quantization process is carried out using a specific formula. Implementation, where x is the intermediate feature to be quantized, x i Let y be the i-th value in x. i For x i The quantized output integer, c q For the bit width used in quantization, x i The maximum and minimum values can be replaced by the results calculated from a pre-collected set of feature maps;
[0088] Specifically, on the edge server side, the quantized values are dequantized to recover approximate original feature values. The dequantization formula is as follows: Where x′ i This is the approximate value after restoration. Due to rounding operations during the quantization process, x′ i Usually not equal to x i .
[0089] S4: In a multi-device, multi-tasking environment, an agent is trained to generate inference strategies in real time.
[0090] In this embodiment, combined with Figure 6 , Figure 6This describes the framework for training the agent that generates the inference scheme. It involves constructing a multi-device, multi-task inference scenario in a simulation environment. The system includes multiple user equipment (UEs), wireless base stations (BSs), and edge servers. UEs communicate with BSs via wireless channels, and BSs are connected to edge servers via fiber optic networks. Each UE has multiple DNN inference tasks. The edge server determines whether a task should be executed locally on the UE or on the edge server. The system updates decisions at a fixed frequency, dividing time into non-overlapping frames. At the beginning of each frame, the edge server determines the task execution location based on the UE's state (e.g., the number of remaining tasks, the size of data to be unloaded, etc.). The edge server determines the location of the data source, and the user equipment (UE) performs operations accordingly. Finally, the edge server returns the results. The agent is trained to select an appropriate inference strategy under a given task load and device condition. That is, the agent generates the optimal inference strategy based on reinforcement learning, taking into account factors such as device load, network bandwidth, and task complexity, and selects an appropriate inference method (e.g., pure cloud inference, edge-cloud collaborative inference, or edge inference). The agent can adjust according to 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 agent to make the optimal decision in real time based on the current state, thereby reducing inference time and saving energy.
[0091] Preferably, such as Figure 6 As shown, the method for an agent to generate a multi-task inference policy further includes the following steps:
[0092] S401: The DNN inference model is defined after partitioning into residual blocks;
[0093] For example, the DNN can be defined by layers or residual blocks. For a system with N user equipment (UE) terminals, the UE... n The model can be divided into B n +1 part, partition decision b n ∈{0, 1, ..., B n +1},b n =0 indicates that the user equipment (UE) directly offloads the raw input to the edge server, b n =B n +1 indicates that the user equipment (UE) performs inference locally;
[0094] S402: Construct a communication model based on the partitioning results, as well as a latency and energy consumption model;
[0095] For example, the user equipment (UE) transmits data through a specific offload channel, channel c. n ∈1, ..., C, transmit power p n >0, combined with partition point b nThe reasoning action of the user equipment (UE) is represented as (b n c n p n The uplink data rate r between the user equipment (UE) and the edge server n The formula for calculating (π) is:
[0096]
[0097] in, For channel bandwidth, g n For UE n Channel gain between the wireless base station (BS) and the wireless base station (BS). This represents the background noise power of the channel.
[0098] For example, the construction of a latency and energy consumption model based on latency and energy consumption specifically includes:
[0099] Considering the inference latency and energy consumption for each sample, and ignoring the overhead of collecting UE state data, UE n At partition point b n The size of the compressed intermediate feature is fn bits (n=0 represents 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 delay The composition and calculation formula are as follows:
[0100]
[0101] The formula for calculating energy consumption is:
[0102]
[0103] in, and It can be measured on the device.
[0104] S403: Formulate the original problem and transform it into a Markov problem formulation, and construct a concrete Markov solution model;
[0105] For example, the goal of this embodiment is to find the strategy π that minimizes latency and energy consumption when all tasks are completed, for the UE. n Receive K n Given the situation of each task, the optimization problem can be formulated as follows: The constraints are Where p max Here, represents the maximum transmit power of a single UE, and β represents the balancing hyperparameter.
[0106] As a preferred approach, the original problem is a mixed-integer nonlinear programming problem, which is difficult to solve using traditional methods. DRL needs to represent it as an MDP, but because it includes the sum of the latency and energy consumption of each task, there may be unfinished tasks during state transitions, making the latency and energy consumption unavailable. Therefore, considering the average latency and energy consumption of each completed task within each time frame, and ignoring the overhead of unfinished tasks, the problem is reformulated as follows: The constraints are (C1), (C2) and (C3), where T0 represents the duration of a time frame;
[0107] For example, constructing a Markov concrete solution model specifically includes: the MDP consists of a state S, an action A, a state transition probability P, and a reward r, where state S... t It consists of four parts: the number of remaining tasks k t Remaining local computing time t Remaining unloaded data size n t 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 c is the partition point. t To offload the channel, p t Rewards for transmission power Cumulative Rewards Solve the problem by maximizing the cumulative reward;
[0108] S404: An actor-critic optimization algorithm designed to enable intelligent agents to make optimal decisions in real time based on the current state;
[0109] For example, this embodiment employs an actor-critic structure. For multiple user equipment (UEs) in a multi-agent collaborative reasoning scenario, multiple actor networks provide reasoning decisions. The number of actor networks equals the number of UEs. To handle the mixed action space, each actor network adds three output branches to obtain mixed actions. These branches share the coding state information from the previous layers and output partitioning points, offloading channels, and transmit power decisions, respectively. The parameters (θ) of the critic network and actor network are represented by θ and θ, respectively. n For UE n (Corresponding actor network parameters), actor-critic network input state s t It consists of four vectors connected together, and the critic network outputs the predicted state value. Guiding actor network updates, actor network output strategy π θ (at |s t Discrete actions are output by adding a softmax function to determine the action probability. The output mean and standard deviation of continuous actions, and the actions are distributed... Mid-sampling;
[0110] S405: Configure and train specific parameters for the actor-critic optimization algorithm;
[0111] For example, each actor network consists of fully connected layers, with the first two layers shared (containing 256 and 128 neurons respectively). Each output branch has two layers, with the first layer containing 64 neurons. The structure of the last layer is determined by the action type and dimension. The critic network consists of four fully connected layers (containing 256, 128, 64, and 1 neuron 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, a sample reuse count of 10, and hyperparameters λ = 0.95, ∈ = 0.2, ζ = 0.001. During training, trajectories are continuously collected, state values and advantage functions are calculated, and the parameters of the actor and critic networks are updated according to the loss function.
[0112] S406: Finally, the system performance is evaluated based on the inference latency 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] For example, the system performance can be evaluated by measuring the inference latency and energy consumption of different models (such as ResNet18, VGG11, MobileNetV2, etc.) under different numbers of user equipment (UEs). Based on the evaluation results, the balancing hyperparameters can be adjusted to balance latency and energy consumption to meet the needs of different application scenarios. At the same time, the autoencoder structure can be further optimized or other compression methods can be adopted to improve the compression ratio and optimize the system performance, depending on the actual situation.
[0114] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0115] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A cloud-edge collaborative reasoning method based on autoencoders and agents, characterized in that: The method includes the following steps: Step S1: Decompose the complex deep neural network model according to the computational complexity and the hardware performance of the edge device; Step S2: Compress the split parts of the model using knowledge distillation techniques; Step S3: Compress the transmitted data of the intermediate layer of the model based on the lightweight autoencoder structure; Step S4: Simultaneously train an agent to generate inference strategies in real time in a multi-device, multi-task environment; The process of training an agent to generate inference strategies 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: Construct a communication model based on the partitioning results, as well as a latency and energy consumption model; S403: Formulate the original problem and transform it into a Markov problem formulation, while constructing a concrete Markov solution model; S404: An actor-critic optimization algorithm designed to enable intelligent agents to make optimal decisions in real time based on the current state; Specifically, this includes: adopting an actor-critic structure for multiple user equipment (UEs) in multi-agent collaborative reasoning scenarios. Multiple actor networks provide reasoning decisions, with the number of actor networks equal to the number of UEs. To handle the mixed action space, each actor network adds three output branches to obtain mixed actions. These branches share the coding state information from the previous layers, outputting partition points, offloading channels, and transmit power decisions, respectively. The parameters of the critic network and actor network are denoted by θ and y, respectively. n For UE n The corresponding actor network parameters, actor-critic network input state s t It consists of four vectors connected together, and the critic network outputs the predicted state value. Guiding actor network updates, actor network output strategy π θ (a t |s t Discrete actions are output by adding a softmax function to determine the action probability. The output mean and standard deviation of continuous actions, and the actions are distributed... Mid-sampling; S405: Configure and train specific parameters for the actor-critic optimization algorithm; S406: Finally, the system performance is evaluated based on the inference latency and energy consumption of different models under different numbers of user equipment (UEs), and the balancing hyperparameters are adjusted according to the evaluation results.
2. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 1, characterized in that: The method for decomposing complex deep neural network models specifically includes the following steps: S101: Perform preliminary layer-by-layer decomposition on the complex deep neural network model, calculate the accuracy of the decomposed model, and determine the preliminary segmentation point based on the accuracy. S102: Perform a detailed analysis on the output scale of the model after the initial layer-by-layer decomposition, and output the detailed analysis results. The detailed analysis includes the analysis of the number of parameters and the matrix size of each layer of the neural network. The detailed analysis results include the matrix size and computational complexity of the output of each layer of the model. S103: Confirm the final split point based on the specific analysis results; S104: Synchronize and dynamically adjust according to the load of computing tasks.
3. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 2, characterized in that: The method for compressing the split parts of the model using knowledge distillation technology specifically includes the following steps: S201: Perform soft label loss calculation. The student model is trained by minimizing the cross-entropy with the teacher model on soft labels. S202: Perform hard label loss calculation. When the student model outputs, it optimizes the output by using the difference between the real label and the teacher model output. S203: Simultaneously adjust the distillation temperature using a temperature regulation mechanism, wherein the temperature regulation mechanism adjusts the loss in a binary rapid iteration manner. soft The distillation temperature T represents the degree of attention paid to negative labels during training. S204: Finally, the student model was trained and optimized by adjusting hyperparameters and temperature.
4. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 3, characterized in that: 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 with the output of the teacher model, the specific calculation formula is as follows: Among them, Loss soft This represents the cross-entropy between the student model's predicted value and the soft target at the same temperature T. Temperature T indicates the degree of attention given to negative labels during training, and N1 is the total number of labels. This represents the softmax output of the j-th layer of the teacher model, while This represents the corresponding output of the student model at temperature T. and Calculated using the following formula: in It is the logits of the teacher model. It is the logits of the student model.
5. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 4, characterized in that: Step S202 further includes: when the student model receives the real label, it compares the hard label with the output features of the teacher model; when the temperature T=1, it calculates the error between the student model's output and the real label. The specific calculation formula is as follows: Furthermore, the error (Loss) between the generated model's output and the true label is calculated using the cross-entropy loss function. hard Loss hard The formula for calculation is as follows: Where, γ j This is the actual value; The loss function used when training the student model is shown below: Loss=αLoss soft +βLoss hard Here, α and β represent hyperparameters.
6. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 5, characterized in that: The compression of the transmitted data of the intermediate layer of the model based on the lightweight autoencoder structure specifically includes the following steps: S301: Extract transmission data from the intermediate layer of the model as training samples, and preprocess the sample data; S302: Adopts an architecture combining a single-level autoencoder and a quantization module; S303: By learning the latent low-dimensional feature representation of the input data, the autoencoder compresses the dimension of the intermediate data and restores the number of feature channels based on the decoder; S304: Employs quantization technology to further compress the intermediate features output by the encoder, while simultaneously performing inverse quantization on the edge server.
7. The cloud-edge collaborative reasoning method based on autoencoders and agents according to claim 6, characterized in that: Step S405 specifically includes: each actor network consists of fully connected layers, the first two layers are shared, each output branch has two layers, the first layer contains 64 neurons, and the structure of the last layer is determined by the action type and dimension. The critic network consists of 4 fully connected layers. During training, trajectories are continuously collected, state values and advantage functions are calculated, and the parameters of the actor and critic networks are updated according to the loss function.
Citation Information
Patent Citations
Edge cloud extensible task unloading method based on multiple agents
CN113064671A
Cloud edge collaborative data processing method, system and device and storage medium
CN119211229A