XAI model consistency training method, device, equipment and storage medium
By entering the user data samples of Work Model into the XAI model and optimizing the parameters, the problem of inconsistent interpretation results of the XAI model is solved, which improves the credibility and transparency of the XAI model, and helps to implement the practical application of XAI technology.
Patent Information
- Application Number
- CN202211685059.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-12-27
AI Technical Summary
The XAI model has inconsistency in interpretation results in practical applications, which leads to inconsistent results between users and enterprises, making it difficult to meet product implementation standards.
After the Work Model training is completed, the user data sample of XAI Model is input to the Work Model to obtain the predicted decision result, and the parameters are determined based on the predicted decision result and the interpretation result. If the parameter is greater than the threshold, the parameters of XAI Model are optimized in the direction of the delay gradient.
The consistency of the interpretation results of the XAI model is achieved, the credibility and transparency of XAI technology are improved, and the practical application of XAI technology is facilitated.
Smart Images

Figure CN116011570B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an XAI model consistency training method, apparatus, device and storage medium. Background Art
[0002] As AI applications deepen, people are focusing not only on its capabilities but also its security and reliability. Explainable AI (XAI) is a technology that can explain black-box models, significantly improving the transparency, reliability, and controllability of machine learning models.
[0003] However, the XAI model faces inconsistencies in practical applications that need to be addressed. For example, in financial credit scenarios, when the consistency between the financial credit model results and the user's perceived credit results, or between the model results explaining the reasons for the credit results and the user's perceived reasons for the results, the model results are difficult to convince the user. When the consistency between the financial credit model results and the user's perceived credit results, or between the model results explaining the reasons for the credit results and the enterprise's reference standards, the model results do not meet the enterprise's established standards. Furthermore, when these two final consistency results are inconsistent—that is, when the consistency results between the user and the enterprise are inconsistent—this indicates that the financial credit system is "self-contradictory" and generally does not meet product implementation standards. These inconsistencies are essentially inconsistencies between the XAI model results and the actual result interpretation, the working model results and the actual results, and the XAI model results and the reference standards. Further optimization of the XAI model is needed.
[0004] It can be seen that the inconsistency problem is a major obstacle to the implementation of XAI technology, but there is currently a lack of in-depth research and specific solutions to this problem. Summary of the Invention
[0005] The present invention provides an XAI model consistency training method, apparatus, device, and storage medium to solve the problem of inconsistent XAI model interpretation results, optimize the XAI model, and facilitate the practical application of XAI technology.
[0006] According to one aspect of the present invention, a method for training XAI model consistency is provided, the method comprising:
[0007] After the Work Model training is completed, the first user data sample of the XAI Model is input into the Work Model to obtain the prediction decision result;
[0008] Determine a first parameter according to the prediction decision result;
[0009] After the XAI Model training is completed, the decision result of the second user data sample output by the Work Model is input into the XAI Model to obtain a prediction and interpretation result;
[0010] determining a second parameter according to the prediction interpretation result;
[0011] determining a target parameter according to the first parameter and the second parameter;
[0012] If the target parameter is greater than the parameter threshold, the parameters of the XAI Model are optimized along the gradient direction.
[0013] According to another aspect of the present invention, there is provided an XAI model consistency training device, the device comprising:
[0014] The first input module is used to input the first user data sample of the XAI model into the work model after the work model training is completed to obtain a prediction decision result;
[0015] A first determining module, configured to determine a first parameter according to the prediction decision result;
[0016] A second input module is configured to input the decision result of the second user data sample output by the Work Model into the XAI Model after the XAI Model training is completed to obtain a prediction and interpretation result;
[0017] A second determining module, configured to determine a second parameter according to the prediction interpretation result;
[0018] a third determining module, configured to determine a target parameter according to the first parameter and the second parameter;
[0019] An optimization module is configured to optimize the parameters of the XAI Model along a gradient direction if the target parameter is greater than a parameter threshold.
[0020] According to another aspect of the present invention, an electronic device is provided, comprising:
[0021] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the XAI model consistency training method described in any embodiment of the present invention.
[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the XAI model consistency training method described in any embodiment of the present invention when executed.
[0023] The technical solution of the embodiment of the present invention is to input the first user data sample of the XAI Model into the Work Model after the Work Model training is completed to obtain a prediction decision result, determine the first parameter based on the prediction decision result, input the decision result of the second user data sample output by the Work Model into the XAI Model after the XAI Model training is completed to obtain a prediction interpretation result, determine the second parameter based on the prediction interpretation result, determine the target parameter based on the first parameter and the second parameter, and if the target parameter is greater than the parameter threshold, optimize the parameters of the XAI Model along the gradient direction. The technical solution of the embodiment of the present invention can solve the problem of inconsistency in the interpretation results of the XAI model, can achieve the optimization of the XAI Model, and facilitate the practical application of XAI technology.
[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.
[0026] Figure 1 This is a flowchart of an XAI model consistency training method provided according to the first embodiment of the present invention;
[0027] Figure 2 is a flowchart of another XAI model consistency training method provided according to the first embodiment of the present invention;
[0028] Figure 3 2 is a schematic diagram of the structure of an XAI model consistency training device provided according to the second embodiment of the present invention;
[0029] Figure 4 3 is a schematic diagram of the structure of an electronic device for implementing the XAI model consistency training method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "target", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Example 1
[0033] Figure 1 This is a flow chart of an XAI model consistency training method provided according to the first embodiment of the present invention. This embodiment is applicable to XAI model consistency training situations. The method can be performed by an XAI model consistency training device. The XAI model consistency training device can be implemented in the form of hardware and / or software. The XAI model consistency training device can be integrated into any electronic device that provides XAI model consistency training function. Figure 1 As shown, the method includes:
[0034] S101: After the Work Model training is completed, the first user data sample of the XAI Model is input into the Work Model to obtain a prediction decision result.
[0035] In this embodiment, the Work Model may be a working model. Specifically, the working model may be any model that can meet the requirement of outputting a decision result in an actual application scenario. This embodiment does not limit the specific type of the working model. For example, in an intelligent customer service scenario, the working model may exist in an intelligent customer service robot system, which is used to make decisions on questions raised by users and output decision results. For example, a user may ask the intelligent customer service: "Which product is more durable?" After the intelligent customer service makes a decision, it may output the decision result: "## product is more durable."
[0036] In this embodiment, the XAI Model may be an explainable model. XAI is the abbreviation of Explainable AI, which means explainable AI. Specifically, the explainable model may be any model that can meet the requirements of outputting explanation results in actual application scenarios. This embodiment does not limit the specific type of the explainable model. For example, in an intelligent customer service scenario, the explainable model may exist in an intelligent customer service robot system, and be used to output explanation results for questions raised by users. For example, a user may ask the intelligent customer service: "Why are ## products more durable?" The intelligent customer service may output several explanation results for explanation: "Because ## products use durable materials", "Because ## products have comprehensive after-sales maintenance services", ..., "Because ## products replace parts regularly", etc.
[0037] It should be noted that the first user data sample may be sample data in a training set, and may be represented by sample data D.
[0038] The predicted decision result may be the decision result of the Work Model.
[0039] Specifically, if the Work Model learning process has not been completed (this can be judged by LOSS or accuracy as a threshold, which will not be elaborated here), then the Work Model training will continue. After the Work Model training is completed, if the current stage is the training stage of the XAI Model, the sample data D in the training set will be used as the input of the Work Model, the label corresponding to the sample data D will be recorded as T, and the predicted decision result of the Work Model will be recorded as T'. If the current stage is the implementation reasoning process after the model is released, then the input of the Work Model can be the input sample S, and the predicted decision result of the Work Model will be recorded as R. In this scenario, the condition that triggers the XAI Model to continue optimizing is usually the user's interactive feedback. Specifically, the user's interactive feedback can be actively provided by the user, or it can be passively collected by the system. This embodiment does not limit this. The user's actual decision result feedback on the input sample S is recorded as R'.
[0040] S102: Determine a first parameter according to the prediction decision result.
[0041] The first parameter may be a parameter used to detect the consistency of the Work Model.
[0042] Specifically, after the Work Model training is completed, if the current stage is the training stage of the XAI Model, the consistency between T and T' is checked. The specific method can be the first parameter ID1-Result = Distance(T, T'), where Distance is a distance function, which can be an existing method, such as L1, L2, semantic distance, etc. The choice of specific method depends on the different types of prediction decision results. If the current stage is the implementation reasoning process after the model is released, the consistency between R and R' can be further checked. The specific method can be the first parameter LOSS1 = ID1-Result = Distance(R, R'), where the Distance method is the same as above. The final output of this step is ID1-Result.
[0043] S103: After the XAI Model training is completed, the decision result of the second user data sample output by the Work Model is input into the XAI Model to obtain a prediction and explanation result.
[0044] It should be noted that the second user data sample may be sample data output by the Work Model and may be represented by sample data S.
[0045] The predicted explanation result may be the explanation result of the XAI Model.
[0046] Specifically, if the XAI Model learning process is not yet complete (the XAI Model in this invention is a computationally based XAI method, such as a linear model, tree model, or deep learning model, whose optimization and improvement primarily relies on function parameter optimization, i.e., learning of this type of XAI Model is completed based on sample data D, Work Model output T, and label T'. This is an existing method and will not be described in detail here), then the XAI Model training will continue. After the XAI Model training is complete, the Work Model's predicted decision result R for the sample data S serves as the XAI Model input, and the predicted interpretation result output by the XAI Model is recorded as P.
[0047] S104: Determine a second parameter according to the prediction interpretation result.
[0048] The second parameter may be a parameter used to detect the internal consistency of the XAI Model.
[0049] Specifically, the structural comparison learning component A compares P with the reference standard (Rule base) corresponding to the interpretation result to check whether P meets the reference standard, and determines the second parameter ID2-Result with the result of "whether P meets the Rule" 1 or 0 (where 1 means meeting and 0 means not meeting). In this step, the Rule base is the reference standard, which can be in the form of an experience library or a knowledge graph, both of which are existing systems. Such systems can usually provide a query interface, input R to output the interpretation result P' of the Rule base, or input P to output the decision result R" of the Rule base. In this step, the structural comparison learning component A can judge whether "P meets the Rule" by inputting the decision result R to compare the interpretation results P and P', or by inputting the interpretation result P to compare the decision results R and R". The final output of this step is the second parameter LOSS2 = ID2-Result = Distance(P, P') or Distance(R, R").
[0050] S105: Determine a target parameter according to the first parameter and the second parameter.
[0051] In this embodiment, the target parameter may be the loss value of the XAI Model. Specifically, the target parameter may be expressed as LOSS-xai.
[0052] In actual operation, the loss value between the first parameter and the second parameter LOSS12 = LOSS (ID1-Result, ID2-Result). In this step, the LOSS function can select the implementation of the existing LOSS function according to actual needs, such as MAE loss, KL loss, etc. Specifically, the specific calculation method of the target parameter can be expressed as: target parameter LOSS-xai = LOSS1+LOSS2+LOSS12. In this step, the calculation of LOSS-xai can be performed by adding preset coefficients before LOSS1, LOSS2 and LOSS12 respectively. The coefficients can be used to adjust the optimization strength or completely block the influence of a certain LOSS. This is a common method and will not be described in detail here.
[0053] S106: If the target parameter is greater than the parameter threshold, the parameters of the XAI Model are optimized along the gradient direction.
[0054] The parameter threshold may be preset by the user according to actual conditions, and this embodiment does not limit the specific numerical value of the parameter threshold.
[0055] Specifically, if the target parameter LOSS-xai is greater than the parameter threshold, reverse calculation is performed to optimize and update the XAI model parameters along the gradient direction. This reverse calculation is implemented using existing methods and will not be detailed here. If the target parameter LOSS-xai is less than or equal to the parameter threshold, reverse calculation is not performed and the XAI model parameters do not need to be optimized.
[0056] In addition, for XAI models that cannot be optimized through gradients, a reinforcement learning framework can be used. The basic idea is to adopt the reinforcement learning Actor-Critic framework. The specific implementation is: use the XAI model as the Actor and the WorkModel as the Critic, and optimize the XAI model based on LOSS-xai. The optimization methods and strategies can use existing technologies.
[0057] The technical solution of the embodiment of the present invention is to input the first user data sample of the XAI Model into the Work Model after the Work Model training is completed to obtain a prediction decision result, determine the first parameter based on the prediction decision result, input the decision result of the second user data sample output by the Work Model into the XAI Model after the XAI Model training is completed to obtain a prediction interpretation result, determine the second parameter based on the prediction interpretation result, determine the target parameter based on the first parameter and the second parameter, and if the target parameter is greater than the parameter threshold, optimize the parameters of the XAI Model along the gradient direction. The technical solution of the embodiment of the present invention can solve the problem of inconsistency in the interpretation results of the XAI model, can achieve the optimization of the XAI Model, and facilitate the practical application of XAI technology.
[0058] Optionally, determining the first parameter according to the prediction decision result includes:
[0059] A first parameter is determined according to the prediction decision result and a label carried by the first user data sample.
[0060] Specifically, after the Work Model training is completed, if the current stage is the training stage of the XAI Model, the sample data D in the training set is used as the input of the Work Model, the label corresponding to D is T, and the decision result of the Work Model is T'. The consistency between T and T' is checked. The specific method is the first parameter ID1-Result=Distance(T, T'), where Distance is a distance function, which can be an existing method, such as L1, L2, semantic distance, etc. The specific method selection depends on the different types of predicted decision results.
[0061] Optionally, determining the first parameter according to the prediction decision result includes:
[0062] Get feedback information on the decision results entered by the user.
[0063] In this embodiment, the decision result feedback information may be the user's actual decision result feedback on the input sample input into the Work Model, which may be expressed as R'.
[0064] Specifically, obtain the user's actual decision result feedback R' on the input sample S input into the Work Model.
[0065] The first parameter is determined according to the predicted decision result and the decision result feedback information.
[0066] Specifically, if the current process is the implementation reasoning process after the model is released, then the Work Model input is the input sample S, and the decision result of the Work Model is R. In this scenario, the condition that triggers the XAI Model to continue optimizing is usually the user's interactive feedback. The user's interactive feedback can be actively provided by the user, or it can be passively collected by the system. This embodiment does not limit this. The user's actual decision result feedback for the input sample S is R', then the consistency between R and R' can be further checked. The specific method is LOSS1 = ID1-Result = Distance(R, R'), where Distance is a distance function, which can be an existing method, such as L1, L2, semantic distance, etc. The specific method selection depends on the different types of predicted decision results.
[0067] Optionally, determining the second parameter according to the prediction interpretation result includes:
[0068] Obtain an explanation result corresponding to the decision result of the second user data sample.
[0069] In this embodiment, the interpretation result may be an interpretation result obtained by inputting the decision result of the second user data sample into the XAI Model.
[0070] Specifically, after the XAI Model training is completed, the decision result R of the Work Model on the sample data S is used as the input of the XAI Model, and the output of the XAI Model is the explanation result P'.
[0071] The second parameter is determined according to the interpretation result and the predicted interpretation result corresponding to the decision result of the second user data sample.
[0072] Specifically, the second parameter LOSS2=ID2-Result=Distance(P, P') can be determined by the explanation result P' corresponding to the decision result of the second user data sample and the predicted explanation result P, where Distance is a distance function, which can be an existing method, such as L1, L2, semantic distance, etc. The specific method selection depends on the different types of predicted decision results.
[0073] Optionally, determining the second parameter according to the prediction interpretation result includes:
[0074] Get the decision result corresponding to the prediction explanation result.
[0075] In this embodiment, the decision result may be the decision result of the Rule base, which may be represented by R".
[0076] Specifically, obtain the decision result R" of the Rule base.
[0077] The second parameter is determined according to the decision result corresponding to the predicted interpretation result and the decision result of the second user data sample.
[0078] Specifically, the second parameter LOSS2=ID2-Result=Distance(R, R”) can be determined by the decision result R” corresponding to the predicted interpretation result and the decision result R of the second user data sample, where Distance is a distance function, which can be an existing method, such as L1, L2, semantic distance, etc. The specific method selection depends on the different types of predicted decision results.
[0079] Optionally, the XAI model consistency training method further includes:
[0080] Obtain reason feedback information corresponding to the decision result of the second user data sample.
[0081] In this embodiment, the reason feedback information may be the reason feedback for the decision result, which may be represented by P".
[0082] Specifically, the reason feedback information P" corresponding to the decision result of the second user data sample is obtained.
[0083] The third parameter is determined according to the prediction interpretation result and the cause feedback information.
[0084] The third parameter may be a parameter used to detect the external consistency of the XAI Model.
[0085] Specifically, the above steps have completed the training of the XAI Model, so this stage occurs during the implementation and inference process after the model is released. The decision result R of the Work Model for sample data S is used as the input of the XAI Model, and the output of the XAI Model is P. In this scenario, the condition that triggers the XAI Model to continue optimizing is typically user interaction feedback. Specifically, user interaction feedback can be actively provided by the user or passively collected by the system, and this embodiment is not limited to this. The actual decision result feedback for input sample S is R', and the feedback for the reason for the decision result is P", which is the external consistency of the decision result. The external consistency of the decision result is measured by LOSS1. Therefore, in this step, the structural comparison learning component B only needs to check the consistency between P and P". Specifically, the third parameter LOSS3 = ID3-Result = Distance(P, P", where Distance is a distance function, which can be an existing method such as L1, L2, semantic distance, etc. The specific method selected depends on the type of predicted decision result. The final output of this step is ID3-Result.
[0086] Optionally, determining the target parameter according to the first parameter and the second parameter includes:
[0087] A target parameter is determined according to the first parameter, the second parameter, and the third parameter.
[0088] Specifically, the loss value LOSS12 between the first parameter and the second parameter is LOSS(ID1-Result, ID2-Result), and the loss value LOSS13 between the first parameter and the third parameter is LOSS(ID1-Result, ID3-Result). In this step, the LOSS function can select the implementation of the existing LOSS function according to actual needs, such as MAE loss, KL loss, etc.
[0089] Specifically, the target parameter can be calculated as: target parameter LOSS-xai = LOSS1 + LOSS2 + LOSS3 + LOSS12 + LOSS13. In this step, LOSS-xai can be calculated by adding preset coefficients to LOSS1, LOSS2, LOSS3, LOSS12, and LOSS13, respectively. This coefficient can be used to adjust the optimization strength or completely eliminate the influence of a specific loss. This is a common method and will not be described in detail here.
[0090] As an exemplary description of an embodiment of the present invention, Figure 2FIG2 is a flow chart of another XAI model consistency training method provided according to Embodiment 1 of the present invention. The XAI model consistency training method is now described in conjunction with a specific embodiment.
[0091] In this example, Enterprise A aims to build a reliable, self-learning XAI system to intelligently implement financial credit services, thereby improving efficiency and reducing labor costs. Because traditional XAI credit rating systems struggle to guarantee the reliability of rating results, and there are risks of inconsistencies between XAI model results and actual interpretations, between working model results and actual results, and between XAI model results and reference standards, Enterprise A employs the XAI model consistency training method of the present invention to implement financial credit services.
[0092] The sample dataset Dataset-A contains a number of basic information datasets of residents, with a total of 8000 groups of user data. Each sample data contains eight parts, D = {index, name, age, gender, income, consumption, stability, health}, which are as follows: index index (INT32 integer), name name (STRING string type, maximum length is 20), age age (SHORT16 integer), gender gender (Boolean type, value 0, 1 represents "male", "female" respectively), annual income =income (10,000 yuan) (INT32 integer), average monthly consumption (10,000 yuan) (consume (INT32 integer), job stability (SHORT16 integer, 4 values: 1: very stable, 2: relatively stable, 3: relatively unstable, 4: very unstable), health (SHORT16 integer, 4 values: 1: very healthy, 2: relatively healthy, 3: relatively unhealthy, 4: very unhealthy); the label T corresponding to the sample data, consisting of a credit rating and an explanation of the credit rating, is stored in the dataset Dataset-B, with a total of 5,000 sets of labeled data. The task objective is to grant financial credit to different residents, with a total of ten credit rating levels (SHORT16 integers 1 to 10, with higher credit ratings corresponding to higher levels). The FC-Work Model is the FC-Work Model for this scenario, and the FC-XAI Model is the FC-XAI Model for this scenario. User interactive input is obtained through the FC-XAI-Sever, an online learning server for XAI models. Users can provide or retrieve content from the server via the Internet. Dell EqualLogic PS6100 is used for data storage.
[0093] In this implementation, the Work Model and XAI Model can be any model that meets the requirements in actual applications. In actual application scenarios, the present invention has universality and is not limited to a specific software and hardware framework or specific model structure. Specifically, the following steps are included:
[0094] FC-Work Model training. The age, income, consumption, stability, and health variables from a single sample data set are selected as the input to the FC-Work Model. To simplify the description, this example uses the linear regression model y = θ0 + θ1x1 + θ2x2 + θ3x3 + θ4x4 + θ5x5 as the FC-Work Model. The parameters are iteratively adjusted using gradient descent to minimize the mean square error (MSE). The FC-Work Model is trained through multiple iterations, with 1,000 sample data sets trained each time. (This is an existing method and will not be described in detail here.)
[0095] FC-Work Model consistency check. After the FC-Work Model training is completed, if the current stage is the FC-XAI Model training, the sample data used for model training in this stage must be able to find its corresponding label data in Dataset-B. Take a male user data D as an example, and use {age = 33, income = 50, consumption = 1, stability = 2, health = 3} as the input of the FC-Work Model. The above steps have obtained a well-trained linear regression model, and the decision result of the FC-Work Model is calculated to be T' = 5. The label corresponding to D is T = {T1, T2}, where T1 = 5 represents the true credit rating and T2 represents the explanation of the credit rating. Next, check the consistency between T and T'. The specific method is ID1-Result = Distance(T1, T'). In this example, the distance function is used to calculate the distance and the result is normalized to obtain ID1-Result = 0.0. For example, in the implementation inference process after the model is released, consider a female user's data, S, as an example. The data {age = 29, income = 18, consumption = 0.3, stability = 2, health = 1} in S is used as the input to the FC-Work Model. The FC-Work Model's credit rating is R = 6. At this stage, the trigger for further optimization of the FC-XAI Model is typically user feedback. If the female user logs in to Enterprise A's XAI model online learning server, FC-XAI-Sever, via the internet and, after carefully reviewing the rating criteria, rates her personal credit R' = 5, the consistency between R and R' is checked using the formula ID1-Result = Distance(R', R). The Distance method is the same as above, resulting in the first parameter, LOSS1 = ID1-Result = 1.0.
[0096] In the following steps, the consistency detection method and loss measurement method are the same in the FC-XAI Model training stage and the FC-XAI Model inference stage. The only difference is the data source (the training stage is the comparison between the model results and the data labels, and the inference stage is the comparison between the model results and the user interactive feedback). Therefore, the FC-XAI Model inference stage is used as an example to specify the online learning process of the XAI Model.
[0097] Internal consistency testing of the FC-XAI model. This stage primarily measures the consistency between the FC-XAI model's interpretation results and the model design reference established by Company A. From the above steps, we can conclude that for a female user's input data S, the FC-XAI model outputs a credit rating decision of R" = 5. The user's self-credit rating decision is R' = 6. The first loss value obtained through forward calculation is LOSS1 = LOSS(R', R") = 0.2. At the same time, the FC-XAI Model outputs the explanation result C[] = {C1, C2, C3, C4, C5} for the credit rating result R" = 5, where the explanation factor C1 represents "young age (<30)", C2 represents "annual income level >50,000 yuan & <200,000 yuan income = 18", C3 represents "monthly consumption limit less than 5% of annual income, strong risk tolerance", C4 represents "above average job stability = 2", and C5 represents "good health = 1". Rule Base is a rule library that stores a total of 520 rule quotations related to credit rating judgment. Similar to the sample data, they are all stored in the database DELL EqualLogic PS6100. Input C[] into Rule Base performs basic rule reasoning and, based on the rule quotations {"Item 25: Age < 30, Credit Rating < 9","Item 26: Age > 18, Credit Rating > 1","Item 128: Job Stability = 2, Credit Rating < 7 & > 5","Item 227: Annual Income < 20, Credit Rating < 6","Item 229: Annual Income > 5, Credit Rating > 1","Item 350: Monthly Consumption Amount Less Than 5% of Annual Income, Credit Rating > 3","Item 489: Health Level = 1, Credit Rating > 4"}, obtains the output R"' = 5. This results in the second loss value of the FC-XAI model being LOSS2 = LOSS(R, R"') = 0.1. The internal consistency of the FC-XAI model is calculated using ID2-Result = Distance(R', R"'), resulting in the second parameter LOSS2 = ID2-Result = 0.8.
[0098] FC-XAI Model External Consistency Detection. This stage mainly measures the consistency between the interpretation results of the FC-XAI Model and the label content or user interaction feedback. From the above steps, it can be seen that the FC-XAI Model input is data S, the decision output is R" = 5, and the user interaction feedback decision result is R' = 6. The female user logs in to the XAI model online learning server FC-XAI-Sever of enterprise A through the Internet environment. After carefully reading the rating criteria, the feedback interpretation of the personal credit rating is C'[] = {C'1, C'2, C'3, C'4, C'5}, where the explanation factor C'1 represents "young age (<30)", C'2 represents "annual income level of 180,000 yuan", C'3 represents "monthly consumption limit less than 5% of annual income", C'4 represents "very stable job", and C'5 represents "good health". The calculated FC-XAI The external consistency of the model's decision outputs C'[] and C[] is: the third parameter LOSS3 = ID3 - Result = Distance(C[], C'[]) = 0.4. External consistency encompasses two aspects: the decision result and the explanation. In practice, further variations and modifications based on these two aspects of consistency calculation are possible without violating the core innovation of this invention.
[0099] FC-XAI Model LOSS calculation, also known as target parameter calculation, is crucial for FC-XAI Model optimization. The XAI model's interpretation across the user, model, and rule dimensions should be consistent. The calculations yield LOSS12 = LOSS(ID1-Result, ID2-Result) = 0.1, and LOSS13 = LOSS(ID1-Result, ID3-Result) = 0.1. Therefore, the FC-XAI Model's LOSS calculation result is: target parameter LOSS-xai = LOSS1 + LOSS2 + LOSS3 + LOSS12 + LOSS13 = 0.9.
[0100] The FC-XAI Model compares the target parameter LOSS-xai output from the previous step with the parameter threshold. In this example, based on model training experience, the parameter threshold can be pre-set to 0.0001. Because the target parameter LOSS-xai = 0.9 is greater than the parameter threshold of 0.0001, a reverse calculation is performed to optimize and update the FC-XAI Mode parameters along the gradient direction. In other examples, if LOSS-xai is less than or equal to the parameter threshold, it indicates that the XAI interpretation achieves internal and external consistency, and there is no need to perform a reverse calculation or optimize the model.
[0101] In actual operation, different WorkModel and XAI Model consistency training methods can be selected based on the form of decision results in actual application scenarios, which has strong applicability. Of course, by changing the Work Model and XAI Model, the XAI Model in this embodiment can be applied to various types of user data samples, such as images, text, and tabular data. The XAI Model in this embodiment is highly versatile.
[0102] The technical solution of the embodiment of the present invention obtains user interactive feedback based on an online learning server during Work Model consistency testing and designs a specific calculation method for Work Model consistency testing based on the form of the decision results. In the steps of XAI Model internal consistency testing and XAI Model external consistency testing, a structural comparison component A is developed to compare the interpretation of the result output by the XAI Model with the corresponding reference standard (Rule base) of the interpretation result to determine the XAI Model internal consistency ID2-Result. A structural comparison learning component B is developed to compare the interpretation of the result output by the XAI Model with sample labels or user interactive input to determine the XAI Model external consistency ID3-Result. In the calculation of target parameters, an XAI online learning management component is developed to calculate the overall system error loss value and compare it with the parameter threshold to determine whether to trigger different types of online learning based on the XAI model type. The present invention proposes a method for solving XAI model interpretation consistency based on online comparison learning. By continuously examining the consistency of multiple comparison results, this method can complete XAI model optimization through online learning, ultimately achieving final consistency of the XAI model.
[0103] Example 2
[0104] Figure 3 Schematic diagram of the structure of an XAI model consistency training device provided according to the second embodiment of the present invention. Figure 3 As shown, the device includes: a first input module 201 , a first determination module 202 , a second input module 203 , a second determination module 204 , a third determination module 205 and an optimization module 206 .
[0105] The first input module 201 is used to input the first user data sample of the XAI Model into the Work Model after the Work Model training is completed to obtain a prediction decision result;
[0106] A first determination module 202, configured to determine a first parameter according to the prediction decision result;
[0107] A second input module 203 is configured to input the decision result of the second user data sample output by the Work Model into the XAI Model after the XAI Model training is completed to obtain a prediction and interpretation result;
[0108] A second determination module 204 is configured to determine a second parameter based on the prediction interpretation result;
[0109] A third determining module 205 is configured to determine a target parameter according to the first parameter and the second parameter;
[0110] The optimization module 206 is configured to optimize the parameters of the XAI Model along the gradient direction if the target parameter is greater than the parameter threshold.
[0111] Optionally, the first determining module 202 includes:
[0112] A first determining unit is configured to determine a first parameter based on the prediction decision result and a label carried by the first user data sample.
[0113] Optionally, the first determining module 202 includes:
[0114] A first acquiring unit, configured to acquire decision result feedback information input by a user;
[0115] The second determining unit is used to determine a first parameter according to the predicted decision result and the decision result feedback information.
[0116] Optionally, the second determining module 204 includes:
[0117] A second obtaining unit, configured to obtain an interpretation result corresponding to the decision result of the second user data sample;
[0118] The third determining unit is used to determine the second parameter according to the interpretation result and the predicted interpretation result corresponding to the decision result of the second user data sample.
[0119] Optionally, the second determining module 204 includes:
[0120] A third acquisition unit is used to obtain a decision result corresponding to the prediction and interpretation result;
[0121] The fourth determining unit is used to determine the second parameter according to the decision result corresponding to the prediction interpretation result and the decision result of the second user data sample.
[0122] Optionally, the XAI model consistency training device further includes:
[0123] an acquisition module, configured to acquire reason feedback information corresponding to a decision result of the second user data sample;
[0124] The fourth determination module is used to determine a third parameter according to the prediction explanation result and the cause feedback information.
[0125] Optionally, the third determining module 205 includes:
[0126] A fifth determining unit is configured to determine a target parameter according to the first parameter, the second parameter, and the third parameter.
[0127] The XAI model consistency training device provided in the embodiment of the present invention can execute the XAI model consistency training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0128] Example 3
[0129] Figure 4 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0130] like Figure 4 As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., which is communicatively connected to the at least one processor 31. The memory stores a computer program that can be executed by the at least one processor. The processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 into the random access memory (RAM) 33. Various programs and data required for the operation of the electronic device 30 can also be stored in the RAM 33. The processor 31, ROM 32, and RAM 33 are connected to each other via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0131] Multiple components in the electronic device 30 are connected to the I / O interface 35, including an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a magnetic disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0132] The processor 31 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 31 executes the various methods and processes described above, such as the XAI model consistency training method:
[0133] After the Work Model training is completed, the first user data sample of the XAI Model is input into the Work Model to obtain the prediction decision result;
[0134] Determine a first parameter according to the prediction decision result;
[0135] After the XAI Model training is completed, the decision result of the second user data sample output by the Work Model is input into the XAI Model to obtain a prediction and interpretation result;
[0136] determining a second parameter according to the prediction interpretation result;
[0137] determining a target parameter according to the first parameter and the second parameter;
[0138] If the target parameter is greater than the parameter threshold, the parameters of the XAI Model are optimized along the gradient direction.
[0139] In some embodiments, the XAI model consistency training method may be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the XAI model consistency training method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the XAI model consistency training method in any other appropriate manner (e.g., by means of firmware).
[0140] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0142] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0144] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0145] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0146] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0147] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A XAI model consistency training method, characterized in that: include: After the Work Model training is completed, the first user data sample of the XAI Model is input into the Work Model to obtain a predicted decision result; wherein, the Work Model is a working model; in the intelligent customer service scenario, the working model exists in the intelligent customer service robot system and is used to make decisions on questions raised by users and output decision results; wherein, the XAI Model is an interpretable model; in the intelligent customer service scenario, the interpretable model exists in the intelligent customer service robot system and is used to output interpretation results for questions raised by users; the first user data sample includes: images, text, and table data; Determine a first parameter according to the prediction decision result; After the XAI Model training is completed, the decision result of the second user data sample output by the Work Model is input into the XAI Model to obtain a prediction and interpretation result; determining a second parameter according to the prediction interpretation result; determining a target parameter according to the first parameter and the second parameter; If the target parameter is greater than the parameter threshold, the parameters of the XAI Model are optimized along the gradient direction.
2. The method according to claim 1, characterized in that Determining a first parameter according to the prediction decision result includes: A first parameter is determined according to the prediction decision result and a label carried by the first user data sample.
3. The method according to claim 1, characterized in that Determining a first parameter according to the prediction decision result includes: Obtaining feedback information on the decision results input by the user; A first parameter is determined according to the predicted decision result and the decision result feedback information.
4. The method according to claim 1, wherein Determining a second parameter according to the prediction interpretation result includes: Obtaining an interpretation result corresponding to the decision result of the second user data sample; The second parameter is determined according to the interpretation result and the predicted interpretation result corresponding to the decision result of the second user data sample.
5. The method according to claim 1, wherein Determining a second parameter according to the prediction interpretation result includes: Obtaining a decision result corresponding to the prediction interpretation result; The second parameter is determined according to the decision result corresponding to the prediction interpretation result and the decision result of the second user data sample.
6. The method according to claim 4 or 5, characterized in that Also includes: Obtaining reason feedback information corresponding to the decision result of the second user data sample; A third parameter is determined according to the prediction explanation result and the cause feedback information.
7. The method according to claim 6, characterized in that Determining a target parameter according to the first parameter and the second parameter includes: A target parameter is determined according to the first parameter, the second parameter, and the third parameter.
8. An XAI model consistency training device, characterized in that: include: A first input module is configured to input a first user data sample of the XAI Model into the Work Model after Work Model training is completed to obtain a predicted decision result; wherein the Work Model is a working model; in an intelligent customer service scenario, the working model exists in an intelligent customer service robot system and is used to make decisions on questions raised by users and output decision results; wherein the XAI Model is an interpretable model; in an intelligent customer service scenario, the interpretable model exists in the intelligent customer service robot system and is used to output interpretation results for questions raised by users; the first user data sample includes: images, text, and tabular data; A first determining module, configured to determine a first parameter according to the prediction decision result; A second input module is configured to input the decision result of the second user data sample output by the Work Model into the XAI Model after the XAI Model training is completed to obtain a prediction and interpretation result; A second determining module, configured to determine a second parameter according to the prediction interpretation result; a third determining module, configured to determine a target parameter according to the first parameter and the second parameter; An optimization module is configured to optimize the parameters of the XAI Model along a gradient direction if the target parameter is greater than a parameter threshold.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the XAI model consistency training method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the XAI model consistency training method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Customized information sending method and device and electronic equipment
CN113297480A
Artificial intelligence interpretation method and device, equipment and storage medium
CN115062791A