A cost-sensitive cloud-edge collaboration method based on ensemble learning

By integrating a combination of lightweight and high-precision learning models into the cloud-edge collaborative system and deploying them cost-sensitively on edge devices, the flexibility and latency issues of traditional systems are solved, achieving a cloud-edge collaborative method with high real-time performance and high accuracy.

CN116384516BActive Publication Date: 2026-01-02XIAMEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310041222.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-12
Publication Date
2026-01-02
Estimated Expiration
2043-01-12

AI Technical Summary

Technical Problem

Traditional cloud-edge collaborative systems suffer from low flexibility and high latency, and existing integrated learning and cost-sensitive learning methods cannot be combined, resulting in insufficient computing power of edge devices and increased cloud prediction latency.

Method used

By integrating learning to train a combination of multiple lightweight and high-precision models, and deploying the model combination on a cloud server, lightweight models are selected for cost-sensitive deployment on edge devices. The decision on whether to upload data to the cloud is based on device and network conditions. Collaborative inference strategies are used to improve the system's real-time performance and accuracy.

Benefits of technology

It achieves highly flexible, real-time, and accurate cloud-edge collaboration, adapting to the computing capabilities and network conditions of edge devices, reducing unnecessary data uploads to the cloud, and improving the system's response speed and prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384516B_ABST
    Figure CN116384516B_ABST
Patent Text Reader

Abstract

The application relates to a cost-sensitive cloud-edge collaborative method based on ensemble learning, which trains a combination of multiple lightweight models and high-precision models through ensemble learning, and deploys the model combination on a cloud server through cloud-edge intelligent deployment and cost-sensitively deploys some lightweight models in the combination on an edge device, so that the real-time performance of the system is improved through cloud-edge collaborative reasoning while the accuracy of the system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud-edge collaboration, and particularly relates to a cost-sensitive cloud-edge collaboration method based on ensemble learning. BACKGROUND

[0002] Cloud-edge collaboration: in today's computing scenarios, edge devices are weaker in computing power compared to cloud servers, and large cloud servers can often handle larger workloads. Intensive computing tasks are usually offloaded to the cloud. However, using only the cloud method results in the need to transfer a large amount of data between the cloud and the edge terminal device, and using only the terminal device method may lack accuracy. Collaborative intelligence emerges as the times require, and cloud-edge collaboration has become a new computing framework that takes into account the proximity of terminal devices and the advantages of powerful computing and storage resources on the cloud. However, traditional cloud-edge collaboration schemes cannot flexibly adjust the size of the edge model according to the edge device, and the cloud cannot utilize the computing results of the edge device, increasing the prediction latency of the cloud.

[0003] Ensemble learning: a single machine learning model has limited problem-solving capabilities and poor generalization ability, but building a combination of multiple learners to complete a learning task often achieves remarkable results. These learners can be seen as basic units, and they are combined to form a powerful whole that can solve more complex problems. Common ensemble learning methods include bagging, boosting, and stacking. The bagging method usually considers homogeneous weak learners, and these weak learners are learned independently in parallel. The boosting method also usually considers homogeneous weak learners. It sequentially learns these weak learners (each base model depends on the previous base model) in a highly adaptive manner and combines them according to a certain deterministic strategy. The stacking method usually considers heterogeneous weak learners and learns them in parallel. The current ensemble learning method mainly uses decision trees as base classifiers, and there is less combination with deep models.

[0004] Cost-sensitive: Classification is one of the important tasks of machine learning. Traditional classification learning algorithms pursue the lowest classification error rate, assuming that different types of error classification have equal loss. However, in application fields such as face recognition access control systems, software defect prediction, multi-label learning, and the like, the loss caused by different types of error classification is quite different. This requires the learning algorithm to pay special attention to samples that may cause high error classification loss, so as to minimize the overall error classification loss of the learning model. In a cloud-edge collaborative system, the proportion of data of certain classes received by the edge device is often high, and we want to reduce the uploading of these class data, so it is necessary to improve the recall rate of the edge model for these classes, that is, to increase the misclassification cost of these classes. There are currently three main ways to use cost-sensitive learning: data preprocessing, generating cost-sensitive sample weights; direct cost-sensitive learning, constructing a cost-sensitive classifier; and result post-processing, generating a cost-sensitive classification result. The current cost-sensitive learning method mainly targets a single model and cannot be applied to multiple model combinations trained by ensemble learning.

