A data-free quantum federated learning method based on a single communication
By employing single-communication and pseudo-sample generation techniques, this method addresses the communication and resource constraints in quantum federated learning, enabling efficient and privacy-preserving quantum model training suitable for NISQ devices.
Patent Information
- Application Number
- CN202511971267.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-12-25
AI Technical Summary
Existing quantum federated learning faces problems such as high communication overhead, difficulty in balancing privacy protection and efficiency, and severe limitations in quantum hardware resources, making it difficult to achieve large-scale training on NISQ devices.
A single-communication mechanism is adopted, in which the client trains the classical model locally and uploads the model representation information, while the server builds an integrated teacher model, generates pseudo samples and transfers knowledge to the quantum student model through soft-label distillation, and uses a classical-quantum hybrid architecture for training.
It significantly reduces communication overhead and deployment costs, improves training efficiency, reduces dependence on quantum hardware, achieves privacy protection, and is suitable for NISQ devices.
Smart Images

Figure CN121390213B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of federated learning, and more specifically, relates to a data-free quantum federated learning method based on a single communication. Background Technology
[0002] Quantum machine learning has developed rapidly in recent years, giving rise to various typical models such as variable quantum circuits and quantum convolutional neural networks, and demonstrating potential advantages in tasks such as high-dimensional feature mapping, few-shot learning, and complex pattern fitting. However, current quantum computing is still in the era of Noisy Medium-Scale Quantum (NISQ), and its technical characteristics determine that quantum model training is still subject to several limitations: on the one hand, the number of available qubits is limited, making it difficult to support the construction of large-scale quantum circuits; on the other hand, qubits and their operations are susceptible to noise interference, leading to significant errors in algorithm execution, and the circuit depth and number of executions are constrained by insufficient coherence time. In addition, NISQ devices do not yet have complete quantum error correction capabilities, so quantum computing usually needs to rely on classical computing resources for auxiliary optimization or hybrid training. These factors together make it very challenging to efficiently train complex quantum machine learning models under current hardware conditions.
[0003] In recent years, the cross-fertilization of quantum computing and federated learning has gradually become a research hotspot, with quantum federated learning (QFL) attracting widespread attention as an emerging field. Existing research has systematically categorized the technical paths of quantum federated learning (QFL) based on system functional requirements and the characteristics of quantum algorithms, mainly into two directions: efficient quantum federated learning (EffQFL) and secure quantum federated learning (SecQFL). EffQFL aims to leverage the potential advantages of quantum algorithms in feature mapping, search efficiency, and model representation capabilities to improve the overall performance and computational efficiency of federated learning tasks; while SecQFL focuses on the characteristics of quantum computing in security protocols, key distribution, and communication protection, enhancing the privacy protection strength and system security of federated learning through quantum cryptography. These two approaches have different focuses in their objectives, but they are complementary in promoting the practical application of quantum computing in federated learning scenarios, together forming the main technical framework of current QFL research.
[0004] While QFL theoretically combines the privacy advantages of federated learning with the potential performance improvements of quantum machine learning, current technologies still face several key limitations in practical applications. For example, in the paper "Towards Quantum Federated Learning," Ren et al. systematically analyzed the key challenges currently facing quantum federated learning, pointing out that the limitations of the number of qubits and coherence time in NISQ devices severely hinder large-scale quantum model training. The shortcomings of existing technologies are mainly reflected in the following four aspects:
[0005] (1) Quantum resources are scarce and difficult to support complex quantum federated training tasks.
[0006] Currently, the quantum computing devices upon which QFL relies are still in the NISQ stage, with extremely limited available quantum resources (including the number of available qubits, quantum circuit depth, number of reusable calls, and effective coherence time). Complex quantum models or multiple rounds of iterative training will rapidly consume quantum resources, making it impossible for the system to stably execute large-scale federated training and difficult to guarantee the effective expressive power of the quantum model.
[0007] (2) Privacy and security mechanisms consume a lot of resources and reduce training efficiency.
[0008] While quantum cryptography and privacy-preserving techniques can enhance the security of QFL, these mechanisms often introduce significant communication and computational overhead. For example, operations such as quantum key distribution, quantum encryption, and differential privacy all degrade system performance, making it difficult to simultaneously meet the requirements of privacy protection and efficient training in practical deployments.
[0009] (3) Weak scalability of data and client scale
[0010] Existing QFL models perform poorly when handling large-scale data or a large number of clients. Quantum models themselves are limited by physical hardware in terms of encoding capabilities, high-dimensional representation, and trainability, making it difficult to handle the massive, multimodal, or non-IID data common in federated learning. Furthermore, problems such as the vanishing quantum gradient further restrict the scaling of QFL to large-scale tasks.
[0011] (4) The quantum communication infrastructure is not mature, and the communication cost is actually higher.
[0012] QFL theoretically relies on a quantum communication network to connect multiple quantum nodes, but in reality, quantum communication links are costly to build, lack stability, and are limited in distance, with related infrastructure still underdeveloped. In this context, even with a reduction in the number of communication rounds, the actual cost of quantum communication may still exceed the classical communication overhead of traditional federated learning, limiting the practical feasibility of QFL. Summary of the Invention
[0013] This invention aims to overcome at least one of the defects of the existing technology and provide a data-free quantum federated learning method based on a single communication. It solves the technical problems of high communication overhead, difficulty in balancing privacy protection and efficiency, and severe limitation of quantum hardware resources in existing quantum federated learning through three stages: client pre-training stage, pseudo-sample generation stage, and quantum knowledge distillation stage.
[0014] The detailed technical solution of this invention is as follows:
[0015] A data-free quantum federated learning method based on a single communication, the method comprising:
[0016] S1. Multiple clients independently train classic models based on their own local data. After training, they only communicate once to upload the model representation information to the server.
[0017] S2. After receiving the model representation information uploaded by each client, the server integrates this information to construct an integrated teacher model.
[0018] S3. Under the guidance of the integrated teacher model, the server uses a pseudo-sample generator to synthesize pseudo-samples from random noise. The pseudo-samples are image data, which are used as training data for the subsequent quantum student model.
[0019] S4. Using the generated pseudo-samples, the knowledge of the integrated teacher model is transferred to the quantum student model through soft label distillation, and finally a unified quantum student model is obtained on the server side.
[0020] According to a preferred embodiment of the present invention, in step S1, each participating institution acts as a client, independently training the classic local model using private data in its local computing environment. The entire training process and related data are stored locally on the client. The specific process is as follows:
[0021] S11, The client uses a local sample set. The classic model is trained locally by calculating the average loss across all training samples and iteratively optimizing to obtain the parameter vector. This minimizes the average loss of the model on the local samples, thus obtaining a local model that performs well on the local samples. This process can be described as follows:
[0022] (1)
[0023] in, Indicates the first Prediction function for each client; For supervised loss functions used in classification tasks, the cross-entropy function is typically employed. It is a local sample set The number of samples in the middle; It is the input feature of the j-th sample in the i-th client's local dataset; Is with the sample The corresponding real tags; It is the local model parameter vector of the i-th client; These are the optimal local model parameters obtained by the i-th client after optimization;
[0024] S12. After the client completes training, it sends the model representation information of non-original data to the server using a single communication mechanism.
[0025] According to a preferred embodiment of the present invention, the specific steps of S2 are as follows:
[0026] The server receives from These model representations for each client are directly averaged to obtain the output representation of the ensemble teacher model; the predicted output refers to the unnormalized classification score of the model for the input sample, usually called logits; each client's input... The logits are denoted as Then the logits of the integrated teacher model are expressed as:
[0027] (2)
[0028] And from this, the predicted distribution of the integrated teacher model is obtained. This leads to the formation of an integrated teacher model.
[0029] According to a preferred embodiment of the present invention, the specific steps of S3 are as follows:
[0030] S31. The server initializes a generator that receives random noise sampled from a standard Gaussian distribution. And generate initial pseudo-samples, specifically expressed as follows:
[0031] (3)
[0032] in, It is noise from random sampling; It is a generator, the model that needs to be optimized in this stage, which learns to generate pseudo-samples that approximate the real data distribution. These are pseudo-samples output by the generator under input noise z; It is a multidimensional Gaussian distribution with zero mean and covariance matrix equal to the identity matrix;
[0033] S32. The generator's overall goal is to achieve the goal of jointly minimizing the cross-entropy loss and the boundary support loss function, that is, to make the pseudo-samples close to the real data in terms of class confidence and discrimination boundary, thereby maximizing the recovery of the semantic features required for knowledge transfer without accessing the original data.
[0034] S321. Use the logits of the integrated teacher model obtained in S2. Supervision of spurious samples:
[0035] (4)
[0036] in, These are pseudo-samples output by the generator. Indicates the integrated teacher model to The predicted distribution;
[0037] Based on the integrated teacher model The predicted distribution is given, and the cross-entropy loss of the generator is defined as:
[0038] (5)
[0039] in, For the parameters of the generator, Randomly initialized category labels;
[0040] By minimizing the cross-entropy loss, the generator is driven to generate pseudo-samples that can produce stable, high-confidence predictions on the integrated teacher model, making its semantic features closer to the real data distribution and providing effective training samples for the subsequent quantum knowledge distillation stage.
[0041] S322. Pseudo-samples generated solely by cross-entropy loss are typically concentrated in high-confidence regions of the teacher model's decision space. While these samples are discriminative, they lack the boundary information required for knowledge transfer. To improve the effectiveness of knowledge transfer, boundary support loss is introduced to encourage the generator to generate "hard samples" in regions where the teacher and student models make inconsistent decisions.
[0042] (6)
[0043] in, is a weighting coefficient, and its value is 1 if and only if the teacher model and the student model predict different categories; It is determined by parameters The student model represents the pseudo-samples The predicted probability distribution represents the class probability distribution output by the student model;
[0044] By maximizing the KL divergence between teacher and student predictions, the generator is driven to generate samples near the decision boundary, which can enhance the student model's ability to learn complex category features in subsequent distillation. This mechanism is essentially an "adversarial knowledge extension" that forces the student model to acquire the teacher's discriminative ability in regions of high uncertainty.
[0045] S323. Combining the above two constraints, the total loss function of the generator is:
[0046] (7)
[0047] in It is a hyperparameter used to balance the contributions of various losses. By continuously optimizing this objective, the server can eventually obtain a high-quality pseudo-sample set for training the quantum student model.
[0048] According to a preferred embodiment of the present invention, the specific steps of S4 are as follows:
[0049] S41. The server will process the pseudo-samples generated by the pseudo-sample generator. The input is fed into the ensemble teacher model, which maintains fixed parameters during the inference phase and is used only to provide knowledge guidance. Its output, logits, is denoted as... ,in This represents the set of parameters for the integrated teacher model.
[0050] S42. The server will process the pseudo-samples generated by the pseudo-sample generator. The input is fed into a trainable quantum student model, which performs forward propagation on the same input samples, outputting logits. ,in Represents the set of parameters for the student model;
[0051] S43. Employ a distillation loss function based on soft tags:
[0052] First, apply a temperature smoothing operation to the outputs of both teachers and students to obtain the probability distributions:
[0053] (8)
[0054] (9)
[0055] in The temperature coefficient is used to smooth the output distribution, enabling the student model to learn the relative relationships between categories rather than relying solely on hard labels. It is the target category; It is a categorical summation index, representing all possible categories; and These are teacher and student model pairs. The logits output;
[0056] Subsequently, the KL divergence measure was used to measure the output difference between teachers and students, and the distillation loss function was defined as follows:
[0057] (10)
[0058] in It is the KL divergence, representing the probability distribution of the teacher model. Probability distribution of the student model The difference between them; the process of minimizing the loss function is essentially to guide the student model to gradually approach the feature space distribution of the teacher model through soft labels, thereby learning a smoother and more generalizable decision boundary.
[0059] S44. Update the parameters of the student model, while keeping the teacher model frozen. The optimizer uses stochastic gradient descent. The parameter update rule for the student model is as follows:
[0060] (11)
[0061] in The learning rate is represented by the number of pseudo-samples extracted from the synthesizer in each training round. The teacher model performs one forward propagation and generates logits, while the student model calculates the prediction results based on... Perform backpropagation and gradient update;
[0062] S45. The entire process does not involve any real data and relies entirely on the pseudo-sample set provided by the generator. After training, the server finally obtains a unified, directly deployable quantum student model, realizing a quantum federated learning process with a single communication mechanism, no data pseudo-sample training, and a classical-quantum hybrid architecture.
[0063] According to a preferred embodiment of the present invention, the quantum student model employs a quantum convolutional neural network (QCNN). The QCNN model is composed of a quantum convolutional module and a classical convolutional neural network connected in series. The quantum part is responsible for performing nonlinear feature mapping in a high-dimensional Hilbert space, thereby enhancing the expressive power of local structural features. The classical part, on the other hand, makes full use of its mature feature fusion and classification capabilities to complete the final decision. The combination of the two can fully leverage the expressive power of quantum computing in large linear transformation spaces, as well as the advantages of classical deep networks in terms of stability and generalization ability.
[0064] Specifically, in the quantum learning model, pseudo-samples are first encoded and then mapped to the quantum state space to form the input state. In quantum circuits, this state is achieved through parameterized quantum circuits. After the action, it transforms into an output state:
[0065] (12)
[0066] And the output quantum state is obtained by measuring the operator. The data is converted into classical data, which will then be further input into the subsequent classical convolutional part. After convolution, pooling and other operations, deep feature extraction and fusion are performed, and finally the quantum student model outputs logits.
[0067] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0068] (1) The present invention deploys classical models locally on each client and quantum models on the server. The upload and distillation of model parameters or teacher models are completed through a single communication mechanism. No quantum communication network is required, which realizes efficient collaborative training and significantly reduces communication overhead and deployment costs.
[0069] (2) This invention solves this problem through a classical-quantum hybrid architecture: the client retains the classical model, while all quantum computations are performed centrally in the quantum student model on the server side. By distilling knowledge from the classical teacher model to the quantum student model, the knowledge trained locally is transferred to the quantum model, achieving efficient federated learning tasks, while significantly reducing the dependence on quantum hardware, enabling the system to run stably on NISQ devices.
[0070] (3) The present invention adopts the data-free knowledge distillation technology. By generating pseudo samples on the server side for student model training, the client does not need to upload real data or frequently execute high-cost security protocols, thus achieving privacy protection and model collaborative optimization, thereby improving training efficiency while ensuring data security. Attached Figure Description
[0071] Figure 1 This is a flowchart of the data-free quantum federated learning method based on a single communication as described in this invention.
[0072] Figure 2 This is a flowchart of the client pre-training stage as described in this embodiment of the invention.
[0073] Figure 3 This is a flowchart of the pseudo-sample generation stage described in this embodiment of the invention.
[0074] Figure 4 This is a flowchart of the quantum knowledge distillation stage as described in this embodiment of the invention.
[0075] Figure 5 This is a schematic diagram of the pseudo-sample described in an embodiment of the present invention.
[0076] Figure 6It is the training convergence curve graph on different data sets in the embodiments of the present invention. Specific Embodiments
[0077] The following further describes the present disclosure in conjunction with the accompanying drawings and embodiments.
[0078] Embodiment 1
[0079] Refer Figure 1 , this embodiment provides a data-free driven quantum federated learning method based on single communication, and the method includes:
[0080] S1. Client pre-training stage: Multiple clients independently train classical models relying on their respective local data. After the training is completed, only a single communication is carried out to upload the model representation information to the server;
[0081] S2. Integrated teacher model construction stage: After the server receives the model representation information uploaded by each client, it uniformly fuses this information to construct an integrated teacher model. This integrated teacher model serves as a global supervision module to provide a consistent guidance signal for the subsequent pseudo-sample generation stage and quantum knowledge distillation stage;
[0082] S3. Pseudo-sample generation stage: Under the guidance of the integrated teacher model, the server uses a pseudo-sample generator to synthesize pseudo-samples from random noise. As Figure 5 shown, the pseudo-samples are image data and serve as the training data for the subsequent quantum student model;
[0083] S4. Quantum knowledge distillation stage: Using the generated pseudo-samples, the knowledge of the integrated teacher model is transferred to the quantum student model through soft label distillation, and finally a unified quantum student model is obtained on the server side.
[0084] The specific steps of S1 are as follows:
[0085] As Figure 2 shown, in the first stage of the present invention, each participating institution acts as a client and independently completes the training of the classical model in the local computing environment. The entire training process and related data are retained locally on the client to ensure that data privacy is not leaked. Let the th client have a local sample set , and its goal is to obtain the parameter vector through iterative optimization to minimize the average loss of the model on the local samples. This process can be expressed as:
[0086] (1)
[0087] Among them, represents the prediction function of the th client; For supervised loss functions used in classification tasks, the cross-entropy function is typically employed. It is a local sample set The number of samples in the middle; It is the input feature of the j-th sample in the i-th client's local dataset; Is with the sample The corresponding real tags; It is the local model parameter vector of the i-th client; These are the optimal local model parameters obtained by the i-th client after optimization. The formula means that the client calculates the average loss across all training samples and repeatedly adjusts the model parameters to gradually reduce this loss, thereby obtaining a model that performs well on local samples. The entire training process is completed entirely within the client, without involving the external transmission of any raw data.
[0088] After each client completes local training, the present invention adopts a single communication mechanism, which allows the client to send model representation information that is not the original data to the server only after training is completed. These representations can be the model output after training, model parameter snapshots, or statistics obtained during training.
[0089] The specific steps of S2 are as follows:
[0090] In the second stage of this invention, the server receives data from... After representing these models for each client, an integrated teacher model for the entire system is constructed. To achieve simple and robust fusion, the server directly averages the prediction outputs of all clients to obtain the output representation of the integrated teacher model. The prediction output refers to the unnormalized classification score of the model for the input sample, usually called logits. The logits are denoted as Then the logits of the integrated teacher model are expressed as:
[0091] (2)
[0092] And from this, the predicted distribution of the integrated teacher model is obtained. This results in an integrated teacher model with stronger generalization ability. Since the integrated teacher model integrates information from multiple data sources, it can not only alleviate the model bias problem caused by heterogeneous data distribution, but also serve as a guiding signal for data generator-less models, laying the foundation for subsequent pseudo-sample synthesis.
[0093] The specific steps for S3 are as follows:
[0094] The third stage of this invention aims to construct a pseudo-sample generator for the server side that does not require real data, enabling the training of subsequent quantum student models even in environments where privacy cannot be shared. The server first initializes a generator network that takes a random noise vector as input and optimizes it through multiple constraints, ensuring that the generated pseudo-samples not only activate the discriminative ability of the teacher model but also possess structural characteristics consistent with real data statistics. The basic form of the generator can be expressed as:
[0095] (3)
[0096] in, It is noise from random sampling; It is a generator, the model that needs to be optimized in this stage, which learns to generate pseudo-samples that approximate the real data distribution. These are pseudo-samples output by the generator under input noise z; It is a multidimensional Gaussian distribution with zero mean and covariance matrix equal to the identity matrix.
[0097] like Figure 3 As shown, generator Receive random noise sampled from a standard Gaussian distribution And generate pseudo samples The pseudo-samples at this stage have not yet been optimized; they are merely the initial output of the generator, with the goal of making them... The distribution is similar to that of the client's training data.
[0098] The overall goal of the generator is to make the pseudo-samples closely approximate the real data in terms of both class confidence and discriminative boundaries, thereby maximizing the recovery of the semantic features required for knowledge transfer without accessing the original data. This process is achieved by jointly minimizing two core loss functions: cross-entropy loss and boundary support loss.
[0099] (1) Cross-entropy loss
[0100] Cross-entropy loss is used to ensure the consistency and discriminative power of spurious samples across the teacher model ensemble. Since no real labeled data is available, the logits of the ensemble teacher model obtained in S2 are used. Supervision of spurious samples:
[0101] (4)
[0102] in, These are pseudo-samples output by the generator. Indicates the integrated teacher model to The predicted distribution.
[0103] Based on the above predicted distribution, the cross-entropy loss of the generator is defined as:
[0104] (5)
[0105] in, For the parameters of the generator, The class labels are randomly initialized. By minimizing this cross-entropy loss, the generator is driven to produce pseudo-samples that can generate stable, high-confidence predictions on the ensemble teacher model, making its semantic features closer to the real data distribution and providing effective training samples for the subsequent quantum knowledge distillation stage.
[0106] (2) Boundary support loss
[0107] Pseudo-samples generated solely by cross-entropy loss are typically concentrated in high-confidence regions of the teacher model's decision space. While these samples possess discriminative power, they lack the boundary information necessary for knowledge transfer. To improve the effectiveness of knowledge transfer, this invention introduces boundary support loss, encouraging the generator to generate "hard samples" in regions where the teacher and student models' decisions are inconsistent.
[0108] (6)
[0109] is a weighting coefficient with a value of 1 if and only if the teacher model and the student model predict different categories. It is a student model (by parameters) (Indicates) pseudo-samples The predicted probability distribution represents the class probability distribution of the student model's output. By maximizing the KL divergence between the teacher's and student's predictions, the generator is driven to generate samples near the decision boundary, enabling these samples to enhance the student model's ability to learn complex class features during subsequent distillation. This mechanism is essentially an "adversarial knowledge extension," forcing the student model to acquire the teacher's discriminative ability in regions of high uncertainty.
[0110] Combining the above two constraints, the generator's total loss function is:
[0111] (7)
[0112] in These are hyperparameters used to balance the contributions of various losses. By continuously optimizing this objective, the server can eventually obtain a high-quality set of pseudo-samples for training the quantum student model.
[0113] The specific steps for S4 are as follows:
[0114] like Figure 4As shown, after generating pseudo-samples, the server enters the third stage, which is to train the quantum student model based on pseudo-samples without data.
[0115] To enable the quantum student model to acquire knowledge from the integrated teacher model, this invention employs a classical-to-quantum knowledge distillation technique. Specifically, by using soft labels generated from pseudo-samples by the integrated teacher model as supervision signals, the quantum student model can approximate the behavioral distribution of the teacher model as closely as possible under the constraints of quantum structure. In the specific implementation, the server first processes the pseudo-samples generated by the pseudo-sample generator... The input is fed into the ensemble teacher model, which maintains fixed parameters during the inference phase and is used only to provide knowledge guidance. Its output, logits, is denoted as... ,in This represents the set of parameters for the integrated teacher model.
[0116] Then the server will generate pseudo-samples from the pseudo-sample generator. The input is fed into a trainable quantum student model, which performs forward propagation on the same input samples, outputting logits. ,in This represents the set of parameters for the student model.
[0117] This invention employs a quantum convolutional neural network (QCNN) as the quantum student model. The QCNN model consists of a quantum convolutional module and a classical convolutional neural network connected in series. The quantum part is responsible for performing nonlinear feature mapping in a high-dimensional Hilbert space, thereby enhancing the expressive power of local structural features. The classical part, on the other hand, fully utilizes its mature feature fusion and classification capabilities to complete the final decision. The combination of these two approaches fully leverages the expressive power of quantum computing in large linear transformation spaces, as well as the advantages of classical deep networks in terms of stability and generalization ability.
[0118] Specifically, in the quantum learning model, pseudo-samples are first encoded and then mapped to the quantum state space to form the input state. In quantum circuits, this state is achieved through parameterized quantum circuits. After the action, it transforms into an output state:
[0119] (8)
[0120] And the output quantum state is obtained by measuring the operator. The data is converted into classical data, which will then be further input into subsequent classical convolutional parts. After convolution, pooling, and other operations, deep feature extraction and fusion are performed, ultimately outputting logits. .
[0121] To achieve knowledge transfer, this invention employs a distillation loss function based on soft tags:
[0122] First, apply a temperature smoothing operation to the outputs of both teachers and students to obtain the probability distributions:
[0123] (9)
[0124] (10)
[0125] in The temperature coefficient is used to smooth the output distribution, enabling the student model to learn the relative relationships between categories rather than relying solely on hard labels. It is the target category; It is a categorical summation index, representing all possible categories; and These are teacher and student model pairs. The logits output;
[0126] Subsequently, the (Kullback–Leibler) KL divergence is used to measure the output difference between teachers and students, and the distillation loss function is defined as follows:
[0127] (11)
[0128] in It is the KL divergence, representing the probability distribution of the teacher model. Probability distribution of the student model The difference between them; the process of minimizing the loss function is essentially to guide the student model to gradually approach the feature space distribution of the teacher model through soft labels, thereby learning a smoother and more generalizable decision boundary.
[0129] During training and optimization, only the parameters of the student model are updated, while the teacher model remains frozen. The optimizer uses stochastic gradient descent, and its parameter update rule is as follows:
[0130] (12)
[0131] in This represents the learning rate. In each training round, spurious samples are extracted in batches from the synthesizer, the teacher model performs one forward propagation and generates logits, and the student model calculates the prediction results based on... Perform backpropagation and gradient update.
[0132] The entire process does not involve any real data, relying entirely on a set of pseudo-samples provided by the generator. After training, the server ultimately obtains a unified, directly deployable quantum student model, realizing a quantum federated learning process with a single-communication mechanism, no data pseudo-sample training, and a classical-quantum hybrid architecture.
[0133] Experimental example
[0134] To verify the effectiveness of the method described in this invention, experimental evaluations were conducted on two publicly available datasets: MNIST and Fashion-MNIST. The MNIST dataset consists of 70,000 grayscale images of handwritten digits, with 60,000 images in the training set and 10,000 in the test set. The images are 28×28 pixels in size and belong to 10 categories (digits 0–9). This dataset has a simple structure and low noise, and is often used to evaluate the baseline classification performance and convergence characteristics of models. The Fashion-MNIST dataset also contains 70,000 28×28 grayscale images, categorized into 10 categories of clothing items (such as T-shirts, shoes, bags, etc.). Compared to MNIST, Fashion-MNIST presents greater challenges in terms of texture diversity, shape complexity, and category similarity, making it an important benchmark dataset for measuring a model's generalization ability and robustness.
[0135] Figure 6 The curves showing the training accuracy of the method of this invention on different datasets as a function of training epochs are presented, where the blue line represents the result trained on the MNIST dataset, and the red line represents the result trained on the Fashion-MNIST dataset. Figure 6 As can be seen, the method of this invention can rapidly improve model performance in the early stages of training and achieve stable convergence after approximately 20 training epochs. Throughout the training process, the model accuracy curve remains stable without significant oscillations, indicating that the quantum knowledge distillation and pseudo-sample generation mechanism proposed in this invention can stably support the training process of the quantum student model. Specifically, training based on MNIST achieves approximately 98% accuracy, and training based on Fashion-MNIST achieves approximately 82% accuracy, demonstrating that the method of this invention has good adaptability and convergence under different data distributions.
[0136] Furthermore, the method proposed in this invention is compared with mainstream federated learning baseline methods, and the results are shown in Table 1. Table 1 includes the number of clients, communication rounds, and final model accuracy for different methods. Here, FedAvg is the classic federated averaging algorithm, FedAvg-QCNN is a quantum convolutional neural network model trained within the FedAvg framework, and Ours is the single-round communication scheme proposed in this invention.
[0137] Table 1 shows that the method of the present invention can achieve an accuracy of 98.1% with only one communication, which is comparable to FedAvg-QCNN (98.45%) which requires 50 rounds of communication, and significantly better than the communication efficiency of traditional FedAvg-CNN (99.26%); achieving a more efficient trade-off between communication cost and model performance.
[0138] Table 1. Comparison of the Invention Method with Existing Federated Learning Methods
[0139]
[0140] Figure 6 The training accuracy curve and the comparison results of the federated learning method in Table 1 together demonstrate that the present invention has the following technical effects:
[0141] (1) Extremely low communication overhead
[0142] Traditional federated learning requires multiple rounds of parameter interaction. This invention employs a single-communication mechanism, completing model training in just one round of communication, significantly reducing communication costs and network load. This is particularly suitable for applications with limited bandwidth and equipment. Comparative studies show that this method achieves 98.1% accuracy with only one communication.
[0143] (2) The demand for quantum resources is extremely low.
[0144] This invention concentrates the main optimization process on the server side, eliminating the need for the client to deploy a quantum model. The quantum student model only needs to perform a few rounds of distillation training on the server side to complete knowledge transfer. Compared to quantum federated training methods that require repeated quantum forward and backward propagation, this invention significantly reduces the number of quantum circuit calls, making it more suitable for the practical conditions of current quantum hardware, such as limited qubit count, high noise, and short coherence time.
[0145] (3) Stronger privacy protection capabilities
[0146] In this invention, the client only needs to upload model representation information, without uploading any original data, which can effectively avoid the risk of user data leakage and meet the data security compliance requirements of highly sensitive privacy fields such as medical care, finance, and government affairs.
[0147] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.
Claims
1. A single-communication-based data-free federated learning method for quantum, characterized in that, The method comprises: S1, multiple clients independently train classical models based on respective local data, and after training, only a single communication is performed to upload model representation information to a server; S2, after receiving the model representation information uploaded by each client, the server directly averages the prediction outputs of all clients to obtain an output representation of an integrated teacher model, and constructs an integrated teacher model therefrom; The predicted output refers to the unnormalized classification scores of the model for the input samples, called logits; the logits of the input for each client are denoted as The logits of the ensemble teacher model are denoted as (2) wherein, denotes the logits of the integrated teacher model, K denotes the number of clients; S3, under the guidance of the integrated teacher model, the server synthesizes pseudo samples from random noise using a pseudo sample generator, the pseudo samples being image data serving as training data for a subsequent quantum student model, specifically as follows: S31, the server initializes a generator, the generator receives a random noise sampled from a standard Gaussian distribution and generates an initial pseudo sample, which is expressed in the form of: (3) wherein, is a randomly sampled noise; is a generator, a model to be optimized in this stage, which generates pseudo samples that approximate the real data distribution by learning; is a pseudo sample output by the generator under the input noise z; is a multi-dimensional Gaussian distribution with a mean of zero and a covariance matrix of a unit matrix; S32, joint minimization of cross-entropy loss and boundary support loss function is used to achieve the overall goal of the generator, that is, to make the pseudo samples close to the real data in terms of class confidence and decision boundary, so as to maximize the recovery of semantic features required for knowledge transfer without accessing the original data: S321、using the logits of the integrated teacher model obtained in S2 Supervising the pseudo samples: (4) wherein, a pseudo sample output by the generator, denotes the predictive distribution of the ensemble teacher model on the set of training examples. Based on the integrated teacher model The predicted distribution is given, and the cross-entropy loss of the generator is defined as: (5) wherein, parameters for the generator, randomly initialized class labels; S322, the boundary support loss is introduced to encourage the generator to generate difficult samples in the area where the teacher model and the student model make inconsistent decisions: (6) wherein, is a weight coefficient, and its value is 1 only when the teacher model and the student model are inconsistent in predicting the category; is a prediction probability distribution of the student model represented by the parameter on the pseudo sample , and represents the category probability distribution output by the student model; S323, by combining the above two loss functions, the total loss function of the generator is: (7) wherein is a hyper-parameter used to balance the contribution of each loss, by continuously optimizing this objective, the server can eventually obtain a high-quality pseudo-sample set for training the quantum student model; S4, using the generated pseudo samples, the knowledge of the integrated teacher model is transferred to the quantum student model through soft label distillation, and finally a unified quantum student model is obtained at the server end; The quantum student model adopts a quantum convolutional neural network (QCNN), which is composed of a quantum convolutional module and a classical convolutional neural network in series. The quantum part is responsible for performing nonlinear feature mapping in a high-dimensional Hilbert space, while the classical part fully utilizes its mature feature fusion and classification capabilities to complete the final decision. Specifically, in the quantum learning model, the pseudo samples are first mapped to the quantum state space after being encoded, forming the input state In the quantum circuit, this form is converted into the output state after the parameterized quantum circuit acts. (12) The output quantum state is obtained by measuring the operator. The data is converted to classical data, which is then further input into the subsequent classical convolutional part. After convolution and pooling operations, deep feature extraction and fusion are performed, and finally the quantum student model outputs logits.
2. The single communication based data-free federated quantum learning method according to claim 1, wherein, In step S1, each participating institution acts as a client and independently completes the training of a classical local model using private data in a local computing environment. The entire training process and related data are retained locally on the client, and the specific process is as follows: S11, the client uses the local sample set The classical model is locally trained by calculating the average loss of all training samples and repeatedly iterating to optimize the parameter vector The average loss of the model on the local sample is minimized, so as to obtain a local model with good performance on the local sample, and the process can be expressed as: (1) wherein, denotes the prediction function of the i-th client; denotes the prediction function of the i-th client; is a supervised loss function for classification tasks, adopting a cross-entropy function; is the number of samples in the local sample set is the number of samples in the local sample set is the input feature of the j-th sample in the i-th client's local data set; is the real label corresponding to the sample is the real label corresponding to the sample is the local model parameter vector of the i-th client; is the optimal local model parameter obtained by the i-th client after optimization. S12, after the client completes the training, a single communication mechanism is used to send model representation information of non-original data to the server.
3. The single communication based data-free federated quantum learning method according to claim 1, wherein, the predictive distribution of the ensemble teacher model in S2 to form the ensemble teacher model.
4. The single communication based data-free federated quantum learning method according to claim 3, wherein, The specific steps of S4 are as follows: S41、the server generates the pseudo sample generated by the pseudo sample generator into the integrated teacher model, the integrated teacher model keeps parameters fixed in an inference stage and is only used to provide knowledge guidance, and an output logits of the integrated teacher model is recorded as wherein denotes a parameter set of the integrated teacher model S42、the server generates the pseudo sample generated by the pseudo sample generator to the trainable quantum student model, the student model performs forward propagation on the same input sample, and outputs logits as wherein denotes a parameter set of the student model; S43, a soft label-based distillation loss function is used: First, temperature smoothing is applied to the outputs of the teacher and student to obtain probability distributions: (8) (9) where is the temperature coefficient, used to smooth the output distribution, enabling the student model to learn the relative relationships between classes rather than relying solely on hard labels; is the target class; is the class sum index, representing all possible classes; and are the logits outputs of the teacher and student models for class respectively. Then, the KL divergence is used to measure the difference between the outputs of the teacher and student, and the distillation loss function is defined as: (10) wherein is the KL divergence, representing the difference between the probability distribution of the teacher model and the probability distribution of the student model S44, the parameters of the student model are updated, while the teacher model remains in a frozen state. The optimizer uses stochastic gradient descent, and the parameter update rule of the student model is: (11) wherein denotes the learning rate, in each training round, the pseudo samples are batched from the synthesizer, the teacher model performs a forward propagation and generates logits, after the student model calculates the prediction results, based on back propagation and gradient update are performed; S45, after training, the server finally obtains a unified and directly deployable quantum student model, realizing a quantum federated learning process with single communication mechanism, data-free pseudo sample training, and classical-quantum hybrid architecture.
Citation Information
Patent Citations
Federal learning method and system based on knowledge distillation
CN115965084A
Dynamic model training method, system and equipment based on annular knowledge distillation and meta-federal learning
CN117010534A