AIGC edge-end collaborative reasoning method based on diffusion model

By introducing multi-export U-ViT model and deep reinforcement learning algorithm into the diffusion model, the inference process of edge devices is optimized, the problem of high energy consumption of edge devices is solved, efficient and energy-saving diffusion model inference is achieved, and the application of IoT is improved performance and user experience.

CN119106723APending Publication Date: 2024-12-10TIANJIN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410891392.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The application of existing diffusion models on edge devices leads to significant energy consumption problems, lacks efficient acceleration mechanisms, makes real-time reasoning and efficient collaborative work difficult, and cannot meet the energy efficiency needs of edge devices.

Method used

A multi-export U-ViT model with an early exit mechanism is adopted, combined with a deep reinforcement learning algorithm and an attention-based state embedding strategy network to optimize energy consumption and generation quality to achieve efficient inference on edge devices.

Benefits of technology

It significantly improves inference efficiency and energy efficiency, realizes high-quality content generation on edge devices with limited resources, meets strict energy efficiency requirements, and improves the overall performance and user experience of IoT applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106723A_ABST
    Figure CN119106723A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of AIGC, and discloses an AIGC side-end collaborative reasoning method based on a diffusion model, and the method comprises the following steps: S1, constructing a multi-exit U-Net network, and achieving a multi-exit mechanism; s2, designing a decision strategy of a collaborative reasoning service problem based on a learning algorithm of deep reinforcement learning; s3, designing an attention-based state embedding strategy network, and further improving the state sensing capability of the strategy network in the diffusion process; and S4, evaluating the energy consumption of the model and the quality of the generated image. According to the AIGC edge-end collaborative reasoning method based on the diffusion model, reasoning accuracy and processing time are effectively balanced, generation quality and energy efficiency are improved, content quality and energy use are optimized in a dynamic edge environment, efficient and energy-saving diffusion model reasoning on edge equipment is achieved, and the efficiency of the AIGC edge-end collaborative reasoning method based on the diffusion model is improved. And the overall performance and the user experience of the Internet of Things application are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of AIGC technology, and in particular to an AIGC edge collaborative reasoning method based on a diffusion model. Background Art

[0002] In recent years, diffusion models have made revolutionary progress in the field of image generation. It has not only promoted the application of artificial intelligence in the art industry, but also opened up new paths for the application of the Internet of Things (IoT). By leveraging the large number of sensors in the IoT, diffusion models can generate high-quality content for scene reconstruction, vehicle navigation, and user interaction enhancement.

[0003] Although diffusion models have demonstrated powerful AI-generated content (AIGC) techniques in the IoT space, their application on edge devices has brought significant energy consumption issues. These models rely on complex neural network structures that require a lot of computing resources to gradually adjust random noise in multiple steps. However, most edge devices, such as smartphones, virtual reality devices, and smart vehicles, lack the processing power required to run these complex models. Therefore, users usually rely on cloud computing services, with high-energy cloud GPUs performing inference processing. This approach not only has challenges in network sensitivity and generation quality, but also adds the high energy consumption problem of remote processing and data transmission.

[0004] Therefore, most of the existing work lacks an efficient acceleration mechanism for the diffusion model in the edge network, which makes it difficult to achieve real-time reasoning on resource-limited edge devices. Moreover, most of them fail to systematically model and solve the collaborative reasoning problem of the diffusion model on edge devices, and cannot achieve efficient collaborative work in a multi-device environment. They cannot fully consider energy efficiency constraints, resulting in high energy consumption in practical applications and difficulty in meeting the energy efficiency requirements of edge devices.

[0005] In order to solve the above problems, the present invention proposes an AIGC edge collaborative reasoning method based on a diffusion model to overcome the defects and shortcomings of the prior art. Summary of the invention