[0005] In summary, the traditional cloud-edge collaborative system has the problems of low flexibility and high latency, and the current cloud-edge collaborative system does not combine ensemble learning and cost-sensitive learning. SUMMARY

[0006] In view of the problems of the prior art, the purpose of the present application is to provide a cost-sensitive cloud-edge collaborative method based on ensemble learning, which has high flexibility, high real-time performance and high accuracy.

[0007] To achieve the above-mentioned purpose, the technical solution adopted by the present application is:

[0008] A cost-sensitive cloud-edge collaborative method based on ensemble learning, the method comprising three steps of training, deployment and reasoning;

[0009] The training step: initializing the sample weight, training a combination of multiple lightweight models and high-precision models through serial training of ensemble learning, generating the weight of the model according to the accuracy after training each model, and updating the sample weight;

[0010] The deployment step: deploying the trained model combination on a cloud server, and selecting the first several lightweight models from the model combination, and using these trained lightweight models to continue training several lightweight models through cost-sensitive ensemble learning together with the selected models and deploying them on the edge device;

[0011] The inference step: the edge device obtains data input lightweight model combination to obtain classification results, and combines the edge device load and network conditions to determine whether the data needs to be uploaded to the cloud; if it needs to be uploaded to the cloud, the output of the non-cost-sensitive model of the edge device is uploaded to the cloud together with the source data, the cloud server inputs the source data into the remaining models in the model combination, integrates the output with the edge device model output to obtain the final result, and returns the result to the edge device.

[0012] The training step is specifically as follows:

[0013] (1) Construct n lightweight models {L1......Ln} and m high-precision models {Lm+1......Lm+n}, obtain a training data set S, and divide the training data set S into a training set S n} and a verification set S n+1 ......L n+m}; train t t val t+1 t+1 t+v t+v

[0014] (2) Initialize sample weights W1={w1......wn}, where each 11 1t

[0015] (3) Iteratively train the n+m models in step 1, i=[1,n+m];

[0016] (a) Train the ith model L i on the training set S train using the sample weights W i ;

[0017] (b) Calculate the error rate of L i on the training set S train :

[0018]

[0019] (c) Calculate the weight of L i in the final model combination:

[0020]

[0021] (d) Update the sample weights:

[0022]

[0023] where Z​​​​​​​​​​i is a normalization constant,

[0024] (4) Finally, integrate the final result according to each model weight:

[0025]

[0026] The deployment is as follows:

[0027] After training, select the top k lightweight models {L1...L n} from the lightweight models {L1...L k} according to the memory and computing power of the actual edge device, and cost-sensitive these models; Specifically,

[0028] (1) Construct h lightweight models {H1...H h}, obtain the training set S train and the validation set S val ;

[0029] (2) Define the cost-sensitive matrix C;

[0030]

[0031] Where d is the number of categories, c ij represents the cost coefficient of classifying class i into class j;

[0032] (3) Initialize the sample weight W1={w 11 ...w 1t}, where each

[0033] (4) Iteratively calculate the cost-sensitive model weight and sample weight of the model combination {L1...L k}, i=[1,k];

[0034] (a) Calculate the cost-sensitive error rate of L i on S train :

[0035]

[0036] p i =argmax(L i (s j ))

[0037] (b) Calculate the cost-sensitive weight of L i in the final model combination:

[0038]

[0039] (c) Update sample weights:

[0040]

[0041] where Z i is a normalization constant,

[0042] (5) Iteratively train h models {H1...H h} in step 1,

[0043] (a) Modify the loss function to be a cost-sensitive loss function:

[0044]

[0045] where p i = argmax(L i (s j ))

