A cognitive diagnosis method of counterfactual fairness

By constructing a cognitive diagnostic model for counterfactual fairness, the false correlation effect of sensitive attributes on prediction results is blocked, thus solving the unfairness problem in existing cognitive diagnostic methods and achieving fair and accurate prediction of students' knowledge proficiency.

CN117474399BActive Publication Date: 2026-02-03HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311462970.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-06
Publication Date
2026-02-03
Estimated Expiration
2043-11-06

AI Technical Summary

Technical Problem

Existing cognitive diagnostic methods are prone to misuse of sensitive attributes when using student exercise data, leading to unfair prediction results. In particular, they are inaccurate for students who are at a disadvantage in sensitive attributes, affecting the accuracy and reliability of cognitive diagnosis.

Method used

By constructing multi-source data, defining student, exercise, and self-achievement attributes, a definition of fairness in cognitive diagnosis is proposed. The spurious association effect of sensitive attributes on prediction results is calculated, and this effect is blocked in the model. A cognitive diagnosis model with counterfactual fairness is constructed, and the model parameters are optimized using the cross-entropy loss function to achieve fair prediction.

Benefits of technology

It effectively alleviates the unfairness of diagnosing students' knowledge proficiency, improves the accuracy of cognitive diagnosis, and ensures fair and accurate prediction of students' knowledge mastery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117474399B_ABST
    Figure CN117474399B_ABST
Patent Text Reader

Abstract

The application discloses a kind of counterfactual fairness cognitive diagnosis method, comprising:1. Construct multi-source data: student-exercise interaction record, student-self attribute, sensitive attribute and the like data;2. Propose definition of fairness in cognitive diagnosis;3. In traditional cognitive diagnosis, calculate biased overall causal effect;4. In model inference stage, design counterfactual cognitive diagnosis model, calculate the false correlation effect of sensitive attribute to knowledge proficiency, while subtracting it from the biased overall effect calculated in step 3, realize the fairness of cognitive diagnosis.The application is based on the idea of counterfactual debiasing, by capturing the false correlation generated only by sensitive attribute, and then subtracting it from the biased overall effect, which can effectively alleviate the fairness problem in cognitive diagnosis while maintaining the usefulness of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cognitive diagnosis in smart education, specifically a cognitive diagnosis method for counterfactual fairness. Background Technology

[0002] Cognitive diagnostics aims to measure students' knowledge proficiency through their responses to exercises and forms the basis of many intelligent education scenarios, such as student performance prediction, computer-adaptive testing, and online exercise recommendation. Traditional cognitive diagnostic methods primarily focus on improving the accuracy and interpretability of the diagnosis, and these methods have achieved good predictions of students' knowledge proficiency levels. However, due to the sparsity of student exercise data, these methods often concentrate on maximizing data utilization, which may lead to the model's misuse of student-sensitive attributes.

[0003] The misuse of students' sensitivities manifests as unfairness in predictive outcomes in cognitive diagnostics. An unfair cognitive diagnostic approach is one that biases decision-making towards a particular group. For example, students with an advantage in sensitivities tend to overestimate their knowledge proficiency, while students with a disadvantage in sensitivities tend to underestimate their knowledge proficiency, even if their actual knowledge level is the same.

[0004] However, fairness is rarely addressed in current cognitive diagnostic methods. This negatively impacts the accuracy and reliability of cognitive diagnostics, especially in out-of-distribution scenarios. This bias arising from the misuse of sensitive attributes may stem from differences in data collection methods, characteristic variations, and preprocessing techniques. For example, records from students with an advantage in sensitive attributes might be easier to collect and constitute a larger proportion of the dataset, while records from those with a disadvantage in sensitive attributes might be less represented. Consequently, the model might focus more on the advantageous students and neglect the disadvantaged ones. Therefore, minimizing spurious associations in modeling student proficiency to ensure the fairness of cognitive diagnostic results is a crucial area for further research. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes a cognitive diagnostic method for counterfactual fairness. This method effectively alleviates the unfairness in diagnosing students' knowledge proficiency while improving the accuracy of cognitive diagnosis, thereby enabling more accurate prediction of students' answers and their mastery of specific knowledge points.

