Image classification method based on personalized efficient semi-asynchronous federated learning

Through personalized and efficient semi-asynchronous federated learning methods, dynamic selection of client pools and optimized parameter aggregation, the data heterogeneity and communication efficiency problems of federated learning in image classification are solved, the accuracy and robustness of the model are improved, and efficient image classification is achieved.

CN120612581APending Publication Date: 2025-09-09XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510675490.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Existing federated learning methods in image classification have problems such as heterogeneous data leading to model bias, difficulty in global model convergence, decreased classification accuracy and poor robustness. Especially in complex non-independent and identically distributed data scenarios, traditional client selection strategies lead to uneven data utilization and low communication efficiency, and privacy protection technology comes at the expense of computing efficiency.

Method used

A personalized and efficient semi-asynchronous federated learning method is adopted. By initializing the client pool and status information, dynamically and randomly selecting clients, using similarity weights and timeliness attenuation factors for parameter aggregation, designing fairness compensation factors and dynamic deprecation mechanisms, optimizing client selection and model aggregation, and forming a collaborative optimization closed loop.

Benefits of technology

It improves the accuracy and robustness of image classification results, achieves efficient knowledge sharing and balanced resource scheduling, solves the limitations of traditional methods in complex scenarios, and improves training performance and convergence speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120612581A_ABST
    Figure CN120612581A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method based on personalized efficient semi-asynchronous federated learning, which is realized by a server and a client, and comprises the following steps of: in a process of obtaining a trained image classification model, preferentially activating a high-gradient contribution client through an importance sampling strategy to accelerate convergence; a fairness compensation factor and a dynamic abandoning mechanism are designed to balance data distribution diversity, and similarity weighted aggregation is utilized to quantify the direction consistency of parameter updating to suppress noise interference, so that the precision and robustness of an image classification result are improved; finally, a collaborative optimization closed loop of client selection and model aggregation is formed, the limitation of a traditional image classification method in a complex classification scene is solved, the performance and convergence speed of a trained image classification model are improved, multi-target unification of efficient knowledge sharing, personalized adaptation and resource balanced scheduling is achieved, and the method is suitable for popularization and application. And an integrated solution with robustness and practicability is provided for image classification in a complex heterogeneous scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image classification, and in particular relates to an image classification method based on personalized and efficient semi-asynchronous federated learning. Background Art

[0002] In the field of image classification technology, traditional image classification methods rely on centralized training and require uploading client data to a central server, posing a risk of user privacy leakage.

[0003] With the rapid development of artificial intelligence (AI), the conflict between data privacy protection and model personalization requirements has become increasingly prominent. Federated learning has become a core technical direction for image classification. Traditional centralized machine learning relies on centralized data training, but cross-domain sharing of sensitive data poses legal and privacy risks and consumes significant communication resources. Federated learning, as a distributed learning paradigm, uses client-side local training and parameter aggregation to protect data privacy while breaking down data silos. It has been widely applied in key areas such as smart healthcare and autonomous driving. However, federated learning faces multiple challenges in complex image classification scenarios. First, client-side data exhibits significant non-independent and identically distributed (Non-IID) characteristics, resulting in discrete local model updates. Traditional single global models struggle to adapt, leading to reduced inference accuracy. Second, client-side system heterogeneity, such as significant differences in computing power, communication bandwidth, and battery life, limits synchronization aggregation to the "barrel effect," where inefficient devices can hinder overall training progress. Furthermore, frequent model parameter transmission leads to exponentially increasing communication overhead. Therefore, there is an urgent need to design a federated learning method that takes into account efficient communication, heterogeneous adaptation and personalized needs, so as to achieve the coordinated optimization of data privacy protection and model performance improvement in image classification.

[0004] Currently, research in the field of federated learning focuses on three core components: local training, server aggregation, and client selection. These components address challenges posed by data heterogeneity, system heterogeneity, and communication efficiency. In the classic federated learning algorithm, FedAvg, the server randomly selects a subset of clients and sends them the latest global model during each round of communication. The clients then train their models using their local data and upload the updated models to the server, which then performs a weighted average of the parameters based on the data volume to generate a shared global model. While existing technologies have achieved local optimizations in these core components of federated learning, inherent flaws still hinder the coordinated improvement of efficiency, performance, and fairness. In the local training phase, personalized fine-tuning methods improve adaptability to non-IID data through local model adaptation. However, the approach of building a global model first and then performing local adjustments inevitably increases computational overhead, inherently conflicting with the requirements for lightweight and low-power edge devices. The design of the aggregation mechanism faces a trade-off between efficiency and stability. Synchronization strategies, which strictly rely on synchronized client updates, are subject to the "barrel effect" caused by device performance variations, resulting in poor fault tolerance and low training efficiency. While asynchronous strategies improve communication efficiency by relaxing synchronization constraints, stale gradients interfere with model convergence, making stability and accuracy difficult to guarantee. Regarding client selection strategies, traditional random selection methods, lacking an assessment of data distribution, can easily lead to a uniform data distribution for selected clients, exacerbating overfitting of the global model to local data. Furthermore, data from frequently participating clients is overly relied upon, while data resources from less frequently participating edge clients remain idle, leading to an imbalance in participation fairness and violating the original design principle of federated learning: multi-party collaboration and shared benefits. Furthermore, dynamic selection based on lagging indicators struggles to adapt to real-time environmental changes, slowing model convergence. Evaluating data value or training status during client selection poses the risk of privacy leakage. While existing privacy-preserving techniques (such as differential privacy and homomorphic encryption) can mitigate this issue, they do so at the expense of computational efficiency, exacerbating the burden in resource-constrained scenarios. Consequently, existing approaches using federated learning for image classification suffer from model bias caused by heterogeneous (non-IID) data, difficulties in global model convergence, significant reductions in classification accuracy, and poor robustness. Summary of the Invention