[0046] (b) Train the ith model H n+i-1 on S train with sample weights W i ;

[0047] (c) Compute the cost-sensitive error rate e_cost i of H train on S i ;

[0048] (d) Compute the weight a_cost i of L i in the final model combination;

[0049] (e) Update sample weights, W n+i = f_cost(W n+i-1 );

[0050] (6) Finally, integrate the final result according to the weight of each model:

[0051]

[0052] After training, {L1...L k , H1...H h} are deployed on edge devices, and {L1...L n+m} are deployed on cloud servers.

[0053] The inference is as follows:

[0054] (1) Edge device receives data x, input to model combination {L1...L k ,H1...H h} to obtain edge prediction results:

[0055]

[0056] Obtain edge device cpu usage rate rc, memory usage rate mc and network rate nc, and H edge (x) Input collaborative inference strategy algorithm cloud_edge(rc, mc, nc, H edge (x)) to determine whether the data is uploaded to the cloud; α, β, θ are three threshold constants, obtained according to actual conditions, specify_classes is a set of classes with higher frequency; True indicates uploading to the cloud, and False indicates not uploading to the cloud; when rc < α, mc < β, and nc > θ are simultaneously satisfied, the algorithm returns True, and the original input is directly uploaded to the cloud for processing. Otherwise, continue to determine whether H edge (x) is specify_classes. If yes, return False to not upload to the cloud, and if not, return True to upload to the cloud. If it needs to be uploaded to the cloud, steps (2), (3) and (4) are executed, and if it does not need to be uploaded to the cloud, the result H edge (x) is directly output, and the process ends.

[0057] (2) Upload the output of the non-cost-sensitive network {L1(x)...L k (x) and the source data x to the cloud server;

[0058] (3) The server calculates the remaining network output result set and returns:

[0059]

[0060] {L1(x)...L k (x) is directly obtained from the data uploaded by the edge device;

[0061] (4) The edge device receives the result H cloud (x) returned by the cloud and outputs, and the process ends.

[0062] By adopting the above scheme, this invention trains a combination of multiple lightweight and high-precision models through ensemble learning, and deploys the model combination on a cloud server through cloud-edge intelligent deployment, while deploying several lightweight models cost-sensitively on edge devices. This cloud-edge collaborative inference improves the system's real-time performance while ensuring accuracy. However, due to the limited computing power of edge devices, only low-precision lightweight models can be deployed. Furthermore, accessing high-precision models on the cloud server relies on good network performance and introduces network latency. The cloud-edge collaborative design scheme based on ensemble learning adopted in this invention can train a combination of several lightweight and high-precision models through ensemble learning. Deploying all trained models on the server side and cost-sensitively deploying several lightweight models on edge devices allows for dynamic adjustment of the number of edge models and the decision to access the cloud server based on device and network conditions, resulting in high real-time performance, high flexibility, and high accuracy. Attached Figure Description

[0063] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0064] Figure 1 This is a schematic diagram of the integrated learning training of the present invention;

[0065] Figure 2 Here is the pseudocode for the collaborative reasoning strategy algorithm cloud_edge;

[0066] Figure 3 This is a flowchart of the cloud-edge collaborative reasoning process of the present invention. Detailed Implementation

[0067] This invention discloses a cost-sensitive cloud-edge collaborative method based on ensemble learning, comprising three steps: training, deployment, and inference. The method trains a combination of multiple lightweight and high-precision models through ensemble learning, and deploys the model combination on a cloud server via cloud-edge intelligent deployment, while cost-sensitively deploying several lightweight models on edge devices. Cloud-edge collaborative inference improves the system's real-time performance while maintaining its accuracy.

[0068] like Figure 1 As shown, the training steps are as follows: Initialize sample weights, and sequentially train a combination of multiple lightweight models and high-precision models through ensemble learning. After each model is trained, the weights of that model need to be generated based on the accuracy, and the sample weights are updated. The specific training steps are as follows:

[0069] (1) Construct n lightweight models {L1......L2} n}, m high-precision models {L n+1 ......L n+m}, obtain a training dataset S, and divide it into a training set S train = {(s1, y1)... (s t , y t )} and a validation set S val = {(s t+1 , y t+1 )... (s t+v , y t+v )}.

