Model interpretation information generation method and device, computer equipment and storage medium
By analyzing local feature contributions and feature paths of complex machine learning models, model explanation information is generated, which solves the problem of opaque decision-making in black-box models and improves the credibility and reliability of the model.
Patent Information
- Application Number
- CN202310446624.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-23
- Publication Date
- 2024-10-25
AI Technical Summary
The black-box characteristics of complex machine learning models lead to opaque decision-making processes and basis, reducing the reliability of the model. Existing explanation methods cannot meet the needs of complex models, resulting in low reliability.
Through interpretability analysis and critical path analysis based on local features and prediction categories of multimedia resources, model explanation information is generated, the contribution of local features and feature paths are revealed, and a detailed explanation of the decision-making process is provided.
It improves the credibility and reliability of the model, provides an accurate and detailed explanation of the decision-making process of the complex model, and enhances the user's understanding of the model behavior.
Smart Images

Figure CN118839735A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for generating model interpretation information. Background Art
[0002] With the development of computer technology, the application of machine learning models is becoming more and more extensive. For example, in the financial field, financial product marketing models can output users' credit scores, marketing success probability, etc. based on the input user information. However, due to the black box characteristics of complex machine learning models, for users, machine learning models only feedback a decision result based on the input, but the decision process and decision basis are opaque to users, which reduces the reliability of machine learning models. Therefore, how to explain the decision process and decision basis of machine learning models to improve the reliability of machine learning models is a technical problem that needs to be solved.
[0003] In related technologies, in order to understand the decision-making process and basis of a machine learning model, an interpretable model (such as a linear regression model, a decision tree model, or a logistic regression model) can be trained to approximate the prediction of a black box model (complex machine learning model). First, a trained black box model is used to predict a data set, and then an interpretable model is trained based on the data set and the prediction results of the black box model, so that the decision-making process and basis of the black box model can be explained through the trained interpretable model.
[0004] However, the above solutions can only provide relatively simple model explanations, which are difficult to meet the needs of complex machine learning models, resulting in low reliability of complex machine learning models. Summary of the invention
[0005] The embodiment of the present application provides a method, device, computer equipment and storage medium for generating model explanation information, which can generate accurate and detailed model explanation information and improve the credibility and reliability of the target model. The technical solution is as follows:
[0006] In one aspect, a method for generating model explanation information is provided, the method comprising:
[0007] Based on multiple local features and predicted categories of multimedia resources, an interpretability analysis is performed on a target model to obtain multiple contribution degrees of the multiple local features, the predicted category is obtained based on the prediction of the multimedia resource by the target model, the target model is used to predict the category of the input multimedia resource, and the contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category;
[0008] Based on the multiple local features and the predicted categories, a key path analysis is performed on the target model to obtain multiple feature paths of the multiple local features, wherein a starting point of a feature path of a local feature is used to represent the local feature, an end point is used to represent the predicted category, and the feature path is used to represent a processing process of obtaining the predicted category based on the local feature;
[0009] Based on the multiple contribution degrees and the multiple feature paths, model explanation information of the target model is generated, and the model explanation information is used to explain the process of the target model obtaining the predicted category based on the multimedia resource.
[0010] In another aspect, a device for generating model explanation information is provided, the device comprising:
[0011] A first analysis module is used to perform an interpretability analysis on a target model based on a plurality of local features and a predicted category of a multimedia resource to obtain a plurality of contribution degrees of the plurality of local features, wherein the predicted category is obtained based on the prediction of the multimedia resource by the target model, the target model is used to predict the category of an input multimedia resource, and the contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category;
[0012] A second analysis module is used to perform a key path analysis on the target model based on the multiple local features and the predicted category to obtain multiple feature paths of the multiple local features, wherein a starting point of a feature path of a local feature is used to represent the local feature, an end point is used to represent the predicted category, and the feature path is used to represent a processing process of obtaining the predicted category based on the local feature;
[0013] A generation module is used to generate model explanation information of the target model based on the multiple contribution degrees and the multiple feature paths, wherein the model explanation information is used to explain the process of the target model obtaining the predicted category based on the multimedia resource.
[0014] In some embodiments, the first analysis module includes:
[0015] an analysis unit, configured to perform feature importance analysis on the plurality of local features based on a prediction model to obtain a plurality of importances of the plurality of local features, wherein the prediction model is used to predict the importance of a local feature to a prediction category, and the importance of a local feature is used to indicate the importance of the local feature to the prediction category;
[0016] A processing unit, configured to process the plurality of local features based on an interpretable model to obtain a plurality of interpretability degrees of the plurality of local features, wherein the interpretable model is used to determine the interpretability degree of a local feature, and the interpretability degree of a local feature is used to indicate the interpretability degree of the local feature;
[0017] A rule extraction unit, configured to extract rules from the target model based on the multiple local features and the predicted category, and determine multiple confidences of the multiple rules based on the extracted multiple rules, wherein the multiple rules correspond to the multiple local features one by one, the rules are used to indicate that the category of the multimedia resource including the local features is determined as the predicted category, and the confidence of a rule is used to indicate the credibility of the rule;
[0018] The summing unit is used to perform weighted summation on the importance, interpretability and confidence of the rule of any local feature to obtain the contribution of the local feature.
[0019] In some embodiments, the prediction model includes a plurality of decision trees;
[0020] The analysis unit is used to perform feature importance analysis on any local feature among the multiple local features based on the prediction model to obtain the importance of the local feature in each decision tree; and determine the average value of the importance of the local feature in each decision tree as the importance of the local feature.
[0021] In some embodiments, the rule extraction unit is used to extract the multiple rules from the rule set of the target model based on the multiple local features and the predicted category; for any rule, the confidence of the rule is determined based on the membership of the local feature corresponding to the rule, and the membership is used to indicate the degree of membership of the local feature to the multimedia resource, and the membership is positively correlated with the confidence.
[0022] In some embodiments, the apparatus further comprises:
[0023] A sampling module, configured to perform multiple random sampling on the multiple local features to obtain multiple disturbance multimedia resources, wherein the disturbance multimedia resources include at least one local feature;
[0024] A prediction module, configured to predict any disturbance multimedia resource based on the target model to obtain a first prediction category of the disturbance multimedia resource;
[0025] A training module is used to train the interpretable model based on the multiple first predicted categories of the multiple perturbed multimedia resources and the multiple perturbed multimedia resources.
[0026] In some embodiments, the training module is used to predict any perturbation multimedia resource based on the interpretable model to obtain a second prediction category of the perturbation multimedia resource; determine the training loss of the interpretable model based on the first prediction category of the perturbation multimedia resource and the second prediction category of the perturbation multimedia resource, wherein the training loss is used to indicate the difference between the first prediction category and the second prediction category; and update the model parameters of the interpretable model based on the training loss.
[0027] In some embodiments, the second analysis module is used to construct an initial feature path of any local feature among the multiple local features, the starting point of the initial feature path is used to represent the local feature, and the end point of the initial feature path is used to represent the predicted category; relax the initial feature path to obtain the feature path of the local feature; when there is a negative loop in the feature path, relax the initial feature path again to obtain the updated feature path of the local feature.
[0028] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the method for generating model interpretation information in an embodiment of the present application.
[0029] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement a method for generating model interpretation information as in an embodiment of the present application.
[0030] On the other hand, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to implement the method for generating model interpretation information provided in an embodiment of the present application.
[0031] The embodiment of the present application provides a method for generating model interpretation information, by performing interpretability analysis and critical path analysis on a target model based on multiple local features and prediction categories of multimedia resources, and multiple contribution degrees and multiple feature paths of multiple local features can be obtained. Due to the contribution degree of multiple local features indicated by multiple contribution degrees to the prediction type, the relationship between multiple local features and the prediction category can be determined, and the processing process of obtaining the prediction category based on the local features represented by the feature path can understand the internal processing details of the local features of the target model. Therefore, based on the multiple contribution degrees and multiple feature paths of multiple local features, the model interpretation information of the target model is generated, and the process of the target model obtaining the prediction category based on the multimedia resources can be accurately and detailedly explained based on the model interpretation information, thereby improving the credibility and reliability of the target model. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 It is a schematic diagram of an implementation environment of a method for generating model explanation information provided in an embodiment of the present application;
[0034] Figure 2 is a flow chart of a method for generating model explanation information provided according to an embodiment of the present application;
[0035] Figure 3 is a flowchart of another method for generating model explanation information provided in an embodiment of the present application;
[0036] Figure 4 is a block diagram of a device for generating model explanation information according to an embodiment of the present application;
[0037] Figure 5 is a block diagram of another device for generating model explanation information provided according to an embodiment of the present application;
[0038] Figure 6 is a structural block diagram of a terminal provided according to an embodiment of the present application;
[0039] Figure 7 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0041] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.
[0042] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.
[0043] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the multimedia resources involved in this application are obtained with full authorization.
[0044] The following explains the terms used in this application.
[0045] Artificial Intelligence (AI): It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best category. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0046] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.
[0047] Machine Learning (ML): It is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0048] Explainability: refers to the fact that the output of a machine learning model can be understood and explained, so that humans can understand what the model is doing and how it makes predictions.
[0049] Critical Path Analysis: refers to finding the most important path that affects the entire system in a complex system in order to optimize the system.
[0050] The method for generating model interpretation information provided in the embodiment of the present application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. The following takes the computer device as an example to introduce the implementation environment of the method for generating model interpretation information provided in the embodiment of the present application. Figure 1 Schematic diagram of an implementation environment of a method for generating model explanation information provided in an embodiment of the present application. Figure 1 The implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0051] In some embodiments, the terminal 101 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an intelligent voice interaction device, a smart home appliance, a car terminal, etc., but is not limited thereto. The terminal 101 is installed with an application that can display the model interpretation information of the target model. The application can be a social application, a financial application, an information application, etc., and the embodiments of the present application are not limited to this. Schematically, the application is a financial application, and the target model is a credit assessment model. The financial application can obtain the user's credit score based on the credit assessment model according to the user information. In order to understand how the credit assessment model obtains the user's credit score based on the user information, the terminal 101 can send the credit assessment model to the server 102, and the server 102 analyzes the processing process of the credit assessment model obtaining the user's credit score based on the user information.
[0052] In some embodiments, the server 102 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 is used to provide background services for applications that support the above-mentioned content item collection. Schematically, server 102 receives the credit assessment model uploaded by terminal 101. Based on multiple user features of user information and the user's credit score, server 102 can perform parsable analysis and critical path analysis on the credit assessment model to obtain model interpretation information of the credit assessment model. Server 102 returns the model interpretation information to terminal 101, and terminal 101 displays the model interpretation information through an application.
[0053] In some embodiments, the server 102 undertakes the main computing work and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 adopt a distributed computing architecture to perform collaborative computing.
[0054] Figure 2 is a flow chart of a method for generating model explanation information according to an embodiment of the present application. Figure 2 As shown, in the embodiment of the present application, the example of execution by the server is used for explanation. The method for generating the model explanation information includes the following steps:
[0055] 201. The server performs an interpretable analysis on the target model based on multiple local features and predicted categories of the multimedia resources to obtain multiple contribution degrees of the multiple local features. The predicted category is obtained based on the prediction of the multimedia resources by the target model. The target model is used to predict the category of the input multimedia resources. The contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category.
[0056] In the embodiment of the present application, the multimedia resource can be text, image, video, audio, etc., and the embodiment of the present application does not limit this. For example, when the multimedia resource is an image, the target model can be an image recognition model, and the image recognition model is used to predict the category of the input image. The category of the image includes animal category, plant category, building category, etc. When the multimedia resource is a video, the target model can be a video recognition model, and the video recognition model can be used to predict the category of the input video. The category of the video includes game category, sports category, scenery category, etc. The server performs an interpretability analysis on the target model based on multiple local features and predicted categories of the multimedia resource, and can obtain multiple contribution degrees of multiple local features of the multimedia resource. Among them, the contribution degree is used to indicate the contribution of the local feature to the predicted category. The higher the contribution degree, the higher the contribution degree of the local feature to the predicted category, and the higher the probability that the target model obtains the predicted category based on the local feature. Therefore, by analyzing the multiple contribution degrees of multiple local features, it is possible to determine the local features on which the target model obtains the predicted category based on the multimedia resource, thereby helping the user understand the decision basis for the target model to obtain the predicted category.
[0057] 202. The server performs a critical path analysis on the target model based on multiple local features and prediction categories to obtain multiple feature paths of multiple local features. The starting point of a feature path of a local feature is used to represent the local feature, and the end point is used to represent the prediction category. The feature path is used to represent the processing process of obtaining the prediction category based on the local feature.
[0058] In the embodiment of the present application, since the target model can output the predicted category of the multimedia resource based on the input multimedia resource. Therefore, the server performs a critical path analysis on the target model based on multiple local features and predicted categories of the multimedia resource, and can obtain multiple feature paths of multiple local features. Among them, each feature path includes multiple nodes, the starting point of the feature path is used to represent the local features of the multimedia resource, and the end point is used to represent the predicted category of the multimedia resource. Based on the connection relationship between multiple nodes in the feature path, the server can determine the processing process of obtaining the predicted category represented by the end point based on the local features represented by the starting point.
[0059] 203. The server generates model explanation information of the target model based on the multiple contribution degrees and the multiple feature paths, where the model explanation information is used to explain the process of the target model obtaining a predicted category based on the multimedia resources.
[0060] In an embodiment of the present application, the server can determine the probability that the target model obtains a predicted category based on any local feature based on the contribution degree of multiple local features indicated by multiple contribution degrees to the predicted category. The server can determine the internal processing flow of the target model to obtain a predicted category based on local features based on the processing process of the target model represented by multiple feature paths to obtain a predicted category based on multiple local features. Therefore, the server can generate model explanation information of the target model based on multiple contribution degrees and multiple feature paths. The model explanation information can be in the form of a table, text, picture, etc., which is not limited in the embodiment of the present application. By generating the model explanation information of the target model, the server can explain the process by which the target model obtains a predicted category based on multimedia resources, thereby helping users better understand the decision-making process of the target model and improving the credibility and reliability of the target model.
[0061] The embodiment of the present application provides a method for generating model interpretation information, by performing interpretability analysis and critical path analysis on a target model based on multiple local features and prediction categories of multimedia resources, and multiple contribution degrees and multiple feature paths of multiple local features can be obtained. Due to the contribution degree of multiple local features indicated by multiple contribution degrees to the prediction type, the relationship between multiple local features and the prediction category can be determined, and the processing process of obtaining the prediction category based on the local features represented by the feature path can understand the internal processing details of the local features of the target model. Therefore, based on the multiple contribution degrees and multiple feature paths of multiple local features, the model interpretation information of the target model is generated, and the process of the target model obtaining the prediction category based on the multimedia resources can be accurately and detailedly explained based on the model interpretation information, thereby improving the credibility and reliability of the target model.
[0062] Figure 3 is a flowchart of another method for generating model explanation information according to an embodiment of the present application. Figure 3 As shown, in the embodiment of the present application, the example of execution by the server is used for explanation. The method for generating the model explanation information includes the following steps:
[0063] 301. The server performs feature importance analysis on multiple local features of multimedia resources based on a prediction model to obtain multiple importances of the multiple local features. The prediction model is used to predict the importance of local features to a prediction category. The prediction category is obtained by predicting the multimedia resources based on a target model. The importance of a local feature is used to indicate the importance of the local feature to the prediction category. The target model is used to predict the category of the input multimedia resource.
[0064] In the embodiment of the present application, the multimedia resource can be text, image, video, audio, etc., and the embodiment of the present application does not limit this. The server predicts the multimedia resource based on the target model and can obtain the predicted category of the multimedia resource. Taking the multimedia resource as an image as an example, the predicted category of the image can be an animal category, a plant category, a building category, etc. The prediction model is a machine learning model obtained by training based on multiple sample multimedia resources, and is inconsistent with the structure of the target model. The prediction model can not only predict the category of the input multimedia resource, but also predict the importance of multiple local features of the multimedia resource to the predicted category during the prediction process. Therefore, the server performs feature importance analysis on multiple local features based on the prediction model, and can obtain multiple importances of multiple local features. The server can determine the importance of multiple local features to the predicted category based on the multiple importances output by the prediction model. The higher the importance, the higher the importance of the local feature to the predicted category, and the closer the relationship between the local feature and the predicted category.
[0065] In some embodiments, the target model is a CNN (Convolutional Neural Network) model, including components such as a convolutional layer, a pooling layer, and a fully connected layer. Taking multimedia resources as images as an example, when extracting the features of an image, the CNN model first inputs the image into the convolutional layer, and obtains a series of feature maps through a series of convolution operations and activation function calculations. Then, the feature map is downsampled through the pooling layer to reduce the size of the feature map and improve the computational efficiency. Finally, the output of the pooling layer is used as the input of the fully connected layer to perform tasks such as classification or regression. The CNN model uses an end-to-end training method, and the model parameters can be optimized through a back-propagation algorithm to improve the accuracy and efficiency of the model. The server uses the CNN model as the target model to extract features from multimedia resources, so that the target model can automatically extract useful local features from the multimedia resources, thereby improving the accuracy and efficiency of the target model.
[0066] In some embodiments, the server performs a convolution operation on the input image by using the following formula 1. The server expresses the activation function of the target model by using the following formula 2. The server performs a pooling operation on the feature map output by the convolution layer by using the following formula 3.
[0067] Formula 1:
[0068]
[0069] Among them, I represents the input image, K represents the convolution kernel, S represents the convolution result, i represents the horizontal coordinate of any pixel point in the input image I, j represents the vertical coordinate of any pixel point in the input image I; M represents the height of the convolution kernel K, and n represents the width of the convolution kernel K.
[0070] Formula 2:
[0071]
[0072] Among them, w ij represents the weight between the i-th neuron and the j-th neuron, x j represents the input of the jth neuron, b i represents the bias of the i-th neuron, z i represents the input of the i-th neuron, and f represents the activation function.
[0073] Formula 3:
[0074]
[0075] Among them, x p,q represents a pixel on the input feature map, R(i,j) represents the receptive field of pixel (i,j), y i,j Represents the pooling result.
[0076] In some embodiments, the target model is trained based on multiple sample multimedia resources. Before training the target model, the server can perform data preprocessing on multiple sample multimedia resources. First, the server performs data cleaning on multiple sample multimedia resources, and can remove sample multimedia resources with data anomalies such as noise and missing values from multiple sample multimedia resources to improve the quality and accuracy of the training data of the target model. Then the server performs data normalization on the multiple sample multimedia resources after data cleaning, so that the multiple sample multimedia resources have the same measurement scale, thereby improving the training effect of the model. Among them, the server performs data normalization on multiple sample multimedia resources through the following formula four or the following formula five.
[0077] Formula 4:
[0078]
[0079] Formula 5:
[0080]
[0081] Among them, x represents the sample multimedia resource; x′ represents the sample multimedia resource obtained after data normalization; min represents the minimum value of the sample multimedia resource; max represents the maximum value of the sample multimedia resource; μ represents the mean of all sample multimedia resources; σ represents the standard deviation of all sample multimedia resources.
[0082] In some embodiments, the prediction model includes multiple decision trees. For any local feature, the server can determine the importance of the local feature by judging the multiple importances of the local feature in the multiple decision trees. Accordingly, for any local feature among the multiple local features, based on the prediction model, the local feature is analyzed for feature importance to obtain multiple importances of the local feature in each decision tree; the average value of the importance of the local feature in each decision tree is determined as the importance of the local feature. Wherein, the prediction model includes multiple independent decision trees. For any decision tree, the server can perform feature importance analysis on multiple local features based on the decision tree to obtain the importance of multiple local features in the decision tree. Therefore, the server performs feature importance analysis on any local feature based on the multiple decision trees of the prediction model, and can obtain the importance of the local feature in each decision tree, that is, the importance of the local feature in each decision tree of the prediction model to the prediction category. The server can determine the average value of multiple importances in multiple decision trees as the importance of the local feature.
[0083] In some embodiments, the prediction model is a random forest model, and the server can determine the importance of multiple local features through the following formula six.
[0084] Formula 6:
[0085]
[0086] Among them, FI j represents the importance of the jth feature; T represents the decision tree set, T t represents the t-th decision tree; I(j∈T t ) represents the importance of the j-th feature in the t-th decision tree; p(t) represents the sample proportion of the t-th decision tree.
[0087] In some embodiments, the prediction model is a gradient boosting tree model, and the server can determine the importance of multiple local features through the following formula seven.
[0088] Formula 7:
[0089]
[0090] Among them, FI j represents the importance of the jth feature; T represents the decision tree set, T t represents the tth decision tree; L t represents the loss function of the t-th decision tree; p(j∈T t ) represents the importance of the jth feature in the tth decision tree, p(k∈T t ) represents the importance of the k-th feature in the t-th decision tree.
[0091] 302. The server performs multiple random sampling on multiple local features to obtain multiple disturbed multimedia resources, where the disturbed multimedia resources include at least one local feature.
[0092] In an embodiment of the present application, in the process of randomly sampling multiple local features of a multimedia resource, the server can randomly select at least one local feature from the multiple local features, and the server determines a disturbed multimedia resource based on the at least one local feature. The disturbed multimedia resource is similar to the multimedia resource, and the more local features the disturbed multimedia resource includes, the higher the degree of similarity to the multimedia resource. The server can obtain multiple disturbed multimedia resources similar to the multimedia resource by performing multiple random samplings on multiple local features. Optionally, the server randomly samples multiple local features using Gaussian distribution, uniform distribution, and the like.
[0093] 303. For any disturbance multimedia resource, the server predicts the disturbance multimedia resource based on the target model to obtain a first prediction category of the disturbance multimedia resource.
[0094] In an embodiment of the present application, the target model is used to predict the category of an input multimedia resource. Based on the target model, the server can predict multiple disturbance multimedia resources separately to obtain a first predicted category of each disturbance resource.
[0095] 304. The server trains an interpretable model based on the multiple first predicted categories of the multiple perturbed multimedia resources and the multiple perturbed multimedia resources, where the interpretable model is used to determine the interpretability of the local feature.
[0096] In an embodiment of the present application, the interpretable model is a machine learning model with a simple structure, such as a decision tree model, a linear model, etc. In order to train an interpretable model with similar performance to the target model, the server can use the first prediction category predicted by the target model as the label information of the disturbed multimedia resource, and then train the interpretable model based on multiple disturbed multimedia resources and the label information of multiple disturbed multimedia resources, and can obtain an interpretable model that is locally similar to the target model. The server determines the interpretability of multiple local features through the trained interpretable model, and can interpret the predicted category obtained by the target model based on multiple local features, so as to construct the relationship between multiple local features and the predicted category.
[0097] In some embodiments, the server can train an interpretable model based on the first predicted category predicted by the target model for the perturbed multimedia resource and the second predicted category predicted by the interpretable model for the perturbed multimedia resource. Accordingly, for any perturbed multimedia resource, the server predicts the perturbed multimedia resource based on the interpretable model to obtain the second predicted category of the perturbed multimedia resource; based on the first predicted category of the perturbed multimedia resource and the second predicted category of the perturbed multimedia resource, the training loss of the interpretable model is determined, and the training loss is used to indicate the difference between the first predicted category and the second predicted category; based on the training loss, the model parameters of the interpretable model are updated. Among them, the interpretable model can predict the category of the input multimedia resource, and the server can predict the input perturbed multimedia resource based on the interpretable model to obtain the second predicted category of the perturbed multimedia resource. Since the first predicted category is the label information of the perturbed multimedia resource, which is used to indicate the true category of the perturbed multimedia resource, the server can determine the training loss of the interpretable model based on the second predicted category and the first predicted category. The training loss is positively correlated with the accuracy of the interpretable model. The smaller the training loss, the smaller the difference between the first predicted category and the second predicted category, the higher the similarity between the target model and the interpretable model, and the higher the accuracy of the interpretable model.
[0098] In some embodiments, as shown in Formula 8, the interpretable model is a linear model with L1 regularization.
[0099] Formula 8:
[0100]
[0101] Where g(x′) represents the interpretable model; L represents the loss function of the interpretable model; f represents the target model, g represents the linear model, G represents the set of linear models, including all possible linear models g; Ω(g) represents the complexity of the linear model g; π x Indicates the similarity between the perturbed multimedia resource and the multimedia resource.
[0102] 305. The server processes multiple local features of the multimedia resource based on the interpretable model to obtain multiple interpretability levels of the multiple local features. The interpretability level of a local feature is used to indicate the interpretability degree of the local feature.
[0103] In an embodiment of the present application, the interpretable model after training is partially similar to the target model, and the interpretable model can explain the processing process and processing basis of the target model to obtain the predicted category based on the multimedia resources. Therefore, based on the interpretable model after training, the server can process multiple local features of the multimedia resources and obtain multiple interpretability of the multiple local features. Among them, the interpretability is used to indicate the degree of interpretability of the local feature. The higher the interpretability of the local feature, the higher the degree of interpretability of the local feature, and the easier it is to explain the processing process of the target model to obtain the predicted category based on the local feature with a higher degree of interpretability, which can improve the interpretability of the target model.
[0104] 306. The server extracts rules from the target model based on the multiple local features and the predicted categories, and determines multiple confidences of the multiple rules based on the extracted multiple rules. The multiple rules correspond one-to-one to the multiple local features. The rules are used to indicate that the category of the multimedia resource including the local features is determined as the predicted category. The confidence of a rule is used to indicate the credibility of the rule.
[0105] In an embodiment of the present application, the server can generate multiple interpretable rules corresponding to multiple local features one by one based on multiple local features and predicted categories of multimedia resources by extracting rules from the target model. Each rule includes a conditional part and a conclusion part, which are usually expressed in the form of "if-then". The conditional part is "if the multimedia resource includes a certain local feature", and the conclusion part is "then the category of the multimedia resource is the predicted category". Taking the multimedia resource as a face image as an example, the predicted category of the face image is "happy", then the rule of the target model can be "if the face image includes the local feature of the corners of the mouth raised, then the category of the face image is happy". The server can determine the credibility of the target model determining the category of the face image including the local feature of "corners of the mouth raised" as "happy" according to the credibility of the rule. By determining the confidence of the rule, the server can determine the credibility of the target model determining the category of the multimedia resource including the local feature corresponding to the rule as the predicted category. By extracting rules from the target model, the server can convert the target model into a set of interpretable rules so that users can better understand the decision-making process of the target model to obtain the predicted category, thereby improving the reliability of the target model.
[0106] In some embodiments, the server can determine the confidence of the rule based on the membership of the local features corresponding to the rule. Accordingly, the server extracts multiple rules from the rule set of the target model based on multiple local features and prediction categories; for any rule, the confidence of the rule is determined based on the membership of the local features corresponding to the rule. The membership is used to indicate the degree of membership of the local feature to the multimedia resource, and the membership is positively correlated with the confidence. Among them, the server can extract multiple rules from the rule set of the target model based on multiple local features and prediction categories. Each rule includes a condition part and a conclusion part, the condition part includes the local features of the multimedia resource, and the conclusion part includes the prediction category of the target model for the multimedia resource. The server can determine the degree of membership of the local feature to the multimedia resource, that is, the degree of association between the local feature and the multimedia resource by determining the membership of the local feature in the condition part. Since the membership is positively correlated with the confidence, the server can further determine the confidence of the rule based on the membership.
[0107] 307. For any local feature, the server performs a weighted summation of the importance, interpretability and confidence of the rule of the local feature to obtain the contribution of the local feature, where the contribution is used to indicate the contribution degree of the local feature to the predicted category.
[0108] In an embodiment of the present application, importance is used to indicate the importance of a local feature to a predicted category, interpretability is used to indicate the interpretability of a local feature, and confidence of a rule is used to indicate the credibility of the rule, that is, the credibility of determining the category of a multimedia resource including the local feature corresponding to the rule as the predicted category. For any local feature, the server can obtain the contribution of the local feature by taking a weighted sum of the importance, interpretability, and confidence of the rule of the local feature. The server analyzes multiple contributions of multiple local features and can determine the local features on which the target model obtains the predicted category based on the multimedia resource, thereby helping the user understand the decision basis of the target model in obtaining the predicted category.
[0109] 308. For any local feature among the multiple local features, the server constructs an initial feature path of the local feature, where the starting point of the initial feature path is used to represent the local feature, and the end point of the initial feature path is used to represent the predicted category.
[0110] In an embodiment of the present application, for any local feature, the server can determine the initial feature path of the local feature based on the local feature and the predicted category. The initial feature path includes multiple nodes, and adjacent nodes in the multiple nodes are connected by edges. For any node, the adjacent node of the node is the node closest to the node in the multiple nodes. The server can set initial values for the multiple nodes by initializing the multiple nodes in the initial feature path. For any node except the starting point, the initial value of the node represents the distance from the starting point of the initial feature path to the node. Among them, the initial value of the starting point is 0, and the initial values of other nodes are infinite.
[0111] 309. The server performs a relaxation operation on the initial feature path to obtain a feature path of a local feature, where the feature path is used to represent a processing process of obtaining a predicted category based on the local feature.
[0112] In an embodiment of the present application, in the process of performing a relaxation operation on the initial path, the server can perform a relaxation operation on all edges for connecting nodes in the initial feature path. For the edge for connecting node u and node v in the initial feature path, when the sum of the initial value of node u and the weight value of the edge is less than the initial value of node v, the server updates the initial value of node v to the sum of the initial value of node u and the weight value of the edge. When the sum of the initial value of node u and the weight value of the edge is not less than the initial value of node v, the server does not change the initial value of node v. After the server performs the above-mentioned processing on all edges in the initial feature path, the feature path of the local feature can be obtained. The end point and the starting point of the feature path are consistent with the initial feature path, which is used to represent the processing process of the target model to obtain the predicted category based on the local feature. The length of the feature path can be used to reflect the complexity of the processing process of the target model to obtain the predicted category based on the local feature. The longer the feature path is, the more complex the process of obtaining the predicted category is after a series of processing based on the local feature represented by the starting point in the feature path, that is, the probability that the target model determines the category of the multimedia resource containing the local feature as the predicted category is lower. By analyzing the feature paths of multiple local features, the server can understand the processing process of the target model to obtain prediction types based on different local features, and through the lengths of multiple feature paths, it can determine the complexity of multiple processing processes for obtaining prediction categories based on multiple local features, so that the feature path with the shortest length and the simplest processing process can be determined as the most critical feature path in the target model, so as to further optimize the internal processing process of the target model.
[0113] 310. When a negative loop exists in the feature path, the server again performs a relaxation operation on the initial feature path to obtain a feature path of an updated local feature.
[0114] In an embodiment of the present application, after the server performs a relaxation operation on all edges in the initial feature path, the feature path of the local feature to be obtained is checked. For the edge in the feature path used to connect node u and node v, when the sum of the value of node u and the weight value of the edge is less than the value of node v, it indicates that there is a negative loop in the feature path and the feature path is unavailable. At this time, the server can re-perform a relaxation operation on the initial feature path of the local feature until there is no negative loop in the obtained feature path.
[0115] 311. The server generates model explanation information of the target model based on multiple contribution degrees and multiple feature paths, where the model explanation information is used to explain the process of the target model obtaining a predicted category based on multimedia resources.
[0116] In an embodiment of the present application, the server can determine the probability that the target model obtains a predicted category based on any local feature based on the contribution degree of multiple local features indicated by multiple contribution degrees to the predicted category. The server can determine the internal processing flow of the target model to obtain a predicted category based on local features based on the processing process of the target model represented by multiple feature paths to obtain a predicted category based on multiple local features. Therefore, the server can generate model explanation information of the target model based on multiple contribution degrees and multiple feature paths. The model explanation information can be in the form of a table, text, picture, etc., which is not limited in the embodiment of the present application. By generating the model explanation information of the target model, the server can explain the process by which the target model obtains a predicted category based on multimedia resources, thereby helping users better understand the decision-making process of the target model and improving the credibility and reliability of the target model.
[0117] In some embodiments, after obtaining the model interpretation information of the target model, the server can also perform accuracy evaluation, efficiency evaluation and stability evaluation on the target model. Among them, the accuracy evaluation is used to evaluate the accuracy of the prediction results of the target model, and methods such as cross-validation can be used to evaluate the accuracy of the target model. Efficiency evaluation is used to evaluate the speed and efficiency of the target model prediction, and indicators such as the target model inference time can be used to evaluate the efficiency of the target model. Stability evaluation is used to evaluate the performance stability of the target model under different types of multimedia resources and application scenarios, and indicators such as the generalization ability of the target model can be used to evaluate the stability of the target model. After the evaluation, if the performance of the target model is poor, the server can also optimize the target model using hyperparameter tuning technology to improve the performance of the target model. In the process of hyperparameter tuning of the target model, it is first necessary to select the range of hyperparameters, which may include learning rate, regularization parameter, number of hidden layer nodes, number of iterations, etc. After determining the hyperparameter range, it is necessary to select a search method to traverse the hyperparameter space. Common search methods include grid search, random search, Bayesian optimization, etc. In the search process, it is necessary to evaluate the impact of each hyperparameter combination on the performance of the target model. Cross-validation and other methods can usually be used to evaluate the performance of the target model, such as calculating the average cross-validation score, average accuracy and other indicators. After the search is completed, the optimal hyperparameter combination needs to be selected. Common selection methods include selecting the hyperparameter combination with the highest accuracy, selecting the hyperparameter combination with the minimum loss function, etc. The server determines the optimal hyperparameter combination through the following formula 9.
[0118] Formula 9:
[0119]
[0120] Where L is the loss function of the hyperparameter combination θ; X is the input of the target model; Y is the output of the target model; θ is the hyperparameter space.
[0121] The embodiment of the present application provides a method for generating model interpretation information, by performing interpretability analysis and critical path analysis on a target model based on multiple local features and prediction categories of multimedia resources, and multiple contribution degrees and multiple feature paths of multiple local features can be obtained. Due to the contribution degree of multiple local features indicated by multiple contribution degrees to the prediction type, the relationship between multiple local features and the prediction category can be determined, and the processing process of obtaining the prediction category based on the local features represented by the feature path can understand the internal processing details of the local features of the target model. Therefore, based on the multiple contribution degrees and multiple feature paths of multiple local features, the model interpretation information of the target model is generated, and the process of the target model obtaining the prediction category based on the multimedia resources can be accurately and detailedly explained based on the model interpretation information, thereby improving the credibility and reliability of the target model.
[0122] Figure 4 is a block diagram of a device for generating model explanation information according to an embodiment of the present application. The device is used to execute the above-mentioned method for generating model explanation information, see Figure 4 The device includes: a first analysis module 401, a second analysis module 402 and a generation module 403.
[0123] A first analysis module 401 is used to perform an interpretability analysis on a target model based on multiple local features and predicted categories of multimedia resources to obtain multiple contribution degrees of multiple local features, wherein the predicted category is obtained based on the prediction of the multimedia resource by the target model, the target model is used to predict the category of the input multimedia resource, and the contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category;
[0124] A second analysis module 402 is used to perform a key path analysis on the target model based on multiple local features and prediction categories to obtain multiple feature paths of multiple local features, wherein the starting point of a feature path of a local feature is used to represent the local feature, and the end point is used to represent the prediction category, and the feature path is used to represent the processing process of obtaining the prediction category based on the local feature;
[0125] The generation module 403 is used to generate model explanation information of the target model based on multiple contribution degrees and multiple feature paths, and the model explanation information is used to explain the process of the target model obtaining the predicted category based on the multimedia resources.
[0126] In some embodiments, Figure 5 is a block diagram of another device for generating model explanation information according to an embodiment of the present application. Figure 5 , the first analysis module 401 includes:
[0127] An analysis unit 501 is used to perform feature importance analysis on multiple local features based on a prediction model to obtain multiple importances of the multiple local features, wherein the prediction model is used to predict the importance of the local features to the prediction category, and the importance of a local feature is used to indicate the importance of the local feature to the prediction category;
[0128] A processing unit 502 is used to process multiple local features based on an interpretable model to obtain multiple interpretability of the multiple local features, where the interpretable model is used to determine the interpretability of the local features, and the interpretability of a local feature is used to indicate the interpretability of the local feature;
[0129] A rule extraction unit 503 is used to extract rules from a target model based on multiple local features and predicted categories, and determine multiple confidences of the multiple rules based on the extracted multiple rules, wherein the multiple rules correspond to the multiple local features one by one, the rule is used to indicate that the category of the multimedia resource including the local features is determined as the predicted category, and the confidence of a rule is used to indicate the credibility of the rule;
[0130] The summing unit 504 is used to perform weighted summation of the importance, interpretability and confidence of the rule of any local feature to obtain the contribution of the local feature.
[0131] In some embodiments, the prediction model includes a plurality of decision trees;
[0132] The analysis unit 501 is used to perform feature importance analysis on any local feature among the multiple local features based on the prediction model to obtain the importance of the local feature in each decision tree; and determine the average value of the importance of the local feature in each decision tree as the importance of the local feature.
[0133] In some embodiments, the rule extraction unit 503 is used to extract multiple rules from the rule set of the target model based on multiple local features and prediction categories; for any rule, the confidence of the rule is determined based on the membership of the local feature corresponding to the rule, and the membership is used to indicate the degree of membership of the local feature to the multimedia resource, and the membership is positively correlated with the confidence.
[0134] In some embodiments, see Figure 5 , the device further comprises:
[0135] A sampling module 404 is used to perform multiple random sampling on the multiple local features to obtain multiple disturbed multimedia resources, where the disturbed multimedia resources include at least one local feature;
[0136] The prediction module 405 is used to predict any disturbance multimedia resource based on the target model to obtain a first prediction category of the disturbance multimedia resource;
[0137] The training module 406 is configured to train an interpretable model based on a plurality of first predicted categories of a plurality of perturbed multimedia resources and a plurality of perturbed multimedia resources.
[0138] In some embodiments, the training module 406 is used to predict the perturbed multimedia resource based on the interpretable model for any perturbed multimedia resource to obtain a second predicted category of the perturbed multimedia resource; determine the training loss of the interpretable model based on the first predicted category of the perturbed multimedia resource and the second predicted category of the perturbed multimedia resource, where the training loss is used to indicate the difference between the first predicted category and the second predicted category; and update the model parameters of the interpretable model based on the training loss.
[0139] In some embodiments, the second analysis module 402 is used to construct an initial feature path of a local feature for any local feature among multiple local features, where the starting point of the initial feature path is used to represent the local feature, and the end point of the initial feature path is used to represent the predicted category; the initial feature path is relaxed to obtain the feature path of the local feature; when there is a negative loop in the feature path, the initial feature path is relaxed again to obtain the feature path of the updated local feature.
[0140] The embodiment of the present application provides a device for generating model interpretation information, which performs interpretability analysis and critical path analysis on a target model based on multiple local features and prediction categories of multimedia resources, and can obtain multiple contribution degrees and multiple feature paths of multiple local features. Since the contribution degree of multiple local features indicated by multiple contribution degrees to the prediction type respectively, the relationship between multiple local features and the prediction category can be determined, and the processing process of obtaining the prediction category based on the local features represented by the feature path can understand the internal processing details of the local features of the target model. Therefore, based on the multiple contribution degrees and multiple feature paths of multiple local features, the model interpretation information of the target model is generated, and the process of the target model obtaining the prediction category based on the multimedia resources can be accurately and detailedly explained based on the model interpretation information, thereby improving the credibility and reliability of the target model.
[0141] It should be noted that the device for generating model interpretation information provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating model interpretation information provided in the above embodiment and the embodiment of the method for generating model interpretation information belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0142] In the embodiments of the present application, the computer device can be configured as a terminal or a server. When the computer device is configured as a server, the server can be used as the execution subject to implement the technical solution provided in the embodiments of the present application. When the computer device is configured as a terminal, the terminal can be used as the execution subject to implement the technical solution provided in the embodiments of the present application. Of course, the technical solution provided in the embodiments of the present application can also be implemented collaboratively by the service and the terminal, and the embodiments of the present application are not limited to this.
[0143] Figure 6 It is a structural block diagram of a terminal 600 provided according to an embodiment of the present application.
[0144] Typically, the terminal 600 includes a processor 601 and a memory 602 .
[0145] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0146] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one computer program, which is used to be executed by the processor 601 to implement the method for generating model interpretation information provided in the method embodiment of the present application.
[0147] In some embodiments, the terminal 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607 and a power supply 608.
[0148] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0149] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. In some embodiments, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0150] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, set on the front panel of the terminal 600; in other embodiments, the display screen 605 can be at least two, respectively set on different surfaces of the terminal 600 or in a folding design; in other embodiments, the display screen 605 can be a flexible display screen, set on the curved surface or folding surface of the terminal 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0151] The camera assembly 606 is used to capture images or videos. In some embodiments, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash may be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0152] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0153] The power supply 608 is used to power various components in the terminal 600. The power supply 608 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 608 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0154] In some embodiments, the terminal 600 further includes one or more sensors 609 , including but not limited to: an acceleration sensor 610 , a gyroscope sensor 611 , a pressure sensor 612 , an optical sensor 613 , and a proximity sensor 614 .
[0155] The acceleration sensor 610 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 600. For example, the acceleration sensor 610 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 610. The acceleration sensor 610 can also be used to collect game or user motion data.
[0156] The gyro sensor 611 can detect the body direction and rotation angle of the terminal 600, and the gyro sensor 611 can cooperate with the acceleration sensor 610 to collect the user's 3D actions on the terminal 600. The processor 611 can implement the following functions based on the data collected by the gyro sensor 611: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0157] The pressure sensor 612 can be set on the side frame of the terminal 600 and / or the lower layer of the display screen 605. When the pressure sensor 612 is set on the side frame of the terminal 600, it can detect the user's holding signal of the terminal 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 612. When the pressure sensor 612 is set on the lower layer of the display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0158] The optical sensor 613 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 613. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 613.
[0159] The proximity sensor 614, also called a distance sensor, is usually arranged on the front panel of the terminal 600. The proximity sensor 614 is used to collect the distance between the user and the front of the terminal 600. In one embodiment, when the proximity sensor 614 detects that the distance between the user and the front of the terminal 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 604 detects that the distance between the user and the front of the terminal 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from the screen-off state to the screen-on state.
[0160] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0161] Figure 7It is a structural diagram of a server provided according to an embodiment of the present application. The server 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 701 and one or more memories 702, wherein the memory 702 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 701 to implement the generation method of model interpretation information provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for realizing device functions, which will not be repeated here.
[0162] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor to implement the method for generating model interpretation information in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0163] An embodiment of the present application also provides a computer program product, including a computer program product, which is executed by a processor to implement the method for generating model interpretation information in the above embodiment.
[0164] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0165] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for generating model explanation information, characterized in that: The method comprises: Based on multiple local features and predicted categories of multimedia resources, an interpretability analysis is performed on a target model to obtain multiple contribution degrees of the multiple local features, the predicted category is obtained based on the prediction of the multimedia resource by the target model, the target model is used to predict the category of the input multimedia resource, and the contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category; Based on the multiple local features and the predicted categories, a key path analysis is performed on the target model to obtain multiple feature paths of the multiple local features, wherein a starting point of a feature path of a local feature is used to represent the local feature, an end point is used to represent the predicted category, and the feature path is used to represent a processing process of obtaining the predicted category based on the local feature; Based on the multiple contribution degrees and the multiple feature paths, model explanation information of the target model is generated, and the model explanation information is used to explain the process of the target model obtaining the predicted category based on the multimedia resource.
2. The method according to claim 1, characterized in that The method of performing an interpretability analysis on the target model based on the multiple local features and the predicted categories of the multimedia resources to obtain multiple contribution degrees of the multiple local features includes: Based on the prediction model, feature importance analysis is performed on the multiple local features to obtain multiple importances of the multiple local features, the prediction model is used to predict the importance of the local features to the prediction category, and the importance of a local feature is used to indicate the importance of the local feature to the prediction category; Based on the interpretable model, the multiple local features are processed to obtain multiple interpretability degrees of the multiple local features, wherein the interpretable model is used to determine the interpretability degree of the local features, and the interpretability degree of a local feature is used to indicate the interpretability degree of the local feature; Based on the multiple local features and the predicted category, extracting rules from the target model, and determining multiple confidences of the multiple rules based on the extracted multiple rules, wherein the multiple rules correspond to the multiple local features one by one, the rules are used to indicate that the category of the multimedia resource including the local features is determined as the predicted category, and the confidence of a rule is used to indicate the credibility of the rule; For any local feature, a weighted sum is performed on the importance and interpretability of the local feature and the confidence of the rule of the local feature to obtain the contribution of the local feature.
3. The method according to claim 2, characterized in that The prediction model includes a plurality of decision trees; The step of performing feature importance analysis on the multiple local features based on the prediction model to obtain multiple importances of the multiple local features includes: For any local feature among the multiple local features, based on the prediction model, perform feature importance analysis on the local feature to obtain the importance of the local feature in each decision tree; The average value of the importance of the local feature in each decision tree is determined as the importance of the local feature.
4. The method according to claim 2, characterized in that: The extracting rules from the target model based on the multiple local features and the predicted category, and determining multiple confidences of the multiple rules based on the extracted multiple rules, includes: extracting the plurality of rules from a rule set of the target model based on the plurality of local features and the predicted category; For any rule, the confidence of the rule is determined based on the membership of the local feature corresponding to the rule, where the membership is used to indicate the degree of membership of the local feature to the multimedia resource, and the membership is positively correlated with the confidence.
5. The method according to claim 2, characterized in that: The method further comprises: Performing multiple random sampling on the multiple local features to obtain multiple disturbance multimedia resources, wherein the disturbance multimedia resources include at least one local feature; For any disturbance multimedia resource, based on the target model, predict the disturbance multimedia resource to obtain a first prediction category of the disturbance multimedia resource; The interpretable model is trained based on the plurality of first predicted categories of the plurality of perturbed multimedia resources and the plurality of perturbed multimedia resources.
6. The method according to claim 5, characterized in that The training of the interpretable model based on the plurality of first predicted categories of the plurality of perturbed multimedia resources and the plurality of perturbed multimedia resources comprises: For any disturbance multimedia resource, based on the interpretable model, predict the disturbance multimedia resource to obtain a second prediction category of the disturbance multimedia resource; Determining a training loss of the interpretable model based on the first predicted category of the perturbed multimedia resource and the second predicted category of the perturbed multimedia resource, the training loss being used to indicate a difference between the first predicted category and the second predicted category; Based on the training loss, model parameters of the interpretable model are updated.
7. The method according to claim 1, characterized in that The step of performing a key path analysis on the target model based on the multiple local features and the predicted categories to obtain multiple feature paths of the multiple local features includes: For any local feature among the multiple local features, construct an initial feature path of the local feature, where a starting point of the initial feature path is used to represent the local feature, and an end point of the initial feature path is used to represent the predicted category; Performing a relaxation operation on the initial feature path to obtain a feature path of the local feature; In the case where a negative loop exists in the feature path, the initial feature path is relaxed again to obtain an updated feature path of the local feature.
8. A device for generating model explanation information, characterized in that: The device comprises: A first analysis module is used to perform an interpretability analysis on a target model based on a plurality of local features and a predicted category of a multimedia resource to obtain a plurality of contribution degrees of the plurality of local features, wherein the predicted category is obtained based on the prediction of the multimedia resource by the target model, the target model is used to predict the category of an input multimedia resource, and the contribution degree of a local feature is used to indicate the contribution degree of the local feature to the predicted category; A second analysis module is used to perform a key path analysis on the target model based on the multiple local features and the predicted category to obtain multiple feature paths of the multiple local features, wherein a starting point of a feature path of a local feature is used to represent the local feature, an end point is used to represent the predicted category, and the feature path is used to represent a processing process of obtaining the predicted category based on the local feature; A generation module is used to generate model explanation information of the target model based on the multiple contribution degrees and the multiple feature paths, wherein the model explanation information is used to explain the process of the target model obtaining the predicted category based on the multimedia resource.
9. A computer device, characterized in that: The computer device includes a processor and a memory, the memory is used to store at least one computer program, and the at least one computer program is loaded by the processor and executes the method for generating model interpretation information as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store at least one computer program, and the at least one computer program is used to execute the method for generating model interpretation information according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating model explanation information according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Reasoning model explanation method, reasoning model training method, and reasoning task processing method
WO2026179505A1