[0005] To address the above-mentioned problems in the prior art, the present invention provides an image classification method based on personalized, efficient, semi-asynchronous federated learning. The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0006] The present invention provides an image classification method based on personalized and efficient semi-asynchronous federated learning, the method comprising:

[0007] S1, initialization parameters; the parameters include: global model, client pool and client status information;

[0008] S2, the server updates each client pool based on the client's historical participation status and current contribution in the client status information; dynamically and randomly selects clients from the candidate client pool and the potential client pool in the updated client pool to form a selected client pool; updates the client status information of the clients in the selected client pool and issues a personalized model corresponding to the selected client pool;

[0009] S3, the client generates a client lottery network based on the client's personalized model; the client performs several rounds of batch stochastic gradient descent training using the local training dataset to update client-related parameters, and uploads the updated client-related parameters to the server after training is complete; the client-related parameters include: client lottery network, mask, value indicator, and time parameter; the local training dataset includes: image data and category labels corresponding to the image data;

[0010] S4, the server performs parameter overlap detection on the received client-related parameters, and obtains a normalized comprehensive weight by calculating a similarity weight and a timeliness attenuation factor; the server performs differentiated processing on the client-related parameters according to parameter positions, and obtains an aggregated global model and an aggregated personalized model for each client based on the normalized comprehensive weight;

[0011] S5, looping through S2-S4 until the preset iteration rounds are completed, using the personalized models of each client aggregated in the current iteration as the trained image classification model; in the first iteration, the initialized global model is used as the personalized model corresponding to the selected client pool;

[0012] S6, using the trained image classification model to process the image to be classified to obtain an image classification result.

[0013] In one embodiment of the present invention, the client pool includes:

[0014] The client pool includes the pool of candidates for selection, the pool of potential clients, the pool of selected clients, the pool of backup clients and the pool of super-selected and discarded clients.

[0015] In one embodiment of the present invention, the client status information includes:

[0016] Mask, time parameter, value indicator, fairness compensation factor, client evaluation, last selected round, number of selections and upper limit of selection.

[0017] In one embodiment of the present invention, the server updates each client pool based on the client's historical participation status and current contribution in the client status information, including:

[0018] The server checks the number of times each client has been selected. If the number of times the client has been selected is 0, the client is placed in a potential client pool. If the number of times the client has been selected reaches a preset upper limit, the client is placed in a super-selected abandoned client pool.

[0019] The server updates the client evaluation according to the value index and fairness compensation factor of each client, and puts the clients corresponding to the client evaluations that meet the preset threshold into the candidate client pool, thereby updating each client pool.

[0020] In one embodiment of the present invention, the server updates the client evaluation based on the value index and fairness compensation factor of each client, and places the clients corresponding to the client evaluations that meet the preset threshold into the candidate client pool, including:

[0021] The server updates the value index and fairness compensation factor of each client based on the client's historical participation status and current contribution;

[0022] Based on the weight coefficient, the client evaluation is updated using the updated value index and fairness compensation factor;

[0023] The clients whose client evaluations meet the preset threshold are placed into the pool of candidates. The expression of the preset threshold is as follows:

[0024] S threshold =S p (1-χ%);

[0025] Among them, S p represents the client evaluation of the (1-β)p-th client, β represents the exploration factor, and χ represents the confidence interval parameter.

[0026] In one embodiment of the present invention, dynamically and randomly selecting clients from the candidate client pool and the potential client pool in the updated client pool to form a selected client pool includes:

[0027] Randomly select (1-β)p clients from the updated candidate client pool, and randomly select βp clients from the updated potential client pool to form the selected client pool.

[0028] In one embodiment of the present invention, the expression of the client lottery network is as follows:

[0029]

[0030] in, Indicates client C in the t+1th iteration i The corresponding client lottery network, represents the global model after initialization, ⊙ represents element-by-element multiplication, Indicates client C in the t+1th iteration i The corresponding mask is learned.

[0031] In one embodiment of the present invention, the expression of the normalized comprehensive weight is as follows:

[0032]

[0033] Among them, ξ i [k] indicates client C i The corresponding normalized comprehensive weight, Ω i Represents client C i The corresponding time-sensitive attenuation factor, μ i [k] indicates client C i The similarity weight corresponding to the parameter position k in the parameter, C overlap [k] indicates the connection with client C i There is an overlapping set of clients at parameter position k, Ω j Represents client C j The corresponding time-sensitive attenuation factor, μ j [k] indicates client C j The similarity weight corresponding to the parameter at parameter position k in .

[0034] In one embodiment of the present invention, the expression of the aggregated global model is as follows:

[0035]

[0036] in, represents the parameter of the global model at parameter position k in the t+1th iteration, ξ b [k] indicates client C b The corresponding normalized comprehensive weight, Indicates client C in the t+1th iteration b Train the uploaded local model parameters at parameter position k, C overlap [k] indicates the connection with client C i There are overlapping client sets at parameter position k, represents the parameter of the global model at parameter position k in the tth iteration.

[0037] In one embodiment of the present invention, the personalized model of the aggregated client is expressed as follows:

[0038]

[0039] in, represents the kth parameter in the client lottery network in the t+1th iteration, Indicates client C in the t+1th iteration i Corresponding client lottery network.

[0040] Beneficial effects of the present invention:

[0041] In the solution provided by the present invention, in the process of obtaining a trained image classification model, each client pool is updated by the server according to the client's historical participation status and current contribution in the client status information; then, clients are dynamically and randomly selected from the updated client pool to form a selected client pool, and the above-mentioned importance sampling strategy is used to preferentially activate clients with high gradient contributions to accelerate the convergence of the global model; by designing a fairness compensation factor and a dynamic abandonment mechanism to balance the diversity of data distribution, and using the directional consistency of similarity-weighted aggregation quantization parameter updates to suppress the interference of noise in the image classification process, thereby improving the accuracy and robustness of the image classification results; finally, a collaborative optimization closed loop of client selection and model aggregation is formed, which solves the limitations of traditional image classification methods in complex classification scenarios, improves the performance and convergence speed of the trained image classification model, and realizes the multi-objective unification of efficient knowledge sharing, personalized adaptation and resource balanced scheduling, providing an integrated solution for image classification in complex heterogeneous scenarios that is both robust and practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the steps of an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention;