[0070] (2) Initialize sample weights W1 = {w 11 ... w 1t}, where each

[0071] (3) Iterate the n+m models in step 1, i = [1, n+m].

[0072] (a) Train the i-th model L i on the training set S train using sample weights W i .

[0073] (b) Calculate the error rate of L i on the training set S train :

[0074]

[0075] (c) Calculate the weight of L i in the final model combination:

[0076]

[0077] (d) Update the sample weights:

[0078]

[0079] where Z i is a normalization constant,

[0080] (4) Finally, integrate the final result according to the weights of each model:

[0081]

[0082] Deployment step: Deploy the trained model combination on a cloud server, and select the top several lightweight models from the model combination. Use these trained lightweight models to continue training several lightweight models through cost-sensitive ensemble learning, and deploy them together with the selected models on the edge.

[0083] Specifically, after training, the first k lightweight models {L1...L n} are selected from the lightweight models {L1...L k} according to the memory and computing power of the actual edge device, and these models are cost-sensitive, and the number depends on the memory and computing power of the edge device.

[0084] The cost-sensitive way is to integrate h cost-sensitive lightweight models after the lightweight models {L1...L k} through cost-sensitive ensemble learning. The specific steps are as follows:

[0085] (1) Construct h lightweight models {H1...H h}, and obtain the training set S train and the validation set S val .

[0086] (2) Define the cost-sensitive matrix C.

[0087]

[0088] Where d is the number of categories, and c ij represents the cost coefficient of dividing category i into category j.

[0089] (3) Initialize the sample weight W1={w 11 ...w 1t}, where each

[0090] (4) Iteratively calculate the cost-sensitive model weight and sample weight of the model combination {L1...L k}, i=[1,k].

[0091] (a) Calculate the cost-sensitive error rate of L i on S train :

[0092]

[0093] p i =argmax(L i (s j ))

[0094] (b) Calculate the cost-sensitive weight of L i in the final model combination:

[0095]

[0096] (c) Update the sample weight:

[0097]

[0098] where Z i is a normalization constant,

[0099] (5) Iteratively train h models {H1...H h} in step 1.

[0100] (a) Modify the loss function to be a cost-sensitive loss function:

[0101]

[0102] where p i = argmax(L i (s j ))

[0103] (b) Train the i-th model H n+i-1 on S train with sample weights W i .

[0104] (c) Compute the cost-sensitive error rate e_cost i of H train on S i .

[0105] (d) Compute the weight a_cost i of L i in the final model combination.

[0106] (e) Update the sample weights, W n+i = f_cost(W n+i-1 ).

[0107] (6) Finally, integrate the final result by each model weight:

[0108]

[0109] After training, {L1...L k , H1...H h} are deployed on edge devices, and {L1...L n+m} are deployed on cloud servers.

[0110] Inference step: the edge device obtains data input lightweight model combination to obtain classification results, and inputs the edge device load and network condition into the collaborative inference strategy algorithm to determine whether the data needs to be uploaded to the cloud. If it needs to be uploaded to the cloud, the output of the non-cost-sensitive model of the edge device is uploaded to the cloud together with the source data, the cloud server inputs the source data into the remaining model in the model combination, integrates the output with the edge device model output to obtain the final result and returns the result to the edge device.

[0111] As shown in Figure 3 , during inference, the device and network load conditions and the edge model prediction results need to be considered comprehensively, and the specific steps are as follows:

[0112] (1) The edge device receives data x and inputs it into the model combination {L1......L k ,H1......H h} to obtain the edge prediction result:

[0113]