[0006] The present invention adopts the following technical solution to solve the technical problem:

[0007] The present invention provides a cognitive diagnostic method for counterfactual fairness, characterized by the following steps:

[0008] Step 1: Construct multi-source data, including: student-exercise interaction records, student-self-achieved attributes, and sensitive attributes;

[0009] Step 1.1: Define the student set U = {u1, u2, ..., u3}. i , ...u |U|}, where u i Let |U| represent the i-th student, and |U| represent the total number of students, where 1 ≤ i ≤ |U|.

[0010] Define the set of exercises as E = {e1, e2, ..., e...} j …,e |E|}, where e j Let |E| represent the j-th exercise, and |E| represent the total number of exercises, where 1 ≤ j ≤ |E|.

[0011] Define the set of knowledge points C = {c1, c2, ..., c...} k …, c |C|}, where c k Let |C| represent the k-th knowledge point, and |C| represent the total number of knowledge points, where 1≤k≤|C|;

[0012] Step 1.2: Let T = {t1, t2, ..., t} l …, t |T|} represents the set of student-achieved attributes, where t l Let |T| represent the l-th self-achieved attribute, and |T| represent the total number of self-achieved attributes, where 1 ≤ l ≤ |T|.

[0013] Let the student's binary sensitivity attribute matrix A = [a1, a2, ..., a... i , ...a |U| ], a i Represents the i-th student u i The sensitive attribute value, and a i ∈{0,1}, based on the sensitive attribute values, the student set U is split into two sub-clusters, U0={u i |a i =0} represents the subset of users whose sensitive attribute value is 0, U1 = {u i |a i =1} represents a subset of users whose sensitive attribute value is 1;

[0014] Step 1.3: Have students record their answers to the exercises in an interaction matrix R = {r ij} |U| × |E| , where r ij Represents the i-th student u i Answer the j-th exercise e j The score of the i-th student, u i Answer the j-th question correctly. jThen let r ij =1, if the i-th student u i The j-th question was answered incorrectly. j Then let r ij =0, if the i-th student u i The j-th question was not answered. j Then let r ij =-1;

[0015] Let the association matrix of exercises and knowledge points be Q={q jk} |E|×|C| , where q jk Let e ​​represent the j-th exercise. j Is it related to the k-th knowledge point c? k Related, if q jk =1 indicates correlation; if q jk =0 indicates no correlation;

[0016] Step 1.4: Let the i-th student u i Information on all self-achieved attributes is in, Represents the i-th student u i In the l-th self-achieved attribute t l The information above, if the i-th student u i In the l-th self-achieved attribute t l If there is no record, then let

[0017] Step 2: Based on the estimated impact of binary sensitive attribute values ​​on cognitive diagnostic results, a definition of fairness in cognitive diagnosis is proposed:

[0018] Step 2.1: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (1). g underestimation rate

[0019]

[0020] In equation (1), U g Let g represent the g-th sub-cluster, where g∈{0,1}; U represents the g-th sub-cluster. g The number of false negative samples; The g-th sub-cluster U g The actual number of samples in the middle;

[0021] Step 2.2: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (2). g overestimation

[0022]

[0023] In equation (2), and Represent the g-th sub-cluster body U respectively g The number of false positive samples and the number of true negative samples;

[0024] Step 2.3: If equations (3) and (4) hold, it means that the cognitive diagnostic model has a consistent prediction preference for the two sub-clusters U0 and U1.

[0025]

[0026] Equation (3) indicates that the cognitive diagnostic model has a consistent false negative prediction preference for the two sub-clusters U0 and U1;

[0027]

[0028] Equation (4) indicates that the cognitive diagnostic model has a consistent false positive prediction preference for the two sub-clusters U0 and U1;