[0043] Figure 2 A flowchart of an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention;

[0044] Figure 3 A schematic diagram of the process of forming a selected client pool in an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention;

[0045] Figure 4 A flowchart of step S3 in an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention;

[0046] Figure 5 A flowchart of step S4 in an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention;

[0047] Figure 6a-6cA comparison chart of the accuracy-communication cost of an image classification method based on personalized and efficient semi-asynchronous federated learning provided by an embodiment of the present invention and other baseline algorithms on different data sets;

[0048] Figure 7a-7b This is a graph showing the accuracy changes of an image classification method based on personalized and efficient semi-asynchronous federated learning and other baseline algorithms under different data sets provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.

[0050] The embodiment of the present invention is based on the sparse similarity perception semi-asynchronous aggregation strategy and the multi-fusion dynamic client selection strategy, and provides an image classification method based on personalized and efficient semi-asynchronous federated learning based on the lottery hypothesis, which is implemented by the server and the client. Figure 1 As shown, this may include:

[0051] S1, initialization parameters; the parameters may include: global model, client pool and client status information.

[0052] Specifically, the initialization parameters may include:

[0053] S11, initialize the global model, the global model can be initialized as

[0054] S12, initialize the client pool.

[0055] The client pool can include:

[0056] The client pool includes the pool of candidates for selection, the pool of potential clients, the pool of selected clients, the pool of backup clients and the pool of super-selected and discarded clients.

[0057] Divide the client pool C into the candidate client pool X t , potential client pool Y t , selected client pool Z t , alternative client pool P t and superselection deprecation of client pool A t Five client sets. Among them, client pool C={C1,C2,…,C N}, N represents the total number of clients participating in the training; X t Y represents the set of clients whose client evaluation in round t is greater than the preset threshold, t represents the set of clients that have not participated in training by the tth round, Z t Indicates that in round t, from the set X t With Yt The set of clients selected to participate in training, P t A represents the set of clients that have participated in training but whose client evaluation in round t does not reach the preset threshold. t Indicates that the number of times a client has participated in training has reached the upper limit and the client set can no longer be selected.

[0058] Initialize the client pool so that the potential client pool contains all clients, that is, Y 0 =C, the rest of the client pools are controlled, that is,

[0059] S13, initialize client status information.

[0060] Client status information, which can include:

[0061] Mask, time parameter, value indicator, fairness compensation factor, client evaluation, last selected round, number of selections and upper limit of selection.

[0062] For each client C i , initialize a binary mask m with all elements set to 1 i , this mask is used to mark the retention status of the model parameters (a value of 1 indicates that the corresponding parameters are retained), and set the time parameter lastupdate i = 0, to record the global round of the client's most recent training participation, value indicator V i Initialized to 0, this value indicator is used to quantify the contribution of client local training to the global model, and the fairness compensation factor f i Initialized to 0, it aims to balance the participation opportunities of new and old clients and avoid high-frequency participating clients from over-dominantly leading the training process. The client evaluation S i Initialized to 0, as the core evaluation indicator of the client's comprehensive capabilities, it will be generated through weighted calculation of value indicators and fairness compensation factors. The last round R i and the number of times selected Num i Both are initialized to 0, and are used to record the client's most recent round of selection and the cumulative number of times it has participated in training, and the upper limit of selection i Set to default value Limit base , used to limit the number of rounds a single client can participate in, ensuring fair participation opportunities for edge devices. A flowchart of an image classification method based on personalized, efficient, semi-asynchronous federated learning provided by an embodiment of the present invention is as follows: Figure 2As shown, after completing initialization step S1, several iterative processes are performed. One iteration may include: first, dynamic client selection using step S2, then local training using step S3, and finally sparse similarity aggregation using step S4. The process iterates through steps S2-S4 until a predetermined number of iterations are complete, at which point the aggregated personalized model for each client is output. For ease of understanding, steps S2-S4 are described in detail below.

[0063] S2, the server, updates each client pool based on the client's historical participation status and current contribution in the client status information; dynamically and randomly selects clients from the candidate client pool and potential client pool in the updated client pool to form a selected client pool; updates the client status information of the clients in the selected client pool and sends the personalized model corresponding to the selected client pool.

[0064] For S2, S21, the server updates each client pool according to the client's historical participation status and current contribution in the client status information, such as Figure 3 As shown, this may include:

[0065] S211, the server checks the number of times each client is selected. If the number of times is 0, the client is placed in the potential client pool. If the number of times reaches the preset upper limit, the client is placed in the super-selected abandoned client pool.

[0066] Specifically, the server checks the number of times each client is selected Num i , if Num i = 0, it will remain in the potential client pool. If the number of times it is selected reaches the upper limit, that is, Num i ≥Limit i , the client is moved to the super-selected discarded client pool.

[0067] S212, the server updates the client evaluation according to the value index and fairness compensation factor of each client, and puts the clients corresponding to the client evaluations that meet the preset threshold into the candidate client pool, thereby updating each client pool.

[0068] For S212, it may include:

[0069] The server updates each client’s value indicator and fairness compensation factor based on each client’s historical participation status and current contribution;

[0070] Based on the weight coefficient, the client evaluation is updated using the updated value index and fairness compensation factor;

[0071] The clients whose client evaluations meet the preset threshold are placed into the candidate client pool. The expression of the preset threshold is as follows:

[0072] S threshold =S p (1-χ%);

[0073] Among them, S p represents the client evaluation of the (1-β)pth client, p represents the number of clients selected in this round of iteration, β represents the exploration factor, and χ represents the confidence interval parameter.

[0074] Specifically, the server calculates the value index V uploaded by the client. i The corresponding value indicators are updated. The value indicators extend the importance sampling theory to the client level, introduce the training loss value to approximate the gradient norm, quantify the contribution of the client's local dataset to the current global model training, and convert the client C i Value indicator V i Defined as:

[0075] Among them, D i Represents client C i Local dataset, |D i | indicates client C i The amount of data corresponding to the local dataset, Loss(τ) represents the training loss of sample batch τ.

[0076] For all clients, calculate the current fairness compensation factor f i As for the confidence interval upper bound algorithm, the fairness compensation factor f i Defined as:

[0077] Among them, t represents the current iterative training round, R i Represents client C i The last selected round, γ represents the exploration intensity parameter.

[0078] Client Rating S i is the weighted harmonic function of the value index and the fairness compensation factor:

[0079] S i =δ t ·V i +(1-δ t )·f i ;

[0080] Among them, δ t Represents the weight coefficient, which constructs the cosine attenuation control scheme based on the cosine annealing strategy:

[0081]

[0082] Among them, δ base Represents δ t The lower limit of , which controls the minimum amplitude of parameter attenuation, and L represents the length of the annealing cycle.

[0083] Arrange all clients in descending order according to the updated client evaluation value, and select the client evaluation S ranked at (1-β)p p As the basic threshold and reduce it by x% as the preset threshold S threshold , the expression of the preset threshold is as follows:

[0084] S threshold =S p (1-χ%);

[0085] All satisfying S i ≥S threshold The client is put into the candidate client pool X t middle.

[0086] It can be understood that the embodiment of the present invention evaluates the client contribution through value indicators and calculates the client evaluation by weighting it with the fairness compensation factor, thereby achieving dual-track collaboration of prioritizing high-contribution clients and exploring potential clients, and solving the problems of inefficient data utilization and imbalanced participation in traditional selection strategies.

[0087] For S2, S22, dynamically and randomly select clients from the candidate client pool and potential client pool in the updated client pool to form the selected client pool, such as Figure 3 As shown, this may include:

[0088] Randomly select (1-β)p clients from the updated candidate client pool, and randomly select βp clients from the updated potential client pool to form the selected client pool.

[0089] During the selection process, if the number of clients remaining in the potential client pool is less than βp, the shortfall is made up from the candidate client pool.

[0090] In S2, S23 updates the client status information of the clients in the selected client pool and sends the personalized model corresponding to the selected client pool, which may include:

[0091] For the selected client pool Z t Each client in the update its last selected round R i =t, and select the number of times Num i Add 1;

[0092] The server selects client pool Z tIssue its latest personalized model

[0093] It can be understood that for the first iteration process, the server will use the initialized global model as the personalized model corresponding to the selected client pool and send it to the selected client pool.

[0094] The flow chart of S3 is as follows: Figure 3 As shown, the client generates a client lottery network based on the client's personalized model; the client uses the local training data set to perform several rounds of batch stochastic gradient descent training to update client-related parameters, and uploads the updated client-related parameters to the server after the training is completed; the client-related parameters include: client lottery network, mask, value indicator and time parameter; the local training data set may include: image data and category labels corresponding to the image data.

[0095] For S3, based on the client's personalized model, generate the client lottery network, such as Figure 3 As shown, this may include:

[0096] Client-side personalized model of received client Download as the initial lottery network in this round of iteration;

[0097] Use the verification data to evaluate the initial lottery network and get the verification accuracy acc val , if the verification accuracy acc val Better than the accuracy threshold acc threshold And shear rate The target pruning rate r has not yet been reached target , that is, acc val >acc threshold and According to the fixed pruning rate r p Prune the low-magnitude parameters of the initial lottery network and use the corresponding initial values ​​in the initialized global model to recharge the remaining parameters after pruning, while the pruned parameters remain unchanged at 0. Repeat the above process until the target pruning rate is reached and the client learns a new mask Mark the location where the parameters are retained and use it as the local mask in the next round of communication. After pruning is completed, the expression of the client lottery network is as follows:

[0098]

[0099] Indicates client C in the t+1th iteration i The corresponding client lottery network, represents the global model after initialization, ⊙ represents element-wise multiplication (Hadamard product), Indicates client C in the t+1th iteration i The corresponding mask is learned.

[0100] After generating the client lottery network, the client uses the local training dataset Perform several rounds of mini-batch stochastic gradient descent training. After training is complete, upload the updated client lottery network, mask, value indicator, and time parameters to the server. The local training dataset may include: image data and the corresponding category labels of the image data.

[0101] The flowchart of step S4 in the image classification method based on personalized efficient semi-asynchronous federated learning is as follows: Figure 5 As shown in S4, the server performs parameter overlap detection on the received client-related parameters, and obtains the normalized comprehensive weight by calculating the similarity weight and the timeliness attenuation factor; the server performs differentiated processing on the client-related parameters according to the parameter position, and obtains the aggregated global model and the aggregated personalized model of each client based on the normalized comprehensive weight.

[0102] In S4, the server performs parameter overlap detection on the received client-related parameters, and obtains the normalized comprehensive weight by calculating the similarity weight and timeliness attenuation factor, such as Figure 5 As shown, this may include:

[0103] The server maintains a parameter receiving queue and when it receives N base After the client parameters, the random waiting time T random , continue to receive parameters during the waiting period and stop after the timeout. For all received client parameters, perform parameter overlap detection. For parameters that overlap at position k, calculate the similarity weight and timeliness attenuation factor to form a normalized comprehensive weight ξ i [k].