[0114] The edge device cpu occupancy rate rc, memory occupancy rate mc and network rate nc are obtained, and H edge (x) is input into the collaborative inference strategy algorithm cloud_edge(rc, mc, nc, H edge (x)) to determine whether the data needs to be uploaded to the cloud. α, β, θ are three threshold constants, which are obtained according to the actual situation, specify_classes is a set of classes with high frequency, True means uploading to the cloud, and False means not uploading to the cloud; when rc < α, mc < β and nc > θ are met at the same time, the algorithm returns True, and the original input is directly uploaded to the cloud for processing. Otherwise, continue to determine whether H edge (x) is specify_classes. If yes, return False and do not upload to the cloud, if not, return True and upload to the cloud. If it needs to be uploaded to the cloud, steps (2), (3) and (4) are executed, if it does not need to be uploaded to the cloud, the result H edge (x) is directly output, and the process ends.

[0115] (2) The output of the non-cost-sensitive network {L1(x)......L k (x)} and the source data x are uploaded to the cloud server.

[0116] (3) The server calculates the remaining network output and returns the integrated result:

[0117]

[0118] {L1(x)......L k (x)} can be directly obtained from the data uploaded from the edge device, so the calculation can be saved.

[0119] (4)Edge end receives the result H returned by the cloud cloud (x) and output, end.

[0120] Due to the limited computing power of the edge end device, only a lightweight model with low precision can be deployed. At the same time, considering that accessing the high-precision model of the cloud server relies on good network performance and will bring a certain network delay. The cloud-edge collaborative design scheme based on ensemble learning adopted by the present application can train a combination of several lightweight models and high-precision models through the way of ensemble learning. Deploy all the trained models on the server side, and deploy several lightweight models among them to the edge end device, and according to the device and network conditions, dynamically adjust the number of edge end models and decide whether to access the cloud server, which has the characteristics of high real-time, high flexibility and high accuracy.

[0121] The application range of the present application is computer vision tasks under cloud-edge collaboration, and the main feature is that edge devices and cloud computing centers cooperate to perform intelligent identification. Specific application tasks include but are not limited to the following: intelligent vehicle system, vehicle integrated camera device as edge device to provide auxiliary driving or driver fatigue identification function; intelligent security system, camera as edge device to provide expression recognition, body attribute recognition function; intelligent agricultural system, integrated camera agricultural equipment as edge device to provide precision planting, visual management function. The following will take the intelligent vehicle system as an example for illustration.

[0122] A computer vision deep model is used to infer a driver picture taken by a camera built in a car to determine whether the driver is driving while tired. There are two traditional methods. One is to deploy the deep model on a server, and all data taken by the camera needs to be uploaded to the cloud server through the network, the server infers the result and returns it to the car terminal. This process has a certain time delay and is highly dependent on the network. The network state of the car in the driving process is very unstable. The other is to deploy a simple model or a compressed model (lightweight model) on the car terminal with limited computing power. This method does not depend on the network and has high real-time performance. However, the accuracy of the lightweight model is low, which will affect the actual effect. According to the invention, a model combination containing n lightweight models is first trained through ensemble learning, and the first k lightweight models are selected according to the terminal computing power of different cars. According to experience, the cost of identifying fatigue as non-fatigue during driving is greater than the cost of identifying non-fatigue as fatigue, so we want the edge model to identify most fatigue cases as non-fatigue. To improve system real-time performance, try to make the prediction result of non-fatigue data not go to the cloud. This requires improving the recall rate of the edge lightweight model for non-fatigue data (the number of correct predictions when the true value is non-fatigue / the number of true values for non-fatigue), so h lightweight models are trained according to the cost-sensitive method described in the invention, and h is also determined according to the terminal computing power of the car. The above h+k lightweight models are deployed on the car terminal, and during actual inference, the cloud-edge collaborative algorithm according to the invention reduces the uploading of non-fatigue data to the cloud according to the network condition and terminal load, to improve system real-time performance and ensure accuracy.

[0123] The above is only an embodiment of the present application, and does not limit the technical scope of the present application. Any slight modification, equivalent change and modification of the above embodiment according to the technical essence of the present application are still within the scope of the technical solution of the present application.

Claims