[0029] Step 3: Calculate the biased overall causal effect in traditional cognitive diagnosis:

[0030] Step 3.1, let Represents the i-th student u i One-hot encoding characterization, Represents the i-th student u i The self-caused property M i The corresponding multi-hot encoding representation is used to calculate the i-th student u obtained from the cognitive diagnostic model through equation (5). i Knowledge proficiency

[0031]

[0032] In equation (5), B and C represent two matrices to be learned, σ is the sigmoid activation function, and α i For the i-th student u i A parameter to be learned is set;

[0033] Step 3.2, let Let e ​​represent the j-th exercise. j The one-hot encoding representation of the exercises is then calculated according to equation (6) for the j-th exercise e. j Knowledge point matrix

[0034]

[0035] Step 3.3: Let D and D′ be two matrices to be learned, then calculate the j-th exercise e according to equation (7). j Difficulty representation

[0036]

[0037] Calculate the j-th exercise e according to equation (8). j Discrimination characterization

[0038]

[0039] According to equation (9), we obtain the equation for the j-th exercise e. j A set of knowledge point matrices, difficulty levels, and discrimination characteristics.

[0040]

[0041] Step 3.4, let Represents the i-th student u i Sensitive attribute a i The multi-hot encoding representation is then calculated using equation (10) to calculate the i-th student u generated by the spurious association of sensitive attributes. i Knowledge proficiency

[0042]

[0043] In equation (10), C′ is the matrix to be learned;

[0044] Step 3.5: Using G(·) to represent the interaction function of the cognitive diagnostic model, the i-th student u output by the cognitive diagnostic model is obtained according to equation (11). i For the j-th exercise e j Relying solely on student self-achievement attribute M i Predicted value

[0045]

[0046] According to equation (12), the spurious association of the sensitive attribute output by the cognitive diagnostic model generates the i-th student u. i For the j-th exercise e j Predicted value

[0047]

[0048] According to equation (13), the i-th student u output by the cognitive diagnostic model is obtained. i For the j-th exercise e j Predicted value That is, a biased overall causal effect:

[0049]

[0050] Step 3.6: Construct a cognitive diagnostic model relying solely on student self-achievement attributes using equation (14) and the cross-entropy loss function Loss. s :

[0051]

[0052] In equation (14), Represents the i-th student u i The complete set of all the exercises to be answered;

[0053] Using Equation (15), the cross-entropy loss function generated by spurious associations of sensitive attributes in the cognitive diagnostic model is constructed. a :

[0054]

[0055] A cognitive diagnostic model is constructed using Equation (16), employing the cross-entropy loss function Loss for both student self-achievement and sensitivity attributes. a,s :

[0056]

[0057] Step 3.7: Use equation (17) to obtain the overall objective function Loss of the cognitive diagnostic model;

[0058] Loss = Loss a,s +Loss s +Loss a (17)

[0059] Step 3.8: Use the Adam optimizer to train the cognitive diagnostic model and minimize the total loss function Loss to update the model parameters until convergence, thereby obtaining the trained cognitive diagnostic model T.

[0060] Step 4: Achieve fair cognitive diagnostic prediction results during the model inference stage:

[0061] Step 4.1: In the inference stage, design a counterfactual cognitive diagnostic model CF_T, and use equation (18) to calculate the i-th student u generated by the sensitive attribute output by the counterfactual cognitive diagnostic model CF_T. i For the j-th exercise e j Predicted value That is, the spurious association effect:

[0062]

[0063] In equation (18), The mean of the difficulty and discrimination of all exercises output by the trained cognitive diagnostic model T;

[0064] Step 4.2: Use equation (19) to obtain the i-th student u. i Answer the j-th exercise e j Fair prediction results

[0065]

[0066] In equation (17), γ is a hyperparameter that controls the intensity of depolarization, y i,j This represents the output of the i-th student u from the trained cognitive diagnostic model T. i For the j-th exercise e j The predicted value.

[0067] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the cognitive diagnostic method, and the processor is configured to execute the program stored in the memory.