[0104] Specifically, the similarity weight μ j [k] is used as a quantitative control of the model's directional consistency, quantifying the client C i The contribution degree to the shared parameters at position k. For client C i , which assumes that the client lottery network learned As a sparse parameter vector, where the kth parameter is k is the parameter position index (k = 1, 2, ..., K, K is the total number of parameters); mask For identification The position of the valid parameter in the , whose element value is 0 or 1, 1 means that the parameter at the corresponding position will be retained, and 0 means it will be pruned. The sparse parameter vector of the client and the global model The expression of cosine similarity between is as follows:

[0105]

[0106] Based on the above cosine similarity, define client C i Similarity weight μ at position k i The expression for [k] is as follows:

[0107]

[0108] Among them, C overlap [k] indicates the connection with client C i There is an overlapping set of clients at parameter position k, i.e., mask Client C j The collection composed of.

[0109] Time-dependent attenuation factor Ω i The expression is as follows:

[0110]

[0111] Among them, lastupdate i Represents client C i The round of the last parameter update, e represents the base of the natural logarithm.

[0112] The expression of normalized comprehensive weight is as follows:

[0113]

[0114] Among them, ξ i [k] indicates client C i The corresponding normalized comprehensive weight, Ω i Represents client C i The corresponding time-sensitive attenuation factor, μ i [k] indicates client C i The similarity weight corresponding to the parameter position k in the parameter, C overlap [k] indicates the connection with client C i There is an overlapping set of clients at parameter position k, Ω j Represents client C j The corresponding time-sensitive attenuation factor, μ j [k] indicates client C j The similarity weight corresponding to the parameter at parameter position k in .

[0115] The embodiment of the present invention dynamically allocates aggregation weights through cosine similarity, combines the timeliness attenuation factor to suppress the interference of outdated parameters, and improves the parameter fusion efficiency under Non-IID data.

[0116] The server processes the parameters uploaded by the client differently according to the parameter position k. Based on the overlap of the client's parameters at that position, the update rules of the global model are divided into two cases: overlapping parameter aggregation and non-overlapping parameter retention. The expression of the global model after aggregation is as follows:

[0117]

[0118] in, represents the parameter of the global model at parameter position k in the t+1th iteration, ξ b [k] indicates client C b The corresponding normalized comprehensive weight, Indicates client C in the t+1th iteration b Train the uploaded local model parameters at parameter position k, C overlap [k] indicates the connection with client C i There are overlapping client sets at parameter position k, represents the parameter of the global model at parameter position k in the tth iteration.

[0119] The expression of the personalized model of the client after aggregation is as follows:

[0120]

[0121] in, represents the kth parameter in the client lottery network in the t+1th iteration, Indicates client C in the t+1th iteration i Corresponding client lottery network.

[0122] It can be understood that for the models uploaded by the clients participating in this round of aggregation, that is, if there is overlap in the parameter position k, the aggregated parameters Non-repeated parameters remain unchanged. For the global model, if no client updates the corresponding parameters of this model in this round, the parameters of the previous round will be used, i.e. If there is an update, use the current aggregation result The embodiment of the present invention utilizes a semi-asynchronous mechanism triggered by an elastic time window and a cardinality threshold to dynamically adjust the aggregation triggering conditions, thereby alleviating the "barrel effect" of the synchronization strategy and enhancing the system fault tolerance in heterogeneous device scenarios.

[0123] S5, loop iterate S2-S4 until the preset iteration rounds are completed, and output the personalized model of each client after aggregation in the current iteration process.

[0124] When obtaining a trained image classification model, the embodiment of the present invention updates each client pool through the server according to the client's historical participation status and current contribution in the client status information; then dynamically and randomly selects clients from the updated client pool to form a selected client pool, and uses the above-mentioned importance sampling strategy to preferentially activate clients with high gradient contributions to accelerate the convergence of the global model; balances the diversity of data distribution by designing a fairness compensation factor and a dynamic abandonment mechanism, and uses the directional consistency of similarity-weighted aggregation quantization parameter updates to suppress the interference of noise in the image classification process, thereby improving the accuracy and robustness of the image classification results; and finally forms a collaborative optimization closed loop of client selection and model aggregation, which solves the limitations of traditional image classification methods in complex classification scenarios, improves the performance and convergence speed of the trained image classification model, and realizes the multi-objective unification of efficient knowledge sharing, personalized adaptation and resource balanced scheduling, providing an integrated solution for image classification in complex heterogeneous scenarios that is both robust and practical.

[0125] To verify the effectiveness and superiority of the image classification method based on personalized, efficient, semi-asynchronous federated learning proposed in this embodiment of the present invention in complex heterogeneous environments, this embodiment of the present invention constructs a Non-IID dataset based on MNIST, CIFAR-10, and EMNIST using the Dirichlet distribution. The distribution parameter α is used to control the degree of Non-IID in the data, effectively simulating the complex data distribution in real-world scenarios. This experiment evaluates the performance of the image classification method based on personalized, efficient, semi-asynchronous federated learning in terms of test accuracy, communication cost, and convergence speed. Through comparative analysis, the proposed image classification method based on personalized, efficient, semi-asynchronous federated learning demonstrates its advantages in adapting to data distribution heterogeneity, reducing communication overhead, and improving model convergence speed.

[0126] Simulation Experiment 1

[0127] The simulation experiment runs T = 300 global iterations on the MNIST dataset and T = 600 on the CIFAR-10 and EMNIST datasets. A total of N = 100 clients participate in the training, with p = 10 clients selected for training in each iteration. The client-side local training iterations are E = 30, with a batch size of bs = 32 per iteration. The pruning rate r is fixed. p =0.2, target pruning rate r target =0.1, accuracy threshold acc threshold =0.2, learning rate η = 0.01, number of aggregated benchmarks Nbase = 5. Furthermore, a Dirichlet distribution was used to classify images on the classic datasets MNIST, CIFAR-10, and EMNIST. The distribution parameter α was set to 0.5, 0.1, and 0.01, respectively, to simulate varying degrees of non-IID. The classified datasets were distributed to each client, which trained using the training set and evaluated performance using the test set. In the simulation experiments, each client used a model with the same architecture. Table 1 shows the model configuration used for MNIST, CIFAR-10, and EMNIST.