1. An integrated learning based cost-sensitive cloud-edge collaboration method, characterized in that: The method comprises three steps of training, deployment and reasoning; The training step comprises: initializing sample weights, training a plurality of combinations of lightweight models and high-precision models through integrated learning in series, generating the weight of each model according to the accuracy after training each model, and updating the sample weights; The deployment step comprises: deploying the trained model combination on a cloud server, selecting the first several lightweight models from the model combination, and using the trained lightweight models to continue training several lightweight models through cost-sensitive integrated learning, and deploying the selected models and the lightweight models on an edge device; The deployment is specifically as follows: After training, the lightweight model is adjusted based on the actual memory and computing power of the edge device. Select the top k lightweight models { } and make these models cost-sensitive; specifically, (1) constructing h lightweight models , obtaining a training set and a verification set ; (2) defining a cost-sensitive matrix C; wherein, is the number of classes, denotes the cost coefficient for splitting a class into classes , the other cost coefficients in the matrix C have the same meaning by analogy. (3) Initialize sample weights where each ; (4) Iterative computation model combination Cost-sensitive model weights and sample weights, ; (a) Computing the model Cost-sensitive error rate on the training set on the training set: (b) Computing the model Cost-sensitive weight in final model combination: (c) updating the sample weights: wherein, is a normalization constant, , is a lightweight model on a training set of error rate, is a training dataset; (5) Iteratively train the h models in step 1 , ; (a) modifying the loss function to a cost-sensitive loss function: (b) using sample weights In training the i-th model ; (c) computing In Cost-sensitive error rates on ; (d) calculating the weight taken in the final model combination ; (e) updating the sample weights, ; (6) Finally, integrate the final results according to the weights of each model: After the training is completed deployed on an edge device, deployed on a cloud server; The reasoning step comprises: the edge device inputs data into the lightweight model combination to obtain a classification result, and determines whether the data needs to be uploaded to the cloud according to the load of the edge device and the network condition; if the data needs to be uploaded to the cloud, the output of the non-cost-sensitive model of the edge device and the source data are uploaded to the cloud, the cloud server inputs the source data into the remaining models in the model combination, integrates the output of the remaining models with the output of the edge device, and returns the final result to the edge device. 2.The cost-sensitive cloud-edge collaboration method based on ensemble learning according to claim 1, wherein: The training step is specifically as follows: (1) Construction a lightweight model , m high-precision models , obtain a training data set , and divide it into a training set and a validation set ; (2) Initialize sample weights where each ; (3) iteratively training the n+m models in step (1), ; (a) using sample weights on the training set training the first model ; (b) computing model Error rate on the training set on the training set: (c) calculating Weight in final model combination: (d) updating the sample weights: wherein is a normalization constant, ; (4) Finally, integrate the final results according to the weights of each model: 。 3.The cost-sensitive cloud-edge collaboration method based on ensemble learning according to claim 1, wherein: The reasoning is specifically as follows: (1) The edge end device receives data , input to the model combination Get edge end prediction result: Obtaining edge device cpu occupancy , memory occupancy and network rate nc Input collaborative inference strategy algorithm Decide whether the data is uploaded to the cloud or not Three threshold constants are obtained according to actual conditions A category set with higher frequency of occurrence; True indicates uploading to the cloud, and False indicates not uploading to the cloud; when the conditions of , , nc are met at the same time, the algorithm returns True; otherwise, it continues to judge whether it is ; If yes, return False not to cloud, if not, return True to cloud; if need to cloud, execute steps (2) (3) (4), if no need to cloud, directly output the result , end; (2) the output of the non-cost-sensitive network { } and source data is uploaded to a cloud server; (3) The server calculates the remaining network output and returns the integrated result: { }obtained directly from data uploaded by the edge end device; (4) The edge end receives the result returned by the cloud end and outputs, end.

Citation Information

Patent Citations

  • Transformer fault diagnosis method based on cost sensitivity and ensemble learning

    CN111860658A

  • Cost-sensitive ensemble learning classification method and system

    CN112382382A