[0068] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program is executed by a processor to perform the steps of the cognitive diagnostic method.

[0069] Compared with existing technologies, the beneficial effects of this invention are reflected in:

[0070] 1. This invention proposes a counterfactual cognitive diagnostic method: based on the traditional cognitive diagnostic model, it calculates the spurious association effect between sensitive attributes and student proficiency by blocking the influence of sensitive attributes on self-achieved attributes, thereby accurately capturing the spurious effect generated by sensitive attributes, laying the foundation for the next step of eliminating the unfair influence generated by sensitive attributes.

[0071] 2. This invention proposes to use a biased overall effect to subtract the spurious correlation effect between sensitive attributes and student proficiency, thereby obtaining an unbiased, i.e., ultimately fair diagnostic result, while ensuring the accuracy of the diagnosis of students' knowledge proficiency. Attached Figure Description

[0072] Figure 1 This is a flowchart illustrating the counterfactual fairness method for cognitive diagnosis proposed in this invention.

[0073] Figure 2 This is an overall framework diagram of the application of the present invention to the NCD model using the PISA2015 dataset. Detailed Implementation

[0074] In this embodiment, the basic process of a counterfactual fairness cognitive diagnostic method is as follows: First, construct multi-source data: student-exercise interaction records, student-self-achieved attributes, sensitive attributes, etc.; second, propose a definition of fairness in cognitive diagnosis; then, calculate the biased overall causal effect in traditional cognitive diagnosis; finally, in the model inference stage, design a counterfactual cognitive diagnostic model to calculate the spurious association effect from sensitive attributes to knowledge proficiency, and subtract it from the calculated biased overall effect to achieve fairness in cognitive diagnosis. Specifically, as... Figure 1 As shown, the procedure is as follows:

[0075] Step 1: Construct multi-source data, including: student-exercise interaction records, student-self-achieved attributes, and sensitive attributes;

[0076] The self-achievement attributes used in this step refer to students' acquired learning habits, such as learning interest and motivation, self-efficacy, etc., which are collected through questionnaires.

[0077] Step 1.1: Define the student set U = {u1, u2, ..., u3}. i , ...u |U|}, where u i Let |U| represent the i-th student, and |U| represent the total number of students, where 1 ≤ i ≤ |U|.

[0078] Define the set of exercises as E = {e1, e2, ..., e...} j …,e |E|}, where e j Let |E| represent the j-th exercise, and |E| represent the total number of exercises, where 1 ≤ j ≤ |E|.

[0079] Define the set of knowledge points C = {c1, c2, ..., c...} k …, c |C|}, where c k Let |C| represent the k-th knowledge point, and |C| represent the total number of knowledge points, where 1≤k≤|C|;

[0080] Step 1.2: Let T = {t1, t2, ..., t} l …, t |T|} represents the set of student-achieved attributes, where t l Let |T| represent the l-th self-achieved attribute, and |T| represent the total number of self-achieved attributes, where 1 ≤ l ≤ |T|.

[0081] Let the student's binary sensitivity attribute matrix A = [a1, a2, ..., a... i , ...a |U| ], a i Represents the i-th student u i The sensitive attribute value, and a i∈{0,1}, based on the sensitive attribute values, the student set U is split into two sub-clusters, U0={u i |a i =0} represents the subset of users whose sensitive attribute value is 0, U1 = {u i |a i =1} represents a subset of users whose sensitive attribute value is 1;

[0082] Step 1.3: Have students record their answers to the exercises in an interaction matrix R = {r ij} |U|×|E| , where r ij Represents the i-th student u i Answer the j-th exercise e j The score of the i-th student, u i Answer the j-th question correctly. j Then let r ij =1, if the i-th student u i The j-th question was answered incorrectly. j Then let r ij =0, if the i-th student u i The j-th question was not answered. j Then let r ij =-1;

