A cognitive diagnosis method based on federated learning
By introducing federated learning into the cognitive diagnostic model, and using parameter decoupling and aggregation mechanisms, the problems of data privacy and security risks in the existing cognitive diagnostic model are solved, and accurate and fair diagnostic results are achieved while protecting user privacy.
Patent Information
- Application Number
- CN202510166779.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-14
AI Technical Summary
The existing cognitive diagnostic model relies on learning data that centrally trains users, and has data privacy and security risks, limiting its usefulness.
The cognitive diagnostic method based on federated learning is adopted to store the data on the local client, and the model parameters are updated through the parameter decoupling personalized strategy and the difference-aware aggregation and loss-aware aggregation mechanism.
It realizes accurate cognitive diagnosis while protecting user privacy, ensuring that each client obtains fair diagnostic results.
Smart Images

Figure CN119624724B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart education cognitive modeling, and specifically is a cognitive diagnosis method based on federated learning. Background Art
[0002] With the rapid development of Internet technology, many web-based online intelligent education platforms have emerged and achieved significant growth, such as JunYi, Khan, Coursera, MOOC, PTA, etc. These online intelligent education platforms have attracted many users (i.e., students or learners) and generated a large amount of various learning data. By collecting and analyzing these distributed learning data, online intelligent education platforms can evaluate the abilities of users and then provide them with effective learning recommendation services, including exercise recommendations, course recommendations, and learning path recommendations, to further improve their ability to master knowledge concepts. The process of diagnosing students' mastery of specific knowledge concepts is called cognitive diagnosis, which is a basic upstream technology but plays a key role in online intelligent education platforms. This is because the accuracy of the diagnostic results greatly affects the quality of downstream recommendations.
[0003] In order to model these collected user historical learning data, researchers invented a series of cognitive diagnostic models based on various ideas, which can be divided into three types:
[0004] The first category focuses on the interpretability of the model, thereby creating a cognitive diagnostic model based on educational psychology theory, of which IRT, MIRT and DINA are representative methods. Considering the powerful modeling ability of neural networks;
[0005] The second category aims to combine neural networks with the above CDM to improve diagnostic accuracy, among which representatives include NCD, KaNCD, KSCD, and RCD. In order to save the manpower of manually designing cognitive diagnostic models;
[0006] The third category uses the idea of automated machine learning, such as neural architecture search to search for cognitive diagnosis models, and EMO-NAS-CD and NAS-GCD are representatives of them.
[0007] Although existing cognitive diagnosis models have achieved considerable success, they rely on collecting all users' learning data together for centralized training. This is effective in model training, but has been criticized for data privacy and security risks, because user data is often highly sensitive, but centralized storage and processing raises privacy issues and increases the risk of data leakage. As a result, many users are reluctant to share their data, limiting the practicality of the current cognitive diagnosis model paradigm. To achieve a data privacy-preserving cognitive diagnosis paradigm, federated learning enables users to keep their data on the local client without sharing the data, and train the model by only communicating model parameters between the user client and the central server. Although federated learning has made significant progress in many tasks, such as recommendation, medical imaging, and the Internet of Things, it has not yet been explored in cognitive diagnosis to protect user privacy. Summary of the invention
[0008] The present invention aims to fill the gap in federated cognitive diagnosis and provide fair diagnostic results for each client; to this end, the present invention proposes a cognitive diagnosis method based on federated learning, which seeks to combine federated learning with cognitive diagnosis to ensure the diagnostic accuracy of the cognitive diagnosis model while protecting user privacy. Based on the personalized strategy of parameter decoupling, the shared parameters are updated through difference-aware aggregation and loss-aware aggregation respectively, and the parameters of the diagnostic function are locally saved as private parameters.
[0009] To achieve the above objectives, the first aspect of the present invention provides a cognitive diagnosis method based on federated learning, comprising:
[0010] S1: Define the interaction record between students and exercises; obtain the data set, and the server initializes the model parameters; the data set includes ASSIST2009 and ASSIST2012;
[0011] S2: The server distributes parameters to the client;
[0012] S3: The client receives model parameters; the client trains and updates parameters locally; the client uploads model parameters to the server; the server aggregates user embeddings and item embeddings;
[0013] S4: Output the probability of a specified student correctly answering the exercise based on the relevant information; wherein the relevant information includes the student's ability, the difficulty of the exercise, the discrimination of the exercise and the concepts involved.
[0014] Preferably, the step of defining the interaction record between the student and the exercise includes:
[0015] Define the student set S = {s1, s2, ..., s N}, where N is the total number of students; define the exercise set E = {e1, e2, …, e M}, where M is the total number of exercises; define the knowledge concept set C={c1,c2,…,c K}, where K is the total number of knowledge concepts; the interaction record between students and exercises is defined as R={R1, R2, …, R n}; Among them, interaction Indicates the student's answer to the exercise. Indicates students, Indicates the exercises performed by students. Indicates that students are interested in the exercise The answer result is 1≤i≤n.
[0016] Preferably, the step of obtaining a data set and initializing a model parameter on a server includes:
[0017] Extract the feature X provided by the dataset input ={S,E,R,T,Q,O}, X of length L input Defined as:
[0018] X input ={S,E,R,T,Q,O}={S={s1,s2,…,s L}, E={e1,e2,…,e L},
[0019] R={r1,r2,…,r L}, T={t1,t2,…,t L}, Q={q1,q2,…,q L}, O={o1,o2,…,o L}};
[0020] Among them, S represents student information, E represents exercise information, R represents student answer results, T represents school information, Q represents concept information, and O represents other information. It can contain multiple features, and O contains at least one feature;
[0021] The server initializes the model parameters according to the selected cognitive diagnosis model , obtained by Parameterized cognitive diagnostic model .
[0022] Preferably, the school information includes:
[0023] The data is further divided according to the school information. The number of schools is the number of clients. The students of T schools are defined as ,in Indicates students in the school, define The interaction records of students in a school are .
[0024] Preferably, the server distributes the parameters to the client, including:
[0025] Decoupling cognitive diagnosis model parameters into three parts ,in Represents the student embedding related parameters, represents the relevant parameters of the exercise embedding, Represents diagnostic function parameters;
[0026] If the current communication is the first round of communication between the client and the server, the server will All are distributed to the client, otherwise, the server only distributes To the client.
[0027] Preferably, the cognitive diagnosis model parameter decoupling includes:
[0028] The purpose of decoupling the cognitive diagnosis model parameters is to find different parameters for different parts of each client, so that the sum of the losses of each client is minimized, and the losses of each client after parameter aggregation are also minimized, satisfying the following:
[0029] ,
[0030] ,
[0031] in and Represents the parameter search space. The above formula is a two-level optimization problem.
[0032] Preferably, the client receives model parameters and obtains model input, including:
[0033] Each client has an independent cognitive diagnosis model locally. If the current communication is the first round of communication between the client and the server, the client receives all parameters. And use the parameters to initialize the local cognitive diagnosis model, otherwise, the client receives Initialize the student embedding and exercise embedding of the local cognitive diagnosis model;
[0034] The student embedding module Emb1(·) and the exercise embedding module Emb2(·) in the tth client can be expressed as:
[0035] ,
[0036] is where D is the embedding size, usually equal to K, and are two learnable parameter matrices that store the embedding parameters of all students and all exercises.
[0037] Preferably, the client locally trains and updates model parameters, including:
[0038] The local cognitive diagnosis model uses NCD, and its forward propagation process is as follows:
[0039] ,
[0040] ,
[0041] ,
[0042] , where 𝜎(·) represents the Sigmoid activation function, and Indicates the difficulty and discrimination of the exercise. The last item indicates the three-layer fully connected layer used. Its three parameters are and , therefore, the diagnostic function parameters of the tth client can be expressed as .
[0043] The local cognitive diagnosis model uses binary cross entropy as the loss function:
[0044] Use stochastic gradient descent to update parameters. Each customer's model needs to be updated in the data After Num rounds of training, the new round of .
[0045] Preferably, the client uploads the model parameters to the server, including:
[0046] The client will Upload to the server for aggregation and Keep it locally and use it directly as the initial parameter for the next round.
[0047] Preferably, the server aggregates student embedding and exercise embedding, including:
[0048] After all client models are trained locally, the central server is responsible for aggregating the parameter sets uploaded by them, i.e., the student embedding parameter sets. and practice embedding parameter sets .
[0049] The following difference-aware aggregation mechanism is adopted to obtain the new student embedding parameters :
[0050] in represents the student embedding parameters obtained in the previous round, If the corresponding bit is not equal to 0, it returns 1, otherwise it returns 0;
[0051] The following loss-aware aggregation mechanism is used to obtain new training embedding parameters :
[0052] ,in , is the normalized weight of the t-th client parameter, Is to adjust the customer loss function value Parameters of importance.
[0053] Preferably, the loss function of the client includes:
[0054] Define the loss function of the tth client as in represents the local data of t clients, and each client only uses local data for training and evaluation.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] (1) The present invention applies federated learning to cognitive diagnosis to train cognitive diagnosis models for multiple local clients without sharing original student learning data. Based on a parameter decoupled personalization strategy, it can fairly and accurately diagnose students of any client regardless of the client's data quality.
[0057] (2) The parameter decoupling-based personalization strategy designed by the present invention divides the model parameters in each client into two parts: a local personalized part and a global shared part across all clients and servers. The former contains model parameters related to diagnostic functions to alleviate client fairness issues, and the latter contains student and exercise embedding parameters, which are updated through difference-aware aggregation and loss-aware aggregation, respectively. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 It is a schematic diagram of the method steps of the present invention. DETAILED DESCRIPTION
[0060] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] See also Figure 1 The first aspect of the present invention provides a cognitive diagnosis method based on federated learning, comprising:
[0062] S1: Define the interaction record between students and exercises; obtain the data set, and the server initializes the model parameters; the data set includes ASSIST2009 and ASSIST2012;
[0063] S2: The server distributes parameters to the client;
[0064] S3: The client receives model parameters; the client trains and updates parameters locally; the client uploads model parameters to the server; the server aggregates user embeddings and item embeddings;
[0065] S4: Output the probability of a specified student correctly answering the exercise based on the relevant information; wherein the relevant information includes the student's ability, the difficulty of the exercise, the discrimination of the exercise and the concepts involved.
[0066] This application defines the interaction record between students and exercises, including:
[0067] Define the student set S = {s1, s2, ..., s N}, where N is the total number of students; define the exercise set E = {e1, e2, …, e M}, where M is the total number of exercises; define the knowledge concept set C={c1,c2,…,c K}, where K is the total number of knowledge concepts; the interaction record between students and exercises is defined as R={R1, R2, …, R n}; Among them, interaction Indicates the student's answer to the exercise. Indicates students, Indicates the exercises performed by students. Indicates that students The answer to the exercise is 1≤i≤n.
[0068] In this application, the dataset and server initialization model parameters are obtained, including:
[0069] Extract the feature X provided by the dataset input ={S,E,R,T,Q,O}, X of length L input Defined as:
[0070] X input ={S,E,R,T,Q,O}={S={s1,s2,…,s L}, E={e1,e2,…,e L},
[0071] R={r1,r2,…,r L}, T={t1,t2,…,t L}, Q={q1,q2,…,q L}, O={o1,o2,…,o L}};
[0072] Among them, S represents student information, E represents exercise information, R represents student answer results, T represents school information, Q represents concept information, and O represents other information. It can contain multiple features, and O contains at least one feature;
[0073] The server initializes the model parameters according to the selected cognitive diagnosis model, and obtains the parameterized cognitive diagnosis model .
[0074] The school information in this application includes:
[0075] The data is further divided according to the school information. The number of schools is the number of clients. The students of T schools are defined as ,in Indicates students in the school, define The interaction records of students in a school are .
[0076] In this application, the server distributes parameters to the client, including:
[0077] Decoupling cognitive diagnosis model parameters into three parts ,in Represents the student embedding related parameters, represents the relevant parameters of the exercise embedding, Represents diagnostic function parameters;
[0078] If the current communication is the first round of communication between the client and the server, the server will All are distributed to the client, otherwise, the server only distributes To the client.
[0079] The cognitive diagnosis model parameters in this application are decoupled, including:
[0080] The purpose of decoupling the cognitive diagnosis model parameters is to find different parameters for different parts of each client, so that the sum of the losses of each client is minimized, and the losses of each client after parameter aggregation are also minimized, satisfying the following:
[0081] ,
[0082] ,in and Represents the parameter search space. The above formula is a two-level optimization problem.
[0083] In this application, the client receives model parameters and obtains model input, including:
[0084] Each client has an independent cognitive diagnosis model locally. If the current communication is the first round of communication between the client and the server, the client receives all parameters. And use the parameters to initialize the local cognitive diagnosis model, otherwise, the client receives Initialize the student embedding and exercise embedding of the local cognitive diagnosis model;
[0085] The student embedding module Emb1(·) and the exercise embedding module Emb2(·) in the tth client can be expressed as:
[0086] ,
[0087] ,
[0088] is where D is the embedding size, usually equal to K. and are two learnable parameter matrices that store the embedding parameters of all students and all exercises.
[0089] In this application, the client locally trains and updates model parameters, including:
[0090] The local cognitive diagnosis model uses NCD, and its forward propagation process is as follows:
[0091] ,
[0092] ,
[0093] ,
[0094] ,
[0095] Where 𝜎(·) represents the Sigmoid activation function, and represents the difficulty and discrimination of the exercise. The last term represents the three-layer fully connected layer used, and its three parameters are and Therefore, the diagnostic function parameters of the tth client can be expressed as .
[0096] The local cognitive diagnosis model uses binary cross entropy as the loss function:
[0097] Use stochastic gradient descent to update parameters. Each customer's model needs to be updated in the data After Num rounds of training, the new round of .
[0098] In this application, the client uploads model parameters to the server, including:
[0099] The client will Upload to the server for aggregation and Keep it locally and use it directly as the initial parameter for the next round.
[0100] In this application, the server aggregates student embedding and exercise embedding, including:
[0101] After all client models are trained locally, the central server is responsible for aggregating the parameter sets uploaded by them, i.e., the student embedding parameter sets. and practice embedding parameter sets .
[0102] The following difference-aware aggregation mechanism is adopted to obtain the new student embedding parameters :
[0103] ,in represents the student embedding parameters obtained in the previous round, If the corresponding bit is not equal to 0, it returns 1, otherwise it returns 0;
[0104] The following loss-aware aggregation mechanism is used to obtain new training embedding parameters :
[0105] in , is the normalized weight of the t-th client parameter, Is to adjust the customer loss function value Parameters of importance.
[0106] The client loss function in this application includes:
[0107] in represents the local data of t clients, and each client only uses local data for training and evaluation.
[0108] It is worth noting that in order to verify the effectiveness of the method of the present invention, the present invention selected the most challenging real-world education datasets ASSIST 2009 and ASSIST 2012. For these two datasets, we deleted those with less than 5 student interaction records and less than 1000 school interaction records, and removed duplicate data.
[0109] This embodiment uses accuracy (ACC), area under the ROC curve (AUC) and root mean square error (RMSE) as evaluation criteria.
[0110] In this embodiment, NCD and DINA under three federation frameworks are selected to compare the effects with the method of the present invention. The selected methods are FedAvg, FedAtt, LoAdaBoost, FedCD (FedAvg) and FedCD (FedAtt). FedCD is the method of the present invention. The experimental results are shown in Table 1:
[0111] Table 1 Experimental results of the method of the present invention and the comparison algorithm on the ASSIST2009 and ASSIST2012 datasets for answer prediction:
[0112]
[0113] From Table 1, we can see that FedCD achieves the best results on the public large-scale datasets ASSIST2009 and ASSIST2012. The experiment proves that the framework of the present invention can accurately predict students' answers.
[0114] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.
[0115] Working principle of the present invention:
[0116] The present invention defines the interaction record between students and exercises; obtains data sets, and the server initializes model parameters; the server distributes parameters to the client; the client receives the model parameters and obtains model input; the client locally trains and updates the model parameters; the client uploads the model parameters to the server; the server aggregates student embedding and exercise embedding; and outputs the probability that a specified student correctly answers an exercise.
[0117] This paper proposes a cognitive diagnosis method based on federated learning. The proposed FedCD follows the basic procedures of common federated learning methods, but adopts a novel personalized strategy based on parameter decoupling. The main idea is to divide the model parameters into two parts: a local personalized part and a global shared part, where the former enables each client to have personalized parameters to alleviate client fairness issues; the latter adopts different parameter aggregation mechanisms to update student embedding and exercise embedding parameters.
[0118] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A cognitive diagnosis method based on federated learning, characterized in that: S1: Define the interaction record between students and exercises, obtain the data set, and initialize the model parameters on the server; S2: The server distributes parameters to the client; S3: The client receives the model parameters, trains and updates the parameters locally, uploads the model parameters to the server, and the server aggregates user embeddings and item embeddings; S4: Based on the relevant information, output the probability that the specified student correctly answers the exercise; The definition of the interaction record between students and exercises includes: Define the student set S = {s1, s2, ..., s N }, where N is the total number of students; define the exercise set E = {e1, e2, …, e M }, where M is the total number of exercises; define the knowledge concept set C={c1,c2,…,c K }, where K is the total number of knowledge concepts; the interaction record between students and exercises is defined as R={R1, R2, …, R n }; Among them, interaction Indicates the student's answer to the exercise. Indicates students, Indicates the exercises performed by students. Indicates that students are interested in the exercise The answer result is 1≤i≤n; The server distributes parameters to the client, including: Decoupling cognitive diagnosis model parameters into three parts ,in Represents the student embedding related parameters, represents the relevant parameters of the exercise embedding, Represents diagnostic function parameters; If the current communication is the first round of communication between the client and the server, the server will All are distributed to the client, otherwise, the server only distributes To the client; The cognitive diagnosis model parameter decoupling includes: The purpose of decoupling the cognitive diagnosis model parameters is to find different parameters for different parts of each client, so that the sum of the losses of each client is minimized, and the losses of each client after parameter aggregation are also minimized, satisfying the following: in and The above expression indicates that the parameter search space is a two-level optimization problem; The client receives model parameters and obtains model input, including: Each client has an independent cognitive diagnosis model locally. If the current communication is the first round of communication between the client and the server, the client receives all parameters. And use the parameters to initialize the local cognitive diagnosis model, otherwise, the client receives Initialize the student embedding and exercise embedding of the local cognitive diagnosis model; The server aggregates student embedding and exercise embedding, including: After all client models are trained locally, the central server is responsible for aggregating the parameter sets uploaded by them, i.e., the student embedding parameter sets. and practice embedding parameter sets , The following difference-aware aggregation mechanism is adopted to obtain the new student embedding parameters : in represents the student embedding parameters obtained in the previous round, If the corresponding bit is not equal to 0, it returns 1, otherwise it returns 0; The following loss-aware aggregation mechanism is used to obtain new training embedding parameters : in , is the normalized weight of the t-th client parameter, Is to adjust the customer loss function value Parameters of importance.
2. A cognitive diagnosis method based on federated learning according to claim 1, characterized in that: The step of obtaining a data set and initializing model parameters on a server includes: Extract the feature X provided by the dataset input ={S,E,R,T,Q,O}, X of length L input Defined as: X input ={S,E,R,T,Q,O}={S={s1,s2,…,s L }, E={e1,e2,…,e L }, R={r1,r2,…,r L }, T={t1,t2,…,t L }, Q={q1,q2,…,q L }, O={o1,o2,…,o L }}; Among them, S represents student information, E represents exercise information, R represents student answer results, T represents school information, Q represents concept information, and O represents other information, including multiple features, and O contains at least one feature; The server initializes the model parameters according to the selected cognitive diagnosis model , obtained by Parameterized cognitive diagnostic model .
3. A cognitive diagnosis method based on federated learning according to claim 2, characterized in that: The school information includes: The data is further divided according to the school information. The number of schools is the number of clients. The students of T schools are defined as ,in Indicates The interaction record of students in the tth school is defined as .
4. The cognitive diagnosis method based on federated learning according to claim 1, characterized in that: The student embedding module Emb1(·) and the exercise embedding module Emb2(·) in the tth client are expressed as: , , is where D is the embedding size, usually equal to K, and are two learnable parameter matrices that store the embedding parameters of all students and all exercises.
5. The cognitive diagnosis method based on federated learning according to claim 1, characterized in that: The client locally trains and updates model parameters, including: The local cognitive diagnosis model uses NCD, and its forward propagation process is as follows: , , , , where 𝜎(·) represents the Sigmoid activation function, and Indicates the difficulty and discrimination of the exercise. The last item indicates the three-layer fully connected layer used, and its three parameters are and , therefore, the diagnostic function parameters of the tth client are expressed as , The local cognitive diagnosis model uses binary cross entropy as the loss function: Use stochastic gradient descent to update parameters. Each customer's model needs to be updated in the data After Num rounds of training, the new round of .
6. The cognitive diagnosis method based on federated learning according to claim 1, characterized in that: The client uploads the model parameters to the server, including: The client will Upload to the server for aggregation and Keep it locally and use it directly as the initial parameter for the next round.
7. A cognitive diagnosis method based on federated learning according to claim 6, characterized in that: The loss function of the client includes: The loss function of the tth client is defined as: in represents the local data of t clients, and each client only uses local data for training and evaluation.
Citation Information
Patent Citations
Personalized federal learning method for Alzheimer's disease auxiliary diagnosis
CN116843036A
Cognitive diagnosis method for anti-fact fairness
CN117474399A