[0006] The purpose of the present invention is to provide an AIGC edge collaborative reasoning method based on a diffusion model, which adopts a multi-exit U-ViT model with an early exit mechanism, allows dynamic selection of exit points, and effectively balances the accuracy and processing time of reasoning; in the decision-making stage, a decision algorithm is introduced to guide the offloading settings and exit threshold parameters of edge devices; in addition, a deep reinforcement learning (DRL) algorithm assisted by generative artificial intelligence is used to improve the generation quality and energy efficiency; the algorithm utilizes an attention-based state embedding policy network to optimize content quality and energy usage in a dynamic edge environment, realizes efficient and energy-saving diffusion model reasoning on edge devices, and improves the overall performance and user experience of IoT applications.

[0007] To achieve the above object, the present invention provides an AIGC edge collaborative reasoning method based on a diffusion model, comprising the following steps:

[0008] S1. Build a multi-exit U-Net network to implement a multi-exit mechanism;

[0009] S2. Design decision strategies for collaborative reasoning service problems based on deep reinforcement learning learning algorithms;

[0010] S3. Design an attention-based state embedding strategy network to further improve the state perception ability of the strategy network during the diffusion process;

[0011] S4. Evaluate the energy consumption of the model and the quality of the generated images.

[0012] Preferably, in step S1, for the U-ViT network, the intermediate results of the kth layer and the (k+1th layer) are represented as I k and I k+1 , then the difference between the intermediate results of adjacent attention blocks is D k,k+1 , as shown below:

[0013] D k,k+1 =MSE(I k -I k+1 )

[0014] Among them, when D k,k+1 When it is small, it indicates that the outputs of adjacent layers are highly similar;

[0015] In order to optimize the exit timing, a counter cnt is introduced to track the frequency of the intermediate results remaining basically unchanged. The counter cnt of each layer k The calculation is as follows:

[0016]

[0017] Preferably, in step S2, based on the learning algorithm of deep reinforcement learning, the task offloading problem is reformulated as a Markov decision process, as follows:

[0018] S21. First, define the state, action, and reward space;

[0019] S211. Observation space: The observation space of device n in each time slot is defined as:

[0020]

[0021] in, Metadata representing the current task, including denoising steps, resolution requirements, and device computing capabilities; Indicates the computing conditions of edge nodes, including computing power and current occupancy level; Indicates the communication status of the time slot;

[0022] S212, Action Space: For different observations, the model will make decisions about offloading and reasoning settings, and the action space is defined as:

[0023]

[0024] in, represents a binary unloading decision; Indicates uninstall server selection; Indicates the number of local denoising steps for the current task; represents the exit counter setting of the reasoning process;

[0025] S213, Reward function: The reward function of the reasoning task is directly related to the optimization goal in the formula, so the reward function R of device n at time slot t is defined as n,t , as shown below:

[0026]

[0027] Among them, E max (n) is the maximum energy consumption that the device can tolerate;

[0028] S22. Generative AI-assisted reinforcement learning algorithm using a soft actor-critic framework; the framework includes an actor network, a dual critic network, a target network, and a replay store; the actor network interacts with the environment and records observations and actions as transfers (O n ,A n ,R t ,R t+1 ) are stored in the replay buffer, and the algorithm uses the transfer of these stores to optimize the network.

[0029] Preferably, in the input phase of step S3, an attention-based state embedding network is constructed to map diffusion time steps and observations to embedded states, so that the policy network can better perceive state changes in a small number of diffusion steps;

[0030] During training, the general form of the SAC algorithm is followed as follows:

[0031] V(ψ,s t )=Ea t ~π[Qθ(s t ,a t )+αH t ]

[0032] Q θ (s t ,a t )=E st+1 ~ε[r(s t ,a t )+γ(V(ψ,s t+1 )+αH t+1 )]

[0033]

[0034] Among them, s t and a t Respectively represent the state and action at time t; V(ψ,s t ) is the value function determined by the parameter ψ; Q θ (s t ,a t ) is the action value function determined by the parameter θ; H t is the entropy, defined as -logπ φ (a t |s t );π φ (a t |s t ) is the policy function; r(s t ,a t ) represents the immediate reward, and γ is the discount factor used to calculate the present value of future rewards.