[0128] Table 1 Model configuration table

[0129]

[0130] As can be seen, in this simulation, FedAvg, LG-FedAvg, Per-FedAvg, and Lottery-FL were selected as baseline algorithms for comparative experiments. Evaluation was performed using a local client test dataset. The classification accuracy of all clients was calculated and averaged as the final classification accuracy. This comparative analysis verified the proposed classification method's adaptability to data distribution heterogeneity. The classification accuracy results of SISA-FL, the image classification method based on personalized and efficient semi-asynchronous federated learning proposed in this embodiment of the present invention, compared with the baseline algorithms on different datasets are shown in Tables 2 to 4.

[0131] Table 2 Comparison of classification accuracy of SISA-FL and baseline algorithms on the MNIST dataset

[0132]

[0133] Table 3 Comparison of classification accuracy of SISA-FL and baseline algorithms on the CIFAR-10 dataset

[0134]

[0135] Table 4 Comparison of classification accuracy of SISA-FL and baseline algorithms on the EMNIST dataset

[0136]

[0137] As can be seen, SISA-FL achieves significantly higher classification accuracy than other baseline algorithms in all non-IID data scenarios across various datasets (α = [0.01, 0.1, 0.5]). Furthermore, as the value of α decreases, the non-IID nature of the data increases, and the classification accuracy of all algorithms decreases, but SISA-FL's advantage over the other algorithms further expands, demonstrating greater adaptability. On the MNIST dataset, when α decreases from 0.5 to 0.01, SISA-FL's classification accuracy only decreases by 1.56%, while the second-place LotteryFL drops by 2.12%. On the CIFAR-10 dataset, while the overall classification accuracy is lower, SISA-FL achieves even greater improvements. For example, when α = 0.5, SISA-FL's classification accuracy is 1.43 times that of FedAvg, and the gap widens to 1.67 times when α = 0.01.

[0138] Simulation Experiment 2

[0139] Using the same simulation experiment settings as simulation experiment 1, Dirichlet distribution is used to classify images on the datasets MNIST, CIFAR-10, and EMNIST, and a Non-IID dataset is constructed by setting the distribution parameter α = 0.1.

[0140] To evaluate the algorithm's performance in terms of communication cost, the total amount of data communicated between the client and server during the global training cycle was counted to measure the communication cost. For ease of comparison, all results were normalized to the communication volume ratio relative to the baseline algorithm, FedAvg. In this simulation, FedAvg, LG-FedAvg, Per-FedAvg, and Lottery-FL were selected as baseline algorithms for comparative experiments. Through comparative analysis, the proposed algorithm's advantage in reducing communication overhead was verified.

[0141] The accuracy-communication cost comparison chart of the image classification method based on personalized efficient semi-asynchronous federated learning and other baseline algorithms under different data sets, such as Figure 6a-6c As shown, from Figure 6a-6cIt can be seen that the image classification method SISA-FL based on personalized and efficient semi-asynchronous federated learning proposed in the embodiment of the present invention has an average communication cost of only 0.1687 on all data sets, which is 83.13% lower than FedAvg and Per-FedAvg. LG-FedAvg achieves partial communication optimization by separating global parameters and local parameters, but its communication volume is still 4.58 times that of SISA-FL. LotteryFL only transmits sparse subnet parameters, which improves communication efficiency to a certain extent. SISA-FL not only compresses single communication volume through iterative pruning, but also decouples the linear relationship between the number of clients and communication volume through a semi-asynchronous elastic aggregation strategy, significantly reducing the overall communication overhead of the system. The average communication cost on all data sets is reduced by 58.69% compared with LotteryFL. From Figure 6a-6c We also found that compared to other algorithms, SISA-FL reduces communication overhead while maintaining model accuracy. For example, on the CIFAR-10 dataset, SISA-FL achieved a 5.48% improvement in accuracy over LotteryFL, while using only 40.84% ​​of the communication overhead. SISA-FL demonstrates significant communication efficiency advantages in scenarios with extreme data distributions and limited communication.

[0142] Simulation Experiment 3

[0143] Using the same simulation experiment settings as simulation experiment 1, the Dirichlet distribution is used to divide the classic data sets MNIST and CIFAR-10, and the Non-IID data set is constructed by setting the distribution parameter α = 0.1.

[0144] To evaluate the algorithm's convergence speed, we analyzed the algorithm's convergence speed based on a curve showing how model accuracy changes with increasing training rounds. In this simulation, we selected FedAvg, LG-FedAvg, Per-FedAvg, and Lottery-FL as baseline algorithms for comparative experiments. This comparative analysis validated the proposed algorithm's superiority in improving model convergence speed.