[0083] Let the association matrix of exercises and knowledge points be Q={q jk} |E|×|C| , where q jk Let e ​​represent the j-th exercise. j Is it related to the k-th knowledge point c? k Related, if q jk =1 indicates correlation; if q jk =0 indicates no correlation;

[0084] Step 1.4: Let the i-th student u i Information on all self-achieved attributes is in, Represents the i-th student u i In the l-th self-achieved attribute t l The information above, if the i-th student u i In the l-th self-achieved attribute t l If there is no record, then let

[0085] Step 2: Based on the estimated impact of binary sensitive attribute values ​​on cognitive diagnostic results, a definition of fairness in cognitive diagnosis is proposed:

[0086] Step 2.1: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (1). g underestimation rate

[0087]

[0088] In equation (1), U g Let g represent the g-th sub-cluster, where g∈{0,1}; U represents the g-th sub-cluster. g The number of false negative samples; The g-th sub-cluster U g The actual number of samples in the middle;

[0089] Step 2.2: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (2). g overestimation

[0090]

[0091] In equation (2), and Represent the g-th sub-cluster body U respectively g The number of false positive samples and the number of true negative samples;

[0092] Step 2.3: If equations (3) and (4) hold, it means that the cognitive diagnostic model has a consistent prediction preference for the two sub-clusters U0 and U1.

[0093]

[0094] Equation (3) indicates that the cognitive diagnostic model has a consistent false negative prediction preference for the two sub-clusters U0 and U1;

[0095]

[0096] Equation (4) indicates that the cognitive diagnostic model has a consistent false positive prediction preference for the two sub-clusters U0 and U1;

[0097] The fairness index used in this step of cognitive diagnosis is designed based on the fairness index Equalized Odds. Traditional cognitive diagnosis models show differences in the underestimation and overestimation rates of the prediction results in the two sub-clusters U0 and U1. Fair cognitive diagnosis methods require that the differences should be consistent in the two sub-clusters U0 and U1.

[0098] Step 3: Calculate the biased overall causal effect in traditional cognitive diagnosis:

[0099] Traditional cognitive diagnostics suffer from group bias in its predictions due to the overuse of sensitive attributes. In this step, by explicitly modeling sensitive attributes, we can accurately calculate the spurious associations of students' knowledge proficiency.

[0100] Step 3.1, let Represents the i-th student u i One-hot encoding characterization, Represents the i-th student u i The self-caused property M i The corresponding multi-hot encoding representation is used to calculate the i-th student u obtained from the cognitive diagnostic model through equation (5). i Knowledge proficiency

[0101]

[0102] In equation (5), B and C represent two matrices to be learned, σ is the sigmoid activation function, and α i For the i-th student u i A parameter to be learned is set;

[0103] Step 3.2, let Let e ​​represent the j-th exercise. j The one-hot encoding representation of the exercises is then calculated according to equation (6) for the j-th exercise e. j Knowledge point matrix

[0104]

[0105] Step 3.3: Let D and D′ be two matrices to be learned, then calculate the j-th exercise e according to equation (7). j Difficulty representation

[0106]

[0107] Calculate the j-th exercise e according to equation (8). j Discrimination characterization

[0108]

[0109] According to equation (9), we obtain the equation for the j-th exercise e. j A set of knowledge point matrices, difficulty levels, and discrimination characteristics.

[0110]

[0111] Step 3.4, let Represents the i-th student u i Sensitive attribute a i The multi-hot encoding representation is then calculated using equation (10) to calculate the i-th student u generated by the spurious association of sensitive attributes. i Knowledge proficiency

[0112]

[0113] In equation (10), C′ is the matrix to be learned;

[0114] Step 3.5: Using G(·) to represent the interaction function of the cognitive diagnostic model, the i-th student u output by the cognitive diagnostic model is obtained according to equation (11). i For the j-th exercise e j Relying solely on student self-achievement attribute M i Predicted value

[0115]

[0116] According to equation (12), the spurious association of the sensitive attribute output by the cognitive diagnostic model generates the i-th student u. i For the j-th exercise e j Predicted value

[0117]