[0035] Preferably, a mobile edge computing system for device-edge collaborative AIGC services consists of a group of edge nodes and a set of client devices Composition, time is divided into several time slots, represented as a time slot set Each edge node is deployed on a base station to provide services to users. Each client device within the service range accesses the node through a wireless link and obtains computing services.

[0036] Preferably, in step S4, n The denoising process of the step is divided into local operations s l and the operations performed by the server o , the energy consumption of the model and the quality of the generated images are evaluated. The specific process is as follows:

[0037] S41. First, the energy consumption of the model is estimated;

[0038] Given the exit counter threshold p and the number of local denoising steps s l , the local inference time of device n is expressed as The local inference time of edge server m is expressed as

[0039] The energy consumption of local device n is estimated as follows:

[0040]

[0041] The energy consumption of edge server m is estimated as follows:

[0042]

[0043] Among them, e is the energy consumption coefficient, U is the service occupancy rate, and f is the calculation frequency;

[0044] S42. Secondly, the quality of the generated images is evaluated; the structural similarity index SSIM and peak signal-to-noise ratio PSNR are used to quantify the quality changes caused by early exit during the diffusion process;

[0045] The calculation formula of SSIM is as follows:

[0046]

[0047] The calculation formula of PSNR is as follows:

[0048]

[0049] Among them, MAX I is the maximum possible pixel value of the image; MSE(x,y) is the mean square error between the original image and the distorted image;

[0050] S43. To evaluate the quality of early exit output, establish a comprehensive quality index Q n (t), the calculation formula is as follows:

[0051]

[0052] Among them, Norm represents the normalization operation based on all test data values.

[0053] Therefore, the present invention adopts the above-mentioned AIGC edge collaborative reasoning method based on the diffusion model, and the beneficial effects are as follows:

[0054] 1. Dynamic multi-exit model improves reasoning efficiency: The present invention designs and implements a U-ViT model with a dynamic multi-exit mechanism, which can flexibly select the optimal exit point during the reasoning process, thereby significantly improving computing efficiency; the model uses a multi-level exit mechanism to enable the reasoning process to exit early when specific accuracy standards are met, reducing unnecessary computing overhead; especially when edge device resources are limited, this optimization can effectively avoid the delay problem caused by insufficient computing resources in traditional methods, and achieve faster real-time reasoning.

[0055] 2. Intelligent balance between generation quality and energy consumption: This paper proposes a generative AI-assisted deep reinforcement learning (DRL) algorithm that focuses on maximizing global task benefits. The algorithm combines generative AI and deep reinforcement learning, and can adaptively adjust parameters in a dynamic environment to achieve an intelligent balance between generation quality and energy consumption. By building a complex reward mechanism, the system can significantly reduce energy consumption while generating high-quality content, achieving efficient energy utilization. This breakthrough enables high-quality content generation on resource-constrained edge devices, meeting stringent energy efficiency requirements.

[0056] 3. Strengthen the perception ability of the decision network: This invention introduces an attention-based state embedding strategy network, which enables the decision network to perceive the state-action relationship more accurately. Through this innovative technology, the system can respond quickly and make optimized decisions in complex dynamic edge environments; this network structure not only improves the learning ability of the strategy network, but also enables it to maintain efficient decision-making performance when facing variable input data, thereby greatly improving the accuracy and response speed of the overall system; in multi-device collaborative reasoning, this technology can effectively coordinate the computing resources of each device and optimize the overall reasoning efficiency.

[0057] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a flow chart of an AIGC edge collaborative reasoning method based on a diffusion model of the present invention;

[0059] Figure 2 It is the multi-exit U-Net network structure of the present invention;

[0060] Figure 3 It is the state embedding network structure based on attention of the present invention;

[0061] Figure 4 It is a collaborative reasoning framework diagram of the present invention;

[0062] Figure 5 : is the comparison result of the early exit performance of the present invention; wherein, (a) is the SSIM value under different settings; (b) is the PSNR value under different settings;

