An edge cloud collaboration model test self-adaptive method, system, device and medium
By using an adaptive approach during edge-cloud collaborative model testing, edge devices upload statistical information to the cloud to generate pseudo-samples and optimize model parameters. This solves the problems of limited computing resources and data privacy protection on edge devices, and achieves efficient model adaptation and performance improvement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2023-08-22
- Publication Date
- 2026-07-21
AI Technical Summary
Deploying deep neural network models on edge devices presents challenges such as limited computing resources and data privacy protection, as well as performance degradation due to distribution offset. Existing testing methods are also insufficient in terms of efficiency and data transmission.
When testing the edge-cloud collaborative model, an adaptive method is used. Edge devices upload statistical information and logical outputs to the cloud. The cloud performs joint estimation to generate pseudo-samples and optimizes model parameters. Edge devices then update their local models for inference.
It achieves efficient model adaptation on edge devices, protects data privacy, reduces data transmission volume, improves model performance and computational efficiency, and is suitable for resource-constrained edge computing environments.
Smart Images

Figure CN116974769B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of edge computing and Internet of Things (IoT) technology, and in particular to an adaptive method, apparatus and storage medium for testing edge-cloud collaborative models. Background Technology
[0002] Deep neural networks have been widely applied in fields such as computer vision and natural language processing. However, their massive number of parameters leads to high computational costs, which means that the training and inference of these network models are often carried out in cloud data centers. However, in certain application scenarios that emphasize data privacy and response speed, there is a preference for deploying deep neural network models directly on edge devices. Moving deep network model deployment and inference from the cloud to the edge faces a series of challenges. For example, the degradation of sensor performance on edge devices and dynamic changes in the environment (such as changes in weather and lighting) can cause a shift in the distribution between test samples and training samples. Deep models are often very sensitive to these distribution shifts, so performance can degrade significantly on test samples with shifted distributions.
[0003] To address this distribution shift issue, current solutions employ test-time adaptive methods. These methods require updating the model on the deployed inference device based on the current test samples to better fit the current data and achieve improved model performance. Currently, two main test-time adaptive methods exist. First, one approach re-estimates the statistics of the batch normalization layer based on the current test samples. However, while effective to some extent, this method is performance-limited and performs poorly when handling small batches. The other approach utilizes a self-supervised learning strategy to perform gradient descent to optimize model parameters. However, this method requires significant computational resources and introduces unavoidable inference latency, making it unsuitable for resource-constrained scenarios such as edge devices.
[0004] Faced with these challenges, finding a method that can improve both computational efficiency and model performance has become an urgent problem to be solved. Summary of the Invention
[0005] In order to at least partially solve one of the technical problems existing in the prior art, the present invention aims to provide an adaptive method, device and storage medium for testing edge-cloud collaborative models.
[0006] The technical solution adopted in this invention is:
[0007] An adaptive method for testing an edge-cloud collaborative model includes the following steps:
[0008] Each edge device performs model inference operations, acquires and uploads statistical information and logical output to the cloud;
[0009] The cloud performs joint estimation on the information uploaded by edge devices;
[0010] The cloud generates pseudo-samples based on the combined statistical information data from various edge devices;
[0011] The cloud-based system optimizes model parameters based on pseudo-samples and then sends the optimized model parameters to edge devices.
[0012] Edge devices update their local models based on the model parameters sent from the cloud and then perform subsequent sample inference operations.
[0013] Furthermore, each edge device performs model inference operations, acquires and uploads statistical data and logical outputs to the cloud, including:
[0014] Given a batch of test samples The model of the edge device first performs forward propagation on the test samples to complete the inference process;
[0015] During the inference process, for each batch of normalization layers of the model, statistical information is calculated based on the sample characteristics; this statistical information includes the mean μ and the variance σ. 2 ;
[0016] Based on the calculated batch mean μ and variance σ 2 Obtain the output of the batch normalization layer:
[0017] The mean μ and variance σ of all batch normalized layers 2 And the final logic output y is uploaded to the cloud.
[0018] Furthermore, the expression for the output of the batch normalization layer is as follows:
[0019]
[0020]
[0021] In the formula, x is the output of the batch normalization layer, and γ and β are learnable affine parameters.
[0022] Furthermore, the cloud performs joint estimation of the information uploaded by the edge device, including:
[0023] The following formula is used to combine the statistical information from each edge device to estimate the global statistical information:
[0024]
[0025]
[0026] Where B represents the number of edge devices, nb μ represents the number of inference samples on the b-th edge device. b Let σ represent the mean statistic of the inference samples on the b-th edge device. b ) 2 Let represent the variance statistic of the inference sample on the b-th edge device.
[0027] Furthermore, the cloud generates pseudo-samples based on the joint statistical information data from each edge device, including:
[0028] A1. Sample a batch of pseudo-samples χ from a standard Gaussian distribution;
[0029] A2. Send the pseudo-samples into the model in the cloud for forward propagation, and calculate the mean and variance of the samples in the batch normalization layer.
[0030] A3. Calculate the loss function; the loss function includes the statistical information alignment loss function and the prediction logical information alignment loss function;
[0031] A4. Repeat steps A2-A3 until the pseudo-sample χ converges.
[0032] Furthermore, the expression for the statistical information alignment loss function is as follows:
[0033]
[0034] In the formula, μ′ l and σ′ l This represents the statistical information of spurious samples; and This indicates the statistical information for the joint estimation of the entire data;
[0035] The expression for the prediction logic information alignment loss function is as follows:
[0036]
[0037] In the formula, N is the number of pseudo-samples, f θ (x′ n f represents the output of the cloud model on pseudo-samples. θ (x n ) represents the model output of the edge samples uploaded by the edge device, and ||||2 represents the L2 norm.
[0038] Furthermore, the cloud-based optimization of model parameters based on pseudo-samples includes:
[0039] Based on the generated pseudo-sample χ, update the parameters of the cloud model by minimizing the entropy predicted by the model:
[0040]
[0041] in, Here are the parameters to be optimized in the model, and c is the number of classes. This refers to the predicted output of the model.
[0042] Another technical solution adopted in this invention is:
[0043] An adaptive system for testing an edge-cloud collaborative model includes:
[0044] The statistics upload module is used by each edge device to perform model inference operations, obtain and upload statistical information and logical output to the cloud;
[0045] The joint estimation module is used to perform joint estimation of information uploaded by edge devices in the cloud.
[0046] The sample generation module is used to generate pseudo-samples in the cloud based on the joint statistical information data of various edge devices;
[0047] The model optimization module is used to optimize model parameters in the cloud based on pseudo-samples and then send the optimized model parameters to edge devices.
[0048] The parameter update module is used by edge devices to update the local model based on the model parameters sent from the cloud and to perform subsequent sample inference operations.
[0049] Another technical solution adopted in this invention is:
[0050] An adaptive device for testing an edge-cloud collaborative model includes:
[0051] At least one processor;
[0052] At least one memory for storing at least one program;
[0053] When the at least one program is executed by the at least one processor, the at least one processor performs the method as described above.
[0054] Another technical solution adopted in this invention is:
[0055] A computer-readable storage medium storing a processor-executable program, which, when executed by a processor, performs the method described above.
[0056] The beneficial effects of this invention are: by coordinating model adaptation between the cloud and edge devices, this invention avoids introducing additional computing costs on edge devices; in addition, it introduces an innovative cloud-based model adaptation scheme, which enables model adaptation without transmitting raw data on edge devices, effectively protecting data privacy. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a comparison chart of edge device local model adaptation and edge-cloud collaborative model adaptation;
[0059] Figure 2 This is a flowchart of an adaptive method for testing a privacy-preserving edge-cloud collaborative model in an embodiment of the present invention. Detailed Implementation
[0060] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0061] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0062] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0063] Furthermore, in the description of this invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0064] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0065] Collaboration between edge devices and the cloud has become a focus of attention. Through collaborative learning among edge devices, models can be jointly learned and optimized while maintaining data privacy, thus better adapting to data distribution in edge environments. On the other hand, collaboration between edge devices and the cloud can also achieve a balance in resource allocation, offloading some computing tasks to the cloud to reduce the burden on edge devices while fully utilizing cloud computing power. This invention will describe a novel cloud-edge collaborative model adaptation method, such as... Figure 1 As shown, it can better address the challenges posed by distribution shifts and, while ensuring data privacy and computational efficiency, further promote the application of deep network models on edge devices, thereby achieving a more intelligent and adaptable system.
[0066] The overall solution of this invention is as follows: Figure 2 As shown, each edge device first performs basic model inference operations. Then, each edge device sends the statistical information of all batch normalized layers in the model and the prediction results of the current test sample to the cloud. Afterward, it waits for the cloud to send updated parameters, which are then merged into the local model for subsequent sample inference operations. In the cloud, it receives the statistical and prediction information uploaded from the edge devices. First, it generates "pseudo-samples" consistent with the edge device's sample distribution based on this information. Then, it uses these pseudo-samples to update the cloud-side model using a self-supervised update algorithm. Finally, it sends the updated model parameters to the edge devices. This completes one iteration, and the cloud server waits for the next batch of edge sample information. Through this collaborative approach, the invention fully utilizes the advantages of both the cloud and edge devices to achieve an efficient test-time adaptation process, thereby improving the model's performance on edge devices. The following will combine... Figure 2 Each step in the diagram is explained in detail.
[0067] See Figure 2This embodiment provides an adaptive method for testing a privacy-preserving edge-cloud collaborative model. It fully considers the actual situation of edge devices and achieves multiple advantages, including high efficiency, data privacy protection, and low data transmission during inference. The method includes the following steps:
[0068] S1. Each edge device performs model inference operations, obtains and uploads statistical information and logical output to the cloud.
[0069] Given a batch of test samples The model first undergoes forward propagation to complete the normal inference process. During this process, for each batch of normalization layers, the mean μ and variance σ are calculated based on the characteristics of the field samples. 2 Statistical information, etc. Note that the mean and variance generated by the exponential moving average during model training are not used here; these recalculated means and variances in-process better reflect the distribution of the test samples. The output of the batch normalization layer can be obtained by recalculating the batch mean and variance. in γ and β are learnable affine parameters. The mean μ and variance σ of all batch-normalized layers are calculated. 2 The logic output y of the last layer is sent to the cloud side, waiting for the cloud side to send updated parameters.
[0070] S2. The cloud performs joint estimation on the information uploaded by edge devices.
[0071] In step S1, the sample statistics uploaded by each device only include the samples inferred by itself. Since the number of samples K is small in practice (even 1), it may lead to very inaccurate estimation of the sample statistics. Therefore, the following formulas (1)-(2) are used to estimate the global statistical information by combining the statistical information of each edge device. This can effectively solve the problem of inaccurate estimation of the sample statistics of a certain edge device.
[0072]
[0073]
[0074] Where B represents the number of edge devices, n b μ represents the number of inference samples on the b-th edge device. b Let σ represent the mean statistic of the inference samples on the b-th edge device. b ) 2 Let represent the variance statistic of the inference sample on the b-th edge device.
[0075] The above formulas (1)-(2) are essentially the same as the following formulas (3)-(4):
[0076]
[0077]
[0078] This approach is mathematically identical to sending the original samples to the cloud to calculate the mean and variance of all batch normalized layers. Compared to sending the original samples, this technical solution has the following advantages: 1) Protecting user privacy. Edge devices transmit statistical information to the cloud, which cannot be used to reconstruct the original samples. Therefore, even if the communication channel or cloud server is attacked, the original test sample information on the edge side will not be leaked. 2) Saving data communication volume between the edge and cloud sides. Original samples (e.g., images) generally occupy a large amount of disk space, and transmitting these samples to the cloud side requires a large amount of bandwidth resources, making it difficult to apply in scenarios with limited transmission bandwidth. This technical solution, which only sends sample statistics, can save more than 99% of data transmission consumption on a representative convolutional neural network ResNet50.
[0079] S3: The cloud generates pseudo-samples based on the joint statistical information data of each edge device.
[0080] Model adaptation on the cloud side requires a batch of test samples, but edge devices do not upload the original samples to the cloud. To solve this problem, this solution proposes to generate a batch of pseudo-samples based on the global statistics calculated in step S2. These pseudo-samples are consistent with the samples on the edge devices in terms of distribution, so using these pseudo-samples for model adaptation can achieve similar results to using the samples on the edge devices. The following will explain in detail how to generate these pseudo-samples:
[0081] S3-1: Sample a batch of pseudo-samples from a standard Gaussian distribution. The mathematical formula is as follows:
[0082]
[0083] in This represents the total number of test samples across all edge devices.
[0084] S3-2: Feed the pseudo-samples into the cloud-side model, perform forward propagation, and calculate the mean and variance of the samples in the batch normalization layer as in step S1.
[0085] S3-3: Calculate the following loss functions, including the statistical information alignment loss function and the prediction logistic information alignment loss function.
[0086] The expression for the statistical information alignment loss function is as follows:
[0087]
[0088] This loss function aligns with statistical information, where μ′ l and σ′ l This represents the statistical information of the pseudo-samples. Aligning the statistical information ensures that the pseudo-samples and the marginal test samples have a consistent distribution.
[0089] The expression for the prediction logical information alignment loss function is as follows:
[0090]
[0091] Finally, the two loss functions are weighted and fused, and gradient descent is performed on the pseudo-sample χ and updated.
[0092] S3-4: Repeat steps S3-2 and S3-3 until the pseudo-sample χ converges or the preset iteration termination condition is met.
[0093] S4. The cloud optimizes the model parameters based on the pseudo-samples and sends the optimized model parameters to the edge devices.
[0094] Based on the pseudo-sample χ generated in step S3, the cloud-side model is updated by minimizing the entropy predicted by the model:
[0095]
[0096] To improve efficiency, only the parameters of the batch normalization layer are updated, instead of updating all model parameters. This saves GPU memory when updating the model and significantly reduces bandwidth when distributing model parameters to the edge. Furthermore, this process is unsupervised, requiring no manual labeling of spurious samples, and can be performed automatically and efficiently.
[0097] S5. The edge device updates the local model based on the model parameters sent from the cloud and performs subsequent sample inference operations.
[0098] The edge receives updated parameters from the cloud, and this process can be performed in a background thread. Therefore, this process of receiving and merging parameters will not block ongoing model inference operations. The same applies to traditional econometric information on the model.
[0099] As can be seen from the above, unlike existing test adaptation methods on edge devices, this embodiment avoids introducing additional computational costs on edge devices by coordinating model adaptation between the cloud and edge devices. This embodiment introduces an innovative cloud-based model adaptation scheme, enabling model adaptation without transmitting raw data to the edge device. This not only helps reduce the risk of privacy leaks of test data on edge devices but also reduces the need for large-scale data transmission between the cloud and edge devices. It is worth noting that this embodiment considers the actual situation of edge devices with severely limited computing resources and transmission bandwidth. Furthermore, this embodiment provides an innovative solution to privacy issues in edge computing environments, offering more reliable guarantees for data security and privacy protection.
[0100] In summary, the method of this embodiment has at least the following advantages and beneficial effects compared to the prior art:
[0101] (1) In this embodiment, the edge device does not incur additional inference costs. The model only needs to perform one forward propagation on the edge device, eliminating the cumbersome backpropagation and gradient descent computation processes. This strategy cleverly migrates all the heavy testing and adaptation workload to the cloud, thereby effectively freeing up the computing resources of the edge device.
[0102] (2) The method in this embodiment has significant advantages when considering data privacy in edge devices. Edge devices only need to send the statistical and logical prediction information from the batch normalization layer to the cloud without disclosing the original data. This mechanism ensures that even if malicious behavior exists in the cloud, the original sample cannot be reconstructed from the statistical and logical prediction information, thereby effectively protecting data privacy.
[0103] (3) This embodiment achieves low data transmission volume between the cloud and edge devices. Compared to transmitting the original test samples, this embodiment significantly reduces the data transmission requirement, making it particularly suitable for edge cloud model inference scenarios with limited network bandwidth. This optimization not only alleviates network pressure but also improves inference efficiency in resource-constrained environments.
[0104] This embodiment also provides an adaptive system for testing edge-cloud collaborative models, including:
[0105] The statistics upload module is used by each edge device to perform model inference operations, obtain and upload statistical information and logical output to the cloud;
[0106] The joint estimation module is used to perform joint estimation of information uploaded by edge devices in the cloud.
[0107] The sample generation module is used to generate pseudo-samples in the cloud based on the joint statistical information data of various edge devices;
[0108] The model optimization module is used to optimize model parameters in the cloud based on pseudo-samples and then send the optimized model parameters to edge devices.
[0109] The parameter update module is used by edge devices to update the local model based on the model parameters sent from the cloud and to perform subsequent sample inference operations.
[0110] This embodiment of the adaptive system for testing edge-cloud collaborative models can execute the adaptive method for testing edge-cloud collaborative models provided in the method embodiment of the present invention. It can execute any combination of implementation steps of the method embodiment and has the corresponding functions and beneficial effects of the method.
[0111] This embodiment also provides an adaptive device for testing an edge-cloud collaborative model, including:
[0112] At least one processor;
[0113] At least one memory for storing at least one program;
[0114] When the at least one program is executed by the at least one processor, the at least one processor performs the following: Figure 2 The method shown.
[0115] This embodiment provides an adaptive device for testing an edge-cloud collaborative model. It can execute an adaptive method for testing an edge-cloud collaborative model provided in the method embodiment of the present invention. It can execute any combination of implementation steps of the method embodiment and has the corresponding functions and beneficial effects of the method.
[0116] This application also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform... Figure 2 The method shown.
[0117] This embodiment also provides a storage medium storing instructions or programs that can execute the adaptive method for testing an edge-cloud collaborative model provided in the method embodiment of the present invention. When the instructions or programs are run, any combination of implementation steps of the method embodiment can be executed, and the method has the corresponding functions and beneficial effects.
[0118] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0119] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0120] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0122] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0123] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0124] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0125] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0126] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. An adaptive method for testing an edge-cloud collaborative model, characterized in that, Includes the following steps: Each edge device performs model inference operations, acquires and uploads statistical information and logical output to the cloud; The cloud performs joint estimation on the information uploaded by edge devices; The cloud generates pseudo-samples based on the combined statistical information data from various edge devices; The cloud-based system optimizes model parameters based on pseudo-samples and then sends the optimized model parameters to edge devices. Edge devices update their local models based on the model parameters sent from the cloud and then perform subsequent sample inference operations. The cloud performs joint estimation of information uploaded by edge devices, including: The following formula is used to combine the statistical information from each edge device to estimate the global statistical information: in, Indicates the number of edge devices. Indicates the first Number of inference samples on each edge device Indicates the first The mean statistic of inference samples on edge devices. Indicates the first Variance statistics of inference samples on edge devices; The cloud platform generates pseudo-samples based on joint statistical information data from various edge devices, including: A1. Sample a batch of pseudo-samples from a standard Gaussian distribution. ; A2. Send the pseudo-samples into the model in the cloud for forward propagation, and calculate the mean and variance of the samples in the batch normalization layer. A3. Calculate the loss function; the loss function includes the statistical information alignment loss function and the prediction logical information alignment loss function; A4. Repeat steps A2-A3 until pseudo-samples are obtained. convergence.
2. The adaptive method for testing an edge-cloud collaborative model according to claim 1, characterized in that, Each edge device performs model inference operations, acquires and uploads statistical data and logical outputs to the cloud, including: Given a batch of test samples, the edge device's model first performs forward propagation on the test samples to complete the inference process; During the inference process, for each batch of normalization layers in the model, statistical information is calculated based on the sample characteristics; this statistical information includes the mean. and variance ; Based on the calculated batch average and variance Obtain the output of the batch normalization layer: Mean of all batch normalized layers and variance and the logic output of the last layer. Uploaded to the cloud.
3. The adaptive method for testing an edge-cloud collaborative model according to claim 2, characterized in that, The expression for the output of the batch normalization layer is as follows: In the formula, For the output of the batch normalization layer, and These are learnable affine parameters.
4. The adaptive method for testing an edge-cloud collaborative model according to claim 1, characterized in that, The expression for the statistical information alignment loss function is as follows: In the formula, and This represents the statistical information of spurious samples; and This indicates the statistical information for the joint estimation of the entire data; The expression for the prediction logic information alignment loss function is as follows: In the formula, The number of pseudo-samples. This refers to the output of the cloud model on pseudo-samples. It is the model output result of edge samples uploaded by edge devices. This represents the L2 norm.
5. The adaptive method for testing an edge-cloud collaborative model according to claim 1, characterized in that, The cloud-based optimization of model parameters based on pseudo-samples includes: Based on the generated pseudo samples The parameters of the cloud model are updated by minimizing the entropy of the model's predictions. in, The parameters to be optimized in the model. For the number of categories, This refers to the predicted output of the model.
6. An adaptive system for testing an edge-cloud collaborative model, characterized in that, include: The statistics upload module is used by each edge device to perform model inference operations, obtain and upload statistical information and logical output to the cloud; The joint estimation module is used to perform joint estimation of information uploaded by edge devices in the cloud. The sample generation module is used to generate pseudo-samples in the cloud based on the joint statistical information data of various edge devices; The model optimization module is used to optimize model parameters in the cloud based on pseudo-samples and then send the optimized model parameters to edge devices. The parameter update module is used by edge devices to update the local model based on the model parameters sent from the cloud and to perform subsequent sample inference operations. The cloud performs joint estimation of information uploaded by edge devices, including: The following formula is used to combine the statistical information from each edge device to estimate the global statistical information: in, Indicates the number of edge devices. Indicates the first Number of inference samples on each edge device Indicates the first The mean statistic of inference samples on edge devices. Indicates the first Variance statistics of inference samples on edge devices; The cloud platform generates pseudo-samples based on joint statistical information data from various edge devices, including: A1. Sample a batch of pseudo-samples from a standard Gaussian distribution. ; A2. Send the pseudo-samples into the model in the cloud for forward propagation, and calculate the mean and variance of the samples in the batch normalization layer. A3. Calculate the loss function; the loss function includes the statistical information alignment loss function and the prediction logical information alignment loss function; A4. Repeat steps A2-A3 until pseudo-samples are obtained. convergence.
7. An adaptive device for testing an edge-cloud collaborative model, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method of any one of claims 1-5.
8. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1-5.