[0145] The classification accuracy change curve of the image classification method based on personalized efficient semi-asynchronous federated learning and other baseline algorithms under different data sets, such as Figure 7a-7b As shown, from Figure 7a-7bAs can be seen from the results, SISA-FL significantly outperforms baseline algorithms in terms of convergence speed. On the MNIST dataset, SISA-FL achieves a stable classification accuracy of 85% in just 5 epochs of training, a 37.5% to 80.8% increase in convergence speed compared to FedAvg (26 epochs), LotteryFL (18 epochs), Per-FedAvg (8 epochs), and LG-FedAvg (22 epochs). On the CIFAR-10 dataset, SISA-FL achieves a classification accuracy of 70% in just 12 epochs, a 52.0% to 90.1% increase in convergence speed compared to LotteryFL (25 epochs), Per-FedAvg (69 epochs), and LG-FedAvg (121 epochs). This is primarily due to the importance sampling strategy used in the client comprehensive evaluation. This strategy approximates the client's contribution to the gradient update using the training loss, prioritizing clients with high gradients for training, thus achieving rapid convergence. Furthermore, on both datasets, SISA-FL's classification accuracy curve maintained a smooth growth, while FedAvg exhibited significant fluctuations. This stability is due, firstly, to a fairness compensation factor that increases the probability of selection for clients that have not participated in training for a long time, and secondly, to a dynamic deprecation mechanism that limits the maximum number of times a client can be selected, preventing overfitting caused by frequent selection of certain fixed clients. SISA-FL reached a stable state earlier than the baseline algorithms. This is attributed to the similarity-weighted aggregation strategy, which dynamically assigns aggregation weights through cosine similarity and quantifies the directionality of overlapping parameters. In non-IID data scenarios, this mechanism effectively suppresses the interference of noisy parameters in sparse subnetworks, improving the training efficiency of shared parameters.

[0146] Simulation Experiment 4

[0147] In this simulation, LotteryFL, a personalized federated learning method based on the lottery hypothesis, was selected as the baseline algorithm in a heterogeneous data scenario. The focus was on verifying the superiority of SISA-FL in terms of aggregation and client selection strategies. Compared to LotteryFL's traditional synchronous average aggregation strategy, SISA-FL introduces a semi-asynchronous aggregation mechanism, employing a sparse similarity aggregation strategy for weighted aggregation of shared parameters. Furthermore, for client selection, while the baseline algorithm uses a classic random selection strategy, SISA-FL constructs a dynamic client selection strategy that incorporates model contribution evaluation and multiple fairness compensation mechanisms.

[0148] Ablation experiments were designed using a modular replacement approach, with four sets of controlled experiments validating the independent contributions and synergistic effects of each component: 1) Full SISA-FL: Integrates a sparse similarity aggregation strategy with a dynamic client selection strategy. 2) SISA-FL w / o CS: Replaces only the aggregation mechanism with a sparse similarity aggregation strategy, retaining the baseline client random selection strategy. 3) SISA-FL w / o SA: Replaces only the client selection mechanism with a dynamic client selection strategy, retaining the baseline synchronous averaging aggregation strategy. 4) Baseline LotteryFL: Original algorithm configuration.

[0149] Using the same simulation setup as Experiment 1, we partitioned the classic MNIST and CIFAR-10 datasets using the Dirichlet distribution. A non-IID dataset was constructed by setting the distribution parameter α to 0.1. The experiment defined the minimum number of communication rounds T@acc required to achieve the target accuracy as the convergence efficiency metric, which measures the algorithm's performance in terms of training efficiency. Table 5 shows the ablation test results for SISA-FL on different datasets.

[0150] Table 5. SISA-FL ablation experiment results

[0151]

[0152] Experimental results demonstrate that SISA-FL demonstrates significant advantages on both the MNIST and CIFAR-10 datasets. The complete algorithm achieves a 2.59% improvement in accuracy on the MNIST dataset compared to the baseline algorithm, LotteryFL, while significantly reducing the number of training rounds required to reach the target accuracy. Furthermore, on the more complex CIFAR-10 dataset, SISA-FL's accuracy advantage expands to 3.26%, demonstrating its superior robustness in complex data scenarios. This demonstrates that SISA-FL effectively improves the training stability and convergence efficiency of the model on non-IID data through the coordinated optimization of its sparse similarity aggregation strategy and dynamic client selection strategy.

[0153] When only the aggregation mechanism is replaced with the sparse similarity aggregation strategy, client selection reverts to the baseline random strategy, but the model still achieves 1.30% and 1.87% accuracy improvements on MNIST and CIFAR-10, respectively, with 36.5% and 32.7% fewer convergence rounds. This result demonstrates that SSSA, through cosine similarity weighting, effectively addresses the inconsistent client parameter update direction issue in non-IID data, improving the efficiency of shared parameter aggregation. When only the client selection mechanism is replaced with the dynamic client selection strategy, the aggregation strategy adopts the baseline synchronous averaging, but accuracy still improves by 0.66% and 0.90%, with 44.2% and 37.8% fewer convergence rounds. This demonstrates that the dynamic client selection strategy, through its contribution evaluation and fairness compensation mechanism, significantly improves data utilization efficiency and accelerates model convergence.

[0154] Comparison of the two sets of ablation experiments revealed a significant synergistic effect between the sparse similarity aggregation strategy and the dynamic client selection strategy. The combined algorithm, SISA-FL, achieved an additional 0.63% and 0.49% improvement in accuracy on the MNIST and CIFAR-10 datasets, respectively, compared to the theoretical cumulative gains from independent improvements to the two modules. The convergence speed was also significantly accelerated. This synergistic effect stems from the interaction between the prioritized screening of high-value clients and the dynamic aggregation mechanism, which not only ensures the effective utilization of key data but also optimizes the integration efficiency of parameter updates. The experimental results validate the rationality of SISA-FL's design. The collaborative application of the sparse similarity aggregation strategy and the dynamic client selection strategy achieves multi-objective optimization of personalized federated learning in non-IID data scenarios.