[0063] Figure 6 It is the task reward performance of the present invention; wherein, (a) is the comparison result of the average task reward of different algorithms in all tasks; (b) is the comparison result of the energy consumption performance of different algorithms in all tasks; (c) is the comparison result of the algorithms for generating quality gain functions under different numbers of devices. DETAILED DESCRIPTION

[0064] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0065] like Figure 1 As shown, the present invention provides an AIGC edge collaborative reasoning method based on a diffusion model, comprising the following steps:

[0066] S1. Build a multi-exit U-Net network to implement a multi-exit mechanism;

[0067] S2. Design decision strategies for collaborative reasoning service problems based on deep reinforcement learning learning algorithms;

[0068] S3. Design an attention-based state embedding strategy network to further improve the state perception ability of the strategy network during the diffusion process;

[0069] S4. Evaluate the energy consumption of the model and the quality of the generated images.

[0070] Example

[0071] The present invention provides an AIGC edge collaborative reasoning method based on a diffusion model, comprising the following steps:

[0072] S1. Build a multi-exit U-Net network to implement a multi-exit mechanism.

[0073] In order to achieve efficient network inference in the reverse denoising of the diffusion process, one of the most direct and effective methods is to optimize the backbone network itself. Therefore, a multi-exit U-Net network is designed to implement the multi-exit mechanism in the U-ViT model. The network structure is as follows Figure 2 shown.

[0074] Network reasoning in the diffusion process is essentially a regression task. It is challenging to directly evaluate the confidence of intermediate results. Calculating the squared difference between two intermediate results is a simple and effective method in regression tasks.

[0075] For the U-ViT network, the intermediate results of the kth layer and the (k+1th layer) are represented as I k and I k+1 , then the difference D between the intermediate results of adjacent attention blocks k,k+1 , as shown below:

[0076] D k,k+1 =MSE(I k -I k+1 )

[0077] Among them, the smaller D k,k+1 This indicates that the outputs of adjacent layers are highly similar. k,k+1 When it is lower than the predefined threshold τ, it indicates that the output of the (k+1)th layer is very close to the output of the kth layer. This situation usually indicates that no new useful information is obtained during further processing, which is the so-called "overthinking" phenomenon. Therefore, it is beneficial to choose to exit early at this stage.

[0078] In order to optimize the exit timing, a counter cnt is introduced to track the frequency of intermediate results remaining basically unchanged. k The calculation is as follows:

[0079]

[0080] S2. Design decision-making strategies for collaborative reasoning service problems based on deep reinforcement learning learning algorithms.

[0081] Since the collaborative reasoning service problem in step S2 is a target optimization problem with coupling constraints, its core is the task offloading problem in a dynamic environment. In order to solve the uncertainty in the decision-making process, a learning algorithm based on deep reinforcement learning is proposed. Therefore, the task offloading problem will be reformulated as a Markov decision process (MDP), such as Figure 4 shown.

[0082] S21. First, define the state, action, and reward space.

[0083] S211. Observation space: The observation space of device n in each time slot is defined as:

[0084]

[0085] in, Metadata representing the current task, including denoising steps, resolution requirements, and device computing capabilities; Indicates the computing conditions of edge nodes, including computing power and current occupancy level; Indicates the communication status of this time slot.

[0086] S212, Action Space: For different observations, the model will make decisions about offloading and reasoning settings, and the action space is defined as:

[0087]

[0088] in, represents a binary unloading decision; Indicates uninstall server selection; Indicates the number of local denoising steps for the current task; Indicates the exit counter setting for the inference process.

[0089] The setting of p is controlled by the algorithm, and the setting of τ is fixed based on previous experience. This simplification is because the common purpose of p and τ is to select the exit point and further control the output quality. Therefore, letting the model learn only one threshold can reduce the instability during training.

[0090] S213, Reward function: The reward function of the reasoning task is directly related to the optimization goal in the formula, so the reward function R of device n at time slot t is defined as n,t , as shown below:

[0091]

[0092] Among them, E max (n) is the maximum energy consumption that the device can tolerate. The present invention uses the energy consumption of completely local execution as E max If the energy consumption after unloading exceeds this maximum tolerance value, it means that this is a bad unloading decision.