[0118] According to equation (13), the i-th student u output by the cognitive diagnostic model is obtained. i For the j-th exercise e j Predicted value That is, a biased overall causal effect:

[0119]

[0120] Step 3.6: Construct a cognitive diagnostic model relying solely on student self-achievement attributes using equation (14) and the cross-entropy loss function Loss. s :

[0121]

[0122] In equation (14), Represents the i-th student u i The complete set of all the exercises to be answered;

[0123] Using Equation (15), the cross-entropy loss function generated by spurious associations of sensitive attributes in the cognitive diagnostic model is constructed. a :

[0124]

[0125] A cognitive diagnostic model is constructed using Equation (16), employing the cross-entropy loss function Loss for both student self-achievement and sensitivity attributes. a,s :

[0126]

[0127] Step 3.7: Use equation (17) to obtain the overall objective function Loss of the cognitive diagnostic model;

[0128] Loss = Loss a,s +Loss s +Loss a (17)

[0129] Step 3.8: Use the Adam optimizer to train the cognitive diagnostic model and minimize the total loss function Loss to update the model parameters until convergence, thereby obtaining the trained cognitive diagnostic model T.

[0130] Step 4: Achieve fair cognitive diagnostic prediction results during the model inference stage:

[0131] This step begins by posing a counterfactual question: "If the model cannot see the student's self-achievement attributes and only obtains sensitive attributes, what will the model's prediction result be?" To answer this question, the model first uses only the student u... i of Reasoning is performed while satisfying the premise that the student's self-attainment attribute is not visible, and the representation mean of the exercises is used to replace exercise e. j The difficulty and discrimination of the calculation results This fully reflects the influence from sensitive attributes. Finally, the biased population effect y is used. i,j Subtracting spurious associations of sensitive attributes from the results To obtain fair prediction results.

[0132] Step 4.1: In the inference stage, design a counterfactual cognitive diagnostic model CF_T, and use equation (18) to calculate the i-th student u generated by the sensitive attribute output by the counterfactual cognitive diagnostic model CF_T. i For the j-th exercise e j Predicted value That is, the spurious association effect:

[0133]

[0134] In equation (18), The mean of the difficulty and discrimination of all exercises in the trained cognitive diagnostic model T;

[0135] Step 4.2: Use equation (19) to obtain the i-th student u. i Answer the j-th exercise e j Fair prediction results

[0136]

[0137] In equation (17), y i,j This represents the output of the i-th student u from the trained cognitive diagnostic model T. i For the j-th exercise e j The predicted value is calculated using the hyperparameter γ, which controls the intensity of bias removal. A larger γ value results in stronger bias removal; therefore, a suitable value needs to be selected to achieve a balance between accuracy and fairness. Furthermore, this method is model-independent and can be applied to commonly used cognitive diagnostic models such as IRT, MIRT, NCD, and KaNCD.

[0138] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0139] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

[0140] Example:

[0141] The counterfactual fairness cognitive diagnostic method proposed in this invention is model-independent and can be used in commonly used cognitive diagnostic models. In this embodiment, the method of this invention on the sensitive attribute—gender—will be demonstrated on the NCD model. This model is a classic example in the field of cognitive diagnostics that utilizes deep neural networks to capture high-order interaction features. Furthermore, this embodiment is based on the PISA 2015 dataset, which primarily assesses students' scientific abilities, with students' self-achievement attributes manifested as scientific literacy.

[0142] Figure 2 Part (a) shows the multi-source data required for this method, in its preprocessed form. This includes the student-question interaction matrix, the student-scientific literacy questionnaire matrix, and gender. Figure 2 Part (b) of the paper presents two NCD models with different scenarios, mainly differing in the input data. The traditional NCD model inputs factual exercise factors, student factors, and gender representations, while the counterfactual NCD model inputs counterfactual exercise factors, counterfactual student factors, and factual gender representations. Figure 2 Part (c) shows that during the model inference stage, the biased overall effect obtained by the traditional NCD model and the gender spurious association effect obtained by the counterfactual NCD model are used to obtain a fair prediction result according to Equation (19).