[0155] The embodiments of the present invention address the problems of low inference accuracy, high communication overhead, and slow model convergence when using federated learning for image classification in complex environments with non-IID data scenarios and heterogeneous edge device systems. The proposed image classification method based on personalized and efficient semi-asynchronous federated learning effectively solves the core problem of traditional federated learning methods in image classification in complex heterogeneous environments by collaboratively optimizing client selection and parameter aggregation mechanisms. Specifically, the embodiments of the present invention effectively quantify the directional consistency of client parameter updates through a cosine similarity weighted aggregation strategy, significantly improve the generalization ability of the global model for heterogeneous data, and ensure the inference accuracy of the model on long-tail data distributions; by dynamically screening high-contribution clients and suppressing noise interference, the generalization ability of the global model and the local personalization effect are significantly improved, thereby improving the accuracy and robustness of the image classification results; by combining sparse pruning with an elastic time window mechanism, the communication overhead is significantly reduced to adapt to the lightweight requirements of edge devices; through fairness compensation and a dual-track collaborative selection strategy, client participation opportunities are balanced, data resource utilization imbalance is avoided, and the system collaborative efficiency and robustness are enhanced. In addition, while improving training efficiency, the semi-asynchronous aggregation mechanism alleviates the interference of stale gradients through a time-sensitive attenuation factor, enhances the system's fault tolerance in scenarios with significant differences in device computing power and fluctuating network delays, ensures model convergence stability, and provides an integrated solution that is both robust and practical for image classification in complex heterogeneous scenarios.

[0156] It should be noted that, in the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0157] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A personalized and efficient semi-asynchronous federated learning-based image classification method implemented by a server and a client, characterized in that: include: S1, initialization parameters; the parameters include: global model, client pool and client status information; S2, the server updates each client pool based on the client's historical participation status and current contribution in the client status information; dynamically and randomly selects clients from the candidate client pool and the potential client pool in the updated client pool to form a selected client pool; updates the client status information of the clients in the selected client pool and issues a personalized model corresponding to the selected client pool; S3, the client generates a client lottery network based on the client's personalized model; the client performs several rounds of batch stochastic gradient descent training using a local training dataset to update client-related parameters, and uploads the updated client-related parameters to the server after training is complete; the client-related parameters include: client lottery network, mask, value indicator, and time parameter; the local training dataset includes: image data and category labels corresponding to the image data; S4, the server performs parameter overlap detection on the received client-related parameters, and obtains a normalized comprehensive weight by calculating a similarity weight and a timeliness attenuation factor; the server performs differentiated processing on the client-related parameters according to parameter positions, and obtains an aggregated global model and an aggregated personalized model for each client based on the normalized comprehensive weight; S5, looping through S2-S4 until the preset iteration rounds are completed, using the personalized models of each client aggregated in the current iteration as the trained image classification model; in the first iteration, the initialized global model is used as the personalized model corresponding to the selected client pool; S6, using the trained image classification model to process the image to be classified to obtain an image classification result.

2. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 1 is characterized in that: The client pool includes: The client pool includes the pool of candidates for selection, the pool of potential clients, the pool of selected clients, the pool of backup clients and the pool of super-selected and discarded clients.

3. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 2 is characterized in that: The client status information includes: Mask, time parameter, value indicator, fairness compensation factor, client evaluation, last selected round, number of selections and upper limit of selection.

4. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 3 is characterized in that: The server updates each client pool according to the client's historical participation status and current contribution in the client status information, including: The server checks the number of times each client has been selected. If the number of times the client has been selected is 0, the client is placed in a potential client pool. If the number of times the client has been selected reaches a preset upper limit, the client is placed in a super-selected abandoned client pool. The server updates the client evaluation according to the value index and fairness compensation factor of each client, and puts the clients corresponding to the client evaluations that meet the preset threshold into the candidate client pool, thereby updating each client pool.

5. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 4 is characterized in that: The server updates the client evaluation according to the value index and fairness compensation factor of each client, and places the clients corresponding to the client evaluations that meet the preset threshold into the candidate client pool, including: The server updates the value index and fairness compensation factor of each client based on the client's historical participation status and current contribution; Based on the weight coefficient, the client evaluation is updated using the updated value index and fairness compensation factor; The clients whose client evaluations meet the preset threshold are placed into the pool of candidates. The expression of the preset threshold is as follows: S threshold =S p ·(1-x%); Among them, S p represents the client evaluation of the (1-β)p-th client, β represents the exploration factor, and χ represents the confidence interval parameter.

6. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 5 is characterized in that: The method of dynamically and randomly selecting clients from the candidate client pool and the potential client pool in the updated client pool to form a selected client pool includes: Randomly select (1-β)p clients from the updated candidate client pool, and randomly select βp clients from the updated potential client pool to form the selected client pool.

7. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 1 is characterized in that: The expression of the client lottery network is as follows: in, Indicates client C in the t+1th iteration i The corresponding client lottery network, represents the global model after initialization, ⊙ represents element-by-element multiplication, Indicates client C in the t+1th iteration i The corresponding mask is learned.

8. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 1 is characterized in that: The expression of the normalized comprehensive weight is as follows: Among them, ξ i [k] indicates client C i The corresponding normalized comprehensive weight, Ω i Represents client C i The corresponding time-sensitive attenuation factor, μ i [k] indicates client C i The similarity weight corresponding to the parameter position k in the parameter, C overlap [k] indicates the connection with client C i There is an overlapping set of clients at parameter position k, Ω j Represents client C j The corresponding time-sensitive attenuation factor, μ j [k] indicates client C j The similarity weight corresponding to the parameter at parameter position k in .

9. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 1 is characterized in that: The expression of the aggregated global model is as follows: in, represents the parameter of the global model at parameter position k in the t+1th iteration, ξ b [k] indicates client C b The corresponding normalized comprehensive weight, Indicates client C in the t+1th iteration b Train the uploaded local model at parameter position k, C overlap [k] indicates the connection with client C i There are overlapping client sets at parameter position k, represents the parameter of the global model at parameter position k in the tth iteration.

10. The image classification method based on personalized efficient semi-asynchronous federated learning according to claim 9 is characterized in that: The personalized model of the aggregated client is expressed as follows: in, represents the kth parameter in the client lottery network in the t+1th iteration, Indicates client C in the t+1th iteration i Corresponding client lottery network.