[0093] S22. The generative AI-assisted reinforcement learning algorithm adopts a soft actor-critic framework, which includes an actor network, a dual critic network, a target network, and a replay memory. The actor network interacts with the environment and records observations and actions as transfers (O n ,a n ,R t ,R t+1 ) are stored in the replay buffer, and the algorithm uses the transfer of these stores to optimize the network.

[0094] Based on the above-mentioned decision-making algorithm, the policy network π θ The forward process is replaced by a decision denoising process based on the diffusion model, which has a powerful ability to capture the dependencies between observations and actions, proving the effectiveness of the diffusion process in policy networks.

[0095] S3. Design an attention-based state embedding strategy network to further improve the state perception ability of the strategy network during the diffusion process.

[0096] In the input stage, a lightweight attention-based state embedding network is constructed, such as Figure 3 As shown, the diffusion time steps and observations are mapped to embedded states, allowing the policy network to better perceive state changes in a small number of diffusion steps. During training, the general form of the SAC algorithm is followed as follows:

[0097] V(ψ,s t )=Ea t ~π[Qθ( s t,a t )+αH t ]

[0098] Q θ (s t ,a t )=E st+1 ~ε[r(s t ,a t )+γ(V(ψ,s t+1 )+αH t+1 )]

[0099]

[0100] Among them, s t and a t Respectively represent the state and action at time t; V(ψ,s t ) is the value function determined by the parameter ψ; Q θ (s t ,,a t ) is the action value function determined by the parameter θ; H t is the entropy, defined as -logπ φ (a t |s t );π φ (a t |s t ) is the policy function; r(s t ,a t ) represents the immediate reward, and γ is the discount factor used to calculate the present value of future rewards.

[0101] S4. Evaluate the energy consumption of the model and the quality of the generated images.

[0102] This paper focuses on the problem of service offloading in resource-constrained edge networks. Figure 4 As shown in the figure, a mobile edge computing system for device-edge collaborative AIGC service consists of a group of edge nodes and a set of client devices Each edge node is deployed on a base station to provide services to users. This means that every client device within the service range can access the node through a wireless link and obtain computing services; time is divided into several time slots, represented as a time slot set

[0103] According to the above system, based on the early exit point selection mechanism, an AIGC edge collaborative reasoning method based on the diffusion model is proposed. Among them, the early exit point selection mechanism is mainly implemented through the exit counter. In the collaborative reasoning workflow, n The denoising process of the step is divided into local operations s l and the operations performed by the server o .

[0104] S41. First, estimate the model energy consumption. Given the exit counter threshold p and the number of local denoising steps s l , the local inference time of device n is expressed as The local inference time of edge server m is expressed as

[0105] The energy consumption of local device n is estimated as follows:

[0106]

[0107] Among them, e n is the energy consumption coefficient, U n is the service occupancy rate, f n is the calculation frequency.

[0108] The energy consumption of edge server m is estimated as follows:

[0109]

[0110] S42. Secondly, the quality of the generated images is evaluated. The structural similarity index (SSIM) and peak signal-to-noise ratio (PSNR) are used to quantify the quality change caused by premature exit during the diffusion process.

[0111] SSIM is an indicator used to measure the similarity between two images. It takes into account the brightness, contrast and structure of the image. The calculation formula of SSIM is as follows:

[0112]

[0113] PSNR is an indicator to measure the quality of image reconstruction and is often used in fields such as image compression. PSNR represents the difference between the original image and the distorted image. The calculation formula is as follows:

[0114]

[0115] Among them, MAX I is the maximum possible pixel value of the image; for example, for an 8-bit image MAX I = 255. MSE(x,y) is the mean square error between the original image and the distorted image.

[0116] S43. To evaluate the quality of early exit output, establish a comprehensive quality index Q n (t), the calculation formula is as follows:

[0117]

[0118] Among them, Norm represents the normalization operation based on all test data values. These two indicators are considered comprehensively to evaluate image quality based on physical and visual perception differences.