[0143] The above embodiments only illustrate the application of the present invention to the NCD model and the sensitive attribute-gender. How to model the student factor and exercise factor representation is not included in the scope of the present invention. The idea of ​​the present invention is independent of the specific model and can be used in all current cognitive diagnostic models. The core idea of ​​the present invention is to learn the biased overall effect and the spurious effect of the sensitive attribute association by using the traditional cognitive diagnostic model and the counterfactual cognitive diagnostic model respectively, and then use Equation (19) to obtain a fair prediction result. This idea is the scope of protection of the present invention patent.

Claims

1. A cognitive diagnostic method for counterfactual fairness, characterized in that, The procedure is as follows: Step 1: Construct multi-source data, including: student-exercise interaction records, student-self-achieved attributes, and sensitive attributes; Step 1.1: Define the student set U = {u1, u2, ..., u3} i ,…u |U| }, where u i Let |U| represent the i-th student, and |U| represent the total number of students, where 1 ≤ i ≤ |U|. Define the set of exercises E = {e1, e2, ..., e j …,e |E| }, where e j Let |E| represent the j-th exercise, and |E| represent the total number of exercises, where 1 ≤ j ≤ |E|. Define the set of knowledge points C = {c1, c2, ..., c...} k …,c |C| }, where c k Let |C| represent the k-th knowledge point, and |C| represent the total number of knowledge points, where 1≤k≤|C|; Step 1.2: Let T = {t1, t2, ..., t} l …,t |T| } represents the set of student-achieved attributes, where t l Let |T| represent the l-th self-achieved attribute, and |T| represent the total number of self-achieved attributes, where 1 ≤ l ≤ |T|. Let the student's binary sensitivity attribute matrix A = [a1, a2, ..., a... i ,…a |U| ], a i Represents the i-th student u i The sensitive attribute value, and a i ∈{0,1}, based on the sensitive attribute values, the student set U is split into two sub-clusters, U0={u i |a i =0} represents the subset of users whose sensitive attribute value is 0, U1 = {u i |a i =1} represents a subset of users whose sensitive attribute value is 1; Step 1.3: Have students record their answers to the exercises in an interaction matrix R = {r ij } |U|×|E| , where r ij Represents the i-th student u i Answer the j-th exercise e j The score of the i-th student, u i Answer the j-th question correctly. j Then let r ij =1, if the i-th student u i The j-th question was answered incorrectly. j Then let r ij =0, if the i-th student u i The j-th question was not answered. ij Then let r ij =-1; Let the association matrix of exercises and knowledge points be Q={q jk } |E|×|C| , where q jk Let e ​​represent the j-th exercise. j Is it related to the k-th knowledge point c? k Related, if q jk =1 indicates correlation; if q jk =0 indicates no correlation; Step 1.4: Let the i-th student u i Information on all self-achieved attributes is in, Represents the i-th student u i In the l-th self-achieved attribute t l The information above, if the i-th student u i In the l-th self-achieved attribute t l If there is no record, then let Step 2: Based on the estimated impact of binary sensitive attribute values ​​on cognitive diagnostic results, a definition of fairness in cognitive diagnosis is proposed: Step 2.1: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (1). g underestimation rate In equation (1), U g Let g represent the g-th sub-cluster, where g∈{0,1}; U represents the g-th sub-cluster. g The number of false negative samples; The g-th sub-cluster U g The actual number of samples in the middle; Step 2.2: Calculate the cognitive diagnostic model for the g-th sub-cluster U using equation (2). g overestimation In equation (2), and Represent the g-th sub-cluster body U respectively g The number of false positive samples and the number of true negative samples; Step 2.3: If equations (3) and (4) hold, it means that the cognitive diagnostic model has a consistent prediction preference for the two sub-clusters U0 and U1. Equation (3) indicates that the cognitive diagnostic model has a consistent false negative prediction preference for the two sub-clusters U0 and U1; Equation (4) indicates that the cognitive diagnostic model has a consistent false positive prediction preference for the two sub-clusters U0 and U1; Step 3: Calculate the biased overall causal effect in traditional cognitive diagnosis: Step 3.1, let Represents the i-th student u i One-hot encoding characterization, Represents the i-th student u i The self-caused property M i The corresponding multi-hot encoding representation is used to calculate the i-th student u obtained from the cognitive diagnostic model through equation (5). i Knowledge proficiency In equation (5), B and C represent two matrices to be learned, σ is the sigmoid activation function, and α i For the i-th student u i A parameter to be learned is set; Step 3.2, let Let e ​​represent the j-th exercise. j The one-hot encoding representation of the exercises is then calculated according to equation (6) for the j-th exercise e. j Knowledge point matrix Step 3.3: Let D and D' be two matrices to be learned, then calculate the j-th exercise e according to equation (7). j Difficulty representation Calculate the j-th exercise e according to equation (8). j Discrimination characterization According to equation (9), we obtain the equation for the j-th exercise e. j A set of knowledge point matrices, difficulty levels, and discrimination characteristics. Step 3.4, let Represents the i-th student u i Sensitive attribute a i The multi-hot encoding representation is then calculated using equation (10) to determine the i-th student u generated by the spurious association of sensitive attributes. i Knowledge proficiency In equation (10), C' is the matrix to be learned; Step 3.5: Using G(·) to represent the interaction function of the cognitive diagnostic model, the i-th student u output by the cognitive diagnostic model is obtained according to equation (11). i For the j-th exercise e j Relying solely on student self-achievement attribute M i Predicted value According to equation (12), the spurious association of the sensitive attribute output by the cognitive diagnostic model generates the i-th student u. i For the j-th exercise e j Predicted value According to equation (13), the i-th student u output by the cognitive diagnostic model is obtained. i For the j-th exercise e j Predicted value That is, the biased overall causal effect: Step 3.6: Construct a cognitive diagnostic model relying solely on student self-achievement attributes using equation (14) and the cross-entropy loss function Loss. s : In equation (14), Represents the i-th student u i The complete set of all the exercises to be answered; Using Equation (15), the cross-entropy loss function generated by spurious associations of sensitive attributes in the cognitive diagnostic model is constructed. a : A cognitive diagnostic model is constructed using Equation (16), employing the cross-entropy loss function Loss for both student self-achievement and sensitivity attributes. a,s : Step 3.7: Use equation (17) to obtain the overall objective function Loss of the cognitive diagnostic model; Loss=Loss a,s +Loss s +Loss a (17) Step 3.8: Use the Adam optimizer to train the cognitive diagnostic model and minimize the total loss function Loss to update the model parameters until convergence, thereby obtaining the trained cognitive diagnostic model T. Step 4: Achieve fair cognitive diagnostic prediction results during the model inference stage: Step 4.1: In the inference stage, design a counterfactual cognitive diagnostic model CF_T, and use equation (18) to calculate the i-th student u generated by the sensitive attribute output by the counterfactual cognitive diagnostic model CF_T. i For the j-th exercise e j Predicted value That is, the spurious association effect: In equation (18), The mean of the difficulty and discrimination of all exercises output by the trained cognitive diagnostic model T; Step 4.2: Use equation (19) to obtain the i-th student u. i Answer the j-th exercise e j Fair prediction results In equation (17), γ is a hyperparameter that controls the intensity of depolarization, y i,j This represents the output of the i-th student u from the trained cognitive diagnostic model T. i For the j-th exercise e j The predicted value.

2. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing the cognitive diagnostic method of claim 1, the processor being configured to execute the program stored in the memory.

3. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the cognitive diagnostic method of claim 1.

Citation Information

Patent Citations

  • Systems and methods for movement skill analysis and skill augmentation and cueing

    CN108463271A

  • Reliability-based cognitive diagnosis method for student ability characterization

    CN116933029A