[0119] The proposed multi-exit U-ViT model is trained on two datasets and 50,000 images are generated, with calculated FID values ​​of 3.82 and 4.21 respectively. To further measure the quality loss caused by early exit, 10,000 images are generated at all exit count thresholds. The average SSIM and PSNR values ​​of the four sets of generated data are calculated with thresholds ranging from 1 to 4, and without early exit (i.e., threshold 5). The results are shown in Figure 2. Figure 5 shown.

[0120] Note that the PNSR value is the value before normalization. When τ is 0.05, most of the reasoning tasks exit early at the set exit point. As the threshold increases, the values ​​of these two indicators continue to increase. It can be found that even in the earliest exit case, the loss of generation quality is acceptable. This proves that the model proposed in this invention can maintain generation quality while reducing the number of reasoning layers.

[0121] like Figure 6 As shown, the task reward performance of the present invention is demonstrated. Among them, Figure 6 (a) in Figure 2 shows the average task rewards of different algorithms in all tasks. As the number of devices increases, Ours outperforms other algorithms in most cases. The task reward of the proposed model reaches its maximum value when the number of devices is 50, exceeding Diff-SAC by 18.6%. On the other hand, Diff-SAC shows an overall downward trend. This indicates that the proposed state embedding network performs better in dealing with high congestion environments. Compared with Local, PPO and Random have lower average task rewards.

[0122] Figure 6(b) in Figure 2 studies the energy performance of various algorithms. As the number of tasks increases, the average energy reward of the Diff-SAC algorithm shows a downward trend and eventually performs worse than Local. In contrast, Ours can effectively adapt to high task loads and optimize energy-efficient offloading schemes, outperforming Diff-SAC by 10.3% to 28.7%. In contrast, Random and PPO perform poorly in managing energy consumption.

[0123] Figure 6 (c) in Figure 1 shows the algorithm comparison results of the quality gain function under different numbers of devices. It can be found that Ours is close to Local in most cases, but it does not achieve the best results. This is because the strategy of the present invention pays more attention to energy efficiency, which means that in some cases, the exit strategy will sacrifice some generation quality. Since Random is more likely to choose to execute all network layers, it achieves the best results.

[0124] Therefore, the present invention adopts the above-mentioned AIGC edge collaborative reasoning method based on the diffusion model, adopts a multi-exit U-ViT model with an early exit mechanism, allows dynamic selection of exit points, and effectively balances the accuracy and processing time of reasoning; in the decision-making stage, a decision algorithm is introduced to guide the unloading settings and exit threshold parameters of edge devices. In addition, a deep reinforcement learning (DRL) algorithm assisted by generative artificial intelligence is used to improve the generation quality and energy efficiency; the algorithm uses an attention-based state embedding policy network to optimize content quality and energy usage in a dynamic edge environment, realizes efficient and energy-saving diffusion model reasoning on edge devices, and improves the overall performance and user experience of IoT applications.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. An AIGC edge collaborative reasoning method based on a diffusion model, characterized in that: The following steps are involved: S1. Build a multi-exit U-Net network to implement a multi-exit mechanism; S2. Design decision strategies for collaborative reasoning service problems based on deep reinforcement learning learning algorithms; S3. Design an attention-based state embedding strategy network to further improve the state perception ability of the strategy network during the diffusion process; S4. Evaluate the energy consumption of the model and the quality of the generated images.

2. According to the diffusion model-based AIGC edge collaborative reasoning method of claim 1, it is characterized in that: In step S1, for the U-ViT network, the intermediate results of the kth layer and the (k+1th layer) are represented as I k and I k+1 , then the difference D between the intermediate results of adjacent attention blocks k,k+1 , as shown below: D k,k+1 =MSE(I k -I k+1 ) Among them, when D k,k+1 When it is small, it indicates that the outputs of adjacent layers are highly similar; In order to optimize the exit timing, a counter cnt is introduced to track the frequency of the intermediate results remaining basically unchanged. The counter cnt of each layer k The calculation is as follows:

3. According to the diffusion model-based AIGC edge collaborative reasoning method of claim 1, it is characterized in that: In step S2, based on the learning algorithm of deep reinforcement learning, the task offloading problem is reformulated as a Markov decision process as follows: S21. First, define the state, action, and reward space; S211. Observation space: The observation space of device n in each time slot is defined as: in, Metadata representing the current task, including denoising steps, resolution requirements, and device computing capabilities; Indicates the computing conditions of edge nodes, including computing power and current occupancy level; Indicates the communication status of the time slot; S212, Action Space: For different observations, the model will make decisions about offloading and reasoning settings, and the action space is defined as: in, represents a binary unloading decision; Indicates uninstall server selection; Indicates the number of local denoising steps for the current task; represents the exit counter setting of the reasoning process; S213, Reward function: The reward function of the reasoning task is directly related to the optimization goal in the formula, so the reward function R of device n at time slot t is defined as n,t , as shown below: Among them, E max (n) is the maximum energy consumption that the device can tolerate; S22. Generative AI-assisted reinforcement learning algorithm using a soft actor-critic framework; the framework includes an actor network, a dual critic network, a target network, and a replay store; the actor network interacts with the environment and records observations and actions as transfers (O n ,A n ,R t ,R t+1 ) are stored in the replay buffer, and the algorithm uses the transfer of these stores to optimize the network.

4. The AIGC edge collaborative reasoning method based on a diffusion model according to claim 1, characterized in that: In the input phase of step S3, an attention-based state embedding network is constructed to map diffusion time steps and observations to embedded states, so that the policy network can better perceive state changes in a small number of diffusion steps; During training, the general form of the SAC algorithm is followed as follows: V(ψ,s t )=Ea t ~π[Qθ(s t ,a t )+αH t ] Q θ (s t ,a t )=E st+1 ~ε[r(s t ,a t )+γ(V(ψ,s t+1 )+αH t+1 )] Among them, s t and a t Respectively represent the state and action at time t; V(ψ,s t ) is the value function determined by the parameter ψ; Q θ (s t ,a t ) is the action value function determined by the parameter θ; H t is the entropy, defined as -logπ φ (a t |s t );π φ (a t |s t ) is the policy function; r(s t ,a t ) represents the immediate reward, and γ is the discount factor used to calculate the present value of future rewards.

5. The AIGC edge collaborative reasoning method based on a diffusion model according to claim 1, characterized in that: A mobile edge computing system for device-edge collaborative AIGC services, consisting of a set of edge nodes and a set of client devices Composition, time is divided into several time slots, represented as a time slot set Each edge node is deployed on a base station to provide services to users. Each client device within the service range accesses the node through a wireless link and obtains computing services.

6. According to the diffusion model-based AIGC edge collaborative reasoning method of claim 1, it is characterized in that: In step S4, the n The denoising process of the step is divided into local operations s l and the operations performed by the server o , the energy consumption of the model and the quality of the generated images are evaluated. The specific process is as follows: S41. First, the energy consumption of the model is estimated; Given the exit counter threshold p and the number of local denoising steps s l , the local inference time of device n is expressed as The local inference time of edge server m is expressed as The energy consumption of local device n is estimated as follows: The energy consumption of edge server m is estimated as follows: Among them, e is the energy consumption coefficient, U is the service occupancy rate, and f is the calculation frequency; S42. Secondly, the quality of the generated images is evaluated; the structural similarity index SSIM and peak signal-to-noise ratio PSNR are used to quantify the quality changes caused by early exit during the diffusion process; The calculation formula of SSIM is as follows: The calculation formula of PSNR is as follows: Among them, MAX I is the maximum possible pixel value of the image; MSE(x,y) is the mean square error between the original image and the distorted image; S43. To evaluate the quality of early exit output, establish a comprehensive quality index Q n (t), the calculation formula is as follows: Among them, Norm represents the normalization operation based on all test data values.

Citation Information

Cited By

  • Edge collaborative reasoning optimization method for generative artificial intelligence service

    CN119473640A

  • Unmanned aerial vehicle edge computing network resource allocation method based on diffusion model

    CN119946723A