Model interpretation information generation method and apparatus, computer device, and storage medium
By generating model explanation information, based on the local features and target categories of complex machine learning models, the problem of opaque model explanations is solved, the credibility and reliability of the model are improved, and the explanation needs of complex models are met.
Patent Information
- Application Number
- PCT/CN2024/079817
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-23
- Filing Date
- 2024-03-04
- Publication Date
- 2024-10-31
AI Technical Summary
The black-box characteristics of complex machine learning models lead to opacity in the decision-making process and decision-making basis, reducing the reliability of the model. Existing technology is difficult to provide detailed model explanations and cannot meet the needs of complex models.
By determining feature parameters and paths based on local features and target categories of multimedia resources, model explanation information is generated, the decision-making process and basis of the model are explained, and the credibility and reliability of the model are improved.
It provides a detailed explanation of the decision-making process and basis of complex machine learning models, improves the credibility and reliability of the model, and meets the interpretation needs of complex models.
Smart Images

Figure CN2024079817_31102024_PF_FP_ABST
Abstract
Description
Method, device, computer equipment and storage medium for generating model interpretation information
[0001] This application claims priority to Chinese patent application number 202310446624.5, filed on April 23, 2023, entitled “Method, device, computer equipment and storage medium for generating model interpretation information”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for generating model interpretation information. Background Art
[0003] With the development of computer technology, the application of machine learning models is becoming more and more widespread. For example, in the financial field, financial product marketing models output user credit scores, marketing success probability, etc. based on input user information.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for generating model interpretation information, which can generate accurate and detailed model interpretation information and improve the credibility and reliability of model interpretation. The technical solution is as follows:
[0006] In one aspect, a method for generating model explanation information is provided, the method comprising:
[0007] Determining, based on a plurality of local features of a multimedia resource and a target category, a first parameter of each of the plurality of local features, wherein the target category is predicted for the multimedia resource based on a first model, the first model being used to predict the category of an input multimedia resource, and the first parameter of a local feature being used to indicate a contribution of the local feature to the target category;
[0008] Determining, based on the multiple local features and the target category, paths for each of the multiple local features, wherein a starting point of a path of the local feature represents the local feature, an end point represents the target category, and the path represents a process of obtaining the target category based on the local feature;
[0009] Based on the first parameters and paths of each of the multiple local features, model interpretation information of the first model is generated, where the model interpretation information is used to explain a process in which the first model obtains the target 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 determination module, configured to determine a first parameter of each of the plurality of local features based on a plurality of local features of the multimedia resource and a target category, wherein the target category is predicted for the multimedia resource based on a first model, the first model being configured to predict the category of an input multimedia resource, and the first parameter of each local feature being configured to indicate a contribution of the local feature to the target category;
[0012] a second determining module, configured to determine, based on the multiple local features and the target category, paths of the multiple local features, wherein a starting point of a path of the local feature represents the local feature, an end point represents the target category, and the path represents a process of obtaining the target category based on the local feature;
[0013] The first generation module is used to generate model interpretation information of the first model based on the first parameters and paths of each of the multiple local features, and the model interpretation information is used to explain the process of the first model obtaining the target category based on the multimedia resource.
[0014] 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.
[0015] 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 the method for generating model interpretation information as in the embodiment of the present application.
[0016] On the other hand, a computer program product is provided, including a computer program, which is executed by a processor to implement the method for generating model interpretation information provided in the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0018] FIG1 is a schematic diagram of an implementation environment of a method for generating model explanation information according to an embodiment of the present application;
[0019] FIG2 is a flow chart of a method for generating model explanation information according to an embodiment of the present application;
[0020] FIG3 is a flowchart of another method for generating model explanation information according to an embodiment of the present application;
[0021] FIG4 is a block diagram of a device for generating model explanation information according to an embodiment of the present application;
[0022] FIG5 is a block diagram of another device for generating model explanation information according to an embodiment of the present application;
[0023] FIG6 is a structural block diagram of a terminal provided according to an embodiment of the present application;
[0024] FIG7 is a schematic diagram of the structure of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0026] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with substantially 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 the quantity and execution order.
[0027] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.
[0028] 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, storage, display, 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 the relevant laws, regulations, and standards of the relevant countries and regions. For example, the multimedia resources involved in this application are obtained with full authorization.
[0029] Due to the black-box nature of complex machine learning models, to users, the model simply returns a decision based on the input, but the decision-making process and rationale are opaque to the user, reducing the reliability of the machine learning model. Therefore, how to explain the decision-making process and rationale of machine learning models to improve their reliability is a technical problem that needs to be solved.
[0030] In related technologies, in order to understand the decision-making process and decision-making basis of a machine learning model, it is possible to approximate the predictions of a black-box model (complex machine learning model) by training an interpretable model (such as a linear regression model, decision tree model, or logistic regression model). First, the trained black-box model is used to make predictions on the dataset. Then, an interpretable model is trained based on the dataset and the prediction results of the black-box model. This allows the trained interpretable model to explain the decision-making process and decision-making basis of the black-box model.
[0031] However, the above solution can only provide relatively simple model explanations, which is difficult to meet the needs of complex machine learning models, resulting in low reliability of complex machine learning models.
[0032] The following explains the terms used in this application.
[0033] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0034] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and smart transportation.
[0035] Machine Learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.
[0036] Explainability: refers to the ability of the output of a machine learning model to be understood and explained, allowing humans to understand what the model is doing and how it makes predictions.
[0037] 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.
[0038] The method for generating model interpretation information provided in an embodiment of the present application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. Below, taking the computer device as a server as an example, the implementation environment of the method for generating model interpretation information provided in an embodiment of the present application is introduced. Figure 1 is a schematic diagram of the implementation environment of a method for generating model interpretation information provided according to an embodiment of the present application. Referring to 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, and this application does not limit this.
[0039] 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 to this. The terminal 101 is installed with an application that can display the model interpretation information of the first model. Optionally, the application is a social application, a financial application, an information application, etc., which is not limited in this embodiment of the present application. Illustratively, the application is a financial application, and the first 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.
[0040] In some embodiments, server 102 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be 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 collection of the above-mentioned content items. 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 the application.
[0041] 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.
[0042] FIG2 is a flow chart of a method for generating model explanation information according to an embodiment of the present application. As shown in FIG2 , the method is described in the embodiment of the present application by taking the server as an example. The method for generating model explanation information includes the following steps:
[0043] 201. The server determines the first parameters of each of the multiple local features based on the multiple local features and target categories of the multimedia resource. The target category is predicted based on the first model for the multimedia resource. The first model is used to predict the category of the input multimedia resource. The first parameter of a local feature is used to indicate the contribution degree of the local feature to the target category.
[0044] In an embodiment of the present application, the multimedia resources are text, images, videos, audio, etc., which are not limited in this embodiment of the present application. For example, when the multimedia resource is an image, the first model is an image recognition model, which is used to predict the category of the input image. Optionally, the category of the image includes an animal category, a plant category, a building category, etc. When the multimedia resource is a video, the first model is a video recognition model, which can be used to predict the category of the input video. Optionally, the category of the video includes a game category, a sports category, a landscape category, etc. The server performs an interpretability analysis on the first model based on multiple local features and the target category of the multimedia resource, and can obtain the first parameters of each of the multiple local features of the multimedia resource. The first parameter is used to indicate the contribution of the local feature to the target category. The category predicted by the first model is the target category because it is influenced by the local feature, and the first parameter of the local feature indicates the magnitude of the influence of the local feature. The larger the first parameter, the greater the contribution of the local feature to the target category, that is, the greater the influence of the local feature when the first model obtains the target category. Therefore, by analyzing the first parameters of multiple local features, it can be determined that the local feature with a larger first parameter is the feature on which the first model relies when obtaining the target category based on multimedia resources, and the local feature with a smaller first parameter is not the local feature on which the first model relies when obtaining the target category based on multimedia resources, thereby helping users understand the decision basis of the first model to obtain the target category.
[0045] In the embodiment of the present application, since the first parameter is used to indicate the contribution of the local feature to the target category, the first parameter can also be called "interpretability." The processing process of step 201 can be called "interpretability analysis of the first model."
[0046] 202. The server determines paths of the plurality of local features based on the plurality of local features and the target category. The starting point of the path of a local feature is used to represent the local feature, and the end point is used to represent the target category. The path is used to represent the processing process of obtaining the target category based on the local feature.
[0047] In an embodiment of the present application, since the first model can output the target category of the multimedia resource based on the input multimedia resource, the server can determine the paths of the multiple local features based on the multiple local features and the target category of the multimedia resource. Each path includes multiple nodes, the starting point of the path is used to represent the local feature of the multimedia resource, and the end point is used to represent the target category of the multimedia resource. Based on the connection relationship between the multiple nodes in the path, the server can determine the processing process of obtaining the target category represented by the end point based on the local feature represented by the starting point.
[0048] Among them, since the path is a path from the local feature to the target category, the path also represents that the first model uses the local feature to process and obtain the target category, so the path can represent the processing process of obtaining the target category based on the local feature.
[0049] Optionally, the path is a path in the feature space, and there are multiple nodes in the feature space, each node represents a feature, and the multiple features represented by the multiple nodes include multiple local features and features of multiple categories. Accordingly, the path of each local feature refers to a path starting from the node representing the local feature, passing through multiple intermediate nodes, and reaching the node representing the feature of the target category. Among them, the multiple intermediate nodes are intermediate variables obtained by the first model processing the local features. Optionally, when the server determines the path of the local feature, it first determines two nodes representing the local feature and the target category respectively, and then determines the node between the two nodes to determine the path of the local feature.
[0050] The feature space is an arbitrary feature space created by the server, and any local feature or any category can be mapped into the feature space, thereby obtaining the features of any local feature or the features of any category.
[0051] In the embodiment of the present application, since the path is a path in the feature space, the path can be referred to as a “feature path.” The processing of step 202 can be referred to as “critical path analysis of the first model.”
[0052] 203. The server generates model interpretation information of the first model based on the first parameters and paths of the plurality of local features, where the model interpretation information is used to explain a process of the first model obtaining a target category based on multimedia resources.
[0053] In an embodiment of the present application, based on multiple first parameters, it is possible to know the contribution of multiple local features to the first model in obtaining the target category, and then it is possible to know which local features the first model uses to determine the target category, and because multiple paths represent the processing process of the first model in obtaining the target category based on multiple local features. Therefore, the server can generate model interpretation information of the first model based on the first parameters and paths of each of the multiple local features. Optionally, the model interpretation information is in the form of a table, text, picture, etc., which is not limited in the embodiment of the present application. By generating the model interpretation information of the first model, the server can explain the process of the first model obtaining the target category based on multimedia resources, thereby helping users better understand the decision-making process of the first model and improving the credibility and reliability of the model interpretation.
[0054] The larger the first parameter of a local feature, the more likely the first model determines the target category based on that local feature. The shorter the path of a local feature, the more likely the first model determines the target category based on the processing process represented by that path. Therefore, based on the magnitudes of the first parameters of multiple local features and the lengths of their paths, local features with larger first parameters and / or shorter paths can be selected to generate model interpretation information.
[0055] Optionally, the model explanation information includes one or more target local features, where the one or more target local features are local features selected from multiple local features of the multimedia resource, thereby explaining that the first model obtains the target category based on these target local features.
[0056] In one implementation, multiple local features of the multimedia resource are arranged in descending order according to the first parameter, and the first N local features are selected as target local features, and / or, multiple local features of the multimedia resource are arranged in descending order according to the length of the path, and the first N local features are selected as target local features, where N is a positive integer greater than 1.
[0057] In another implementation, if there is a local feature with the largest first parameter and the shortest path among the multiple local features of the multimedia resource, the local feature is used as the target local feature.
[0058] In another implementation, the model interpretation information includes first parameters and paths for each of the multiple local features. By comparing the magnitudes of the first parameters of the multiple local features in the model interpretation information, it is possible to determine which local features contribute significantly to the determination of the target class. By comparing the lengths of the paths of the multiple local features in the model interpretation information, it is possible to determine which local features contribute more simply to the determination of the target class.
[0059] The embodiment of the present application provides a method for generating model interpretation information, which determines the first parameters and paths of the multiple local features based on the multiple local features and target categories of the multimedia resources. Due to the contribution of the multiple local features indicated by the multiple first parameters to the target category, the relationship between the multiple local features and the target category can be determined. Based on the path, the processing process of obtaining the target category based on the local features can be understood. In this way, based on the information of the multiple dimensions of the multiple local features, the model interpretation information of the first model is generated. Based on the model interpretation information, the process of obtaining the target category based on the multimedia resource by the first model can be accurately and detailedly explained, thereby improving the credibility and reliability of the model interpretation.
[0060] FIG3 is a flowchart of another method for generating model explanation information according to an embodiment of the present application. As shown in FIG3 , the method is described in the embodiment of the present application by taking the execution by the server as an example. The method for generating model explanation information includes the following steps:
[0061] 301. The server determines the second parameters of each of the multiple local features based on the second model. The second model is used to predict the second parameters of the local features. The second parameter of a local feature is used to indicate the importance of the local feature to the target category. The target category is predicted based on the multimedia resource using the first model. The first model is used to predict the category of the input multimedia resource.
[0062] In the embodiment of the present application, the multimedia resource is text, image, video, audio, etc., and the embodiment of the present application is not limited to this. The server predicts the multimedia resource based on the first model and can obtain the target category of the multimedia resource. Taking the multimedia resource as an image as an example, the target category of the image may be an animal category, a plant category, a building category, etc. The second model is a machine learning model obtained by training based on multiple sample multimedia resources. The second model can not only predict the category of the input multimedia resource, but also predict the second parameters of multiple local features of the multimedia resource during the prediction process. Therefore, the server predicts multiple local features based on the second model and can obtain the second parameters of each of the multiple local features. The server can determine the importance of multiple local features to the target category based on the multiple second parameters output by the second model. The larger the second parameter, the greater the importance of the local feature to the target category, and the closer the relationship between the local feature and the target category, which means that the first model is more affected by the local feature when obtaining the target category.
[0063] In some embodiments, the first model is a CNN (Convolutional Neural Network) model, which includes convolutional layers, pooling layers, and fully connected layers. Taking multimedia resources as images as an example, when extracting 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 computational efficiency. Finally, the output of the pooling layer is used as the input of the fully connected layer, and tasks such as classification or regression are performed through the fully connected layer. The CNN model adopts an end-to-end training method, and optionally, the model parameters are optimized through a backpropagation algorithm to improve the accuracy and efficiency of the model. The server adopts the CNN model as the first model. Since the CNN model can extract features of multimedia resources in the process of predicting categories, the first model can automatically extract useful local features from the multimedia resources, thereby improving the accuracy and efficiency of the first model.
[0064] In some embodiments, the server performs a convolution operation on the input image using the following formula 1. The server expresses the activation function of the first model using the following formula 2. The server performs a pooling operation on the feature map output by the convolution layer using the following formula 3.
[0065] Formula 1:
[0066] Among them, I(i+m,j+n) represents the pixel value of the pixel with horizontal coordinate i+m and vertical coordinate j+n in the input image, K represents the convolution kernel, S(i,j) represents the convolution result of the pixel with horizontal coordinate i and vertical coordinate j; m represents the height of the convolution kernel K, n represents the width of the convolution kernel K, and i, j, m, and n are all positive integers.
[0067] Formula 2:
[0068] Among them, w ij represents the weight between the i-th neuron and the j-th neuron in the first model, 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, f represents the activation function, y i Represents the output value of the activation function of the i-th neuron in the first model.
[0069] Formula 3:
[0070] Among them, x p,q represents the pixel value of the pixel point (p,q) on the input feature map, R(i,j) represents the receptive field of the pixel point (i,j), and y i,j Represents the pooling result of pixel (i, j).
[0071] In some embodiments, the first model is obtained by training based on multiple sample multimedia resources. Before training the first model, the server can pre-process the multiple sample multimedia resources. First, the server cleans the multiple sample multimedia resources, and can remove sample multimedia resources with abnormal conditions such as noise and missing values from the multiple sample multimedia resources to improve the quality and accuracy of the training data of the first model. The server then normalizes the multiple sample multimedia resources after 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 normalizes the multiple sample multimedia resources through the following formula four or the following formula five, and takes the sample multimedia resources as images as an example for explanation.
[0072] Formula 4:
[0073] Formula 5:
[0074] Where x represents the pixel value of any pixel in the image; x′ represents the pixel value of any pixel after normalization; min represents the minimum pixel value of multiple pixels in the image; max represents the maximum pixel value of multiple pixels in the image; μ represents the mean pixel value of all pixels in the image; σ represents the standard deviation of the pixel values of all pixels in the image.
[0075] The server inputs the multimedia resource into the first model, thereby obtaining not only the target category of the multimedia resource but also a plurality of local features of the multimedia resource. Optionally, each of the plurality of local features is a vector.
[0076] In some embodiments, the second model includes multiple decision trees. The server inputs multiple local features of the multimedia resource into the second model. The second model not only predicts the target category of the multimedia resource but also, based on the multiple decision trees, obtains second parameters for each of the multiple local features. These second parameters represent the importance of the local feature to the predicted target category. For any local feature, the server determines the second parameter of the local feature based on the second parameters of the local feature in the multiple decision trees. Accordingly, for any local feature among the multiple local features, the server determines the second parameter of the local feature in each decision tree based on the second model; the average value of the second parameters of the local feature in each decision tree is determined as the second parameter of the local feature. The second model includes multiple independent decision trees. For any decision tree, the server inputs the multiple local features into the decision tree and obtains the second parameters of the multiple local features in the decision tree. Therefore, based on the multiple decision trees of the second model, the server obtains the second parameter of the local feature in each decision tree, i.e., the importance of the local feature to the target category in each decision tree of the second model. The server determines the second parameter of the local feature as the average value of the second parameters of the local feature in the multiple decision trees. In this embodiment, the second parameters of the local feature in multiple decision trees are integrated to obtain the second parameter of the local feature, thereby improving the accuracy of the second parameter of the local feature.
[0077] Optionally, the second model is trained based on multiple sample multimedia resources and the target categories of each of the multiple sample multimedia resources. The target categories of each of the multiple sample multimedia resources are predicted based on the first model. In this way, the second model is trained with the category predicted by the first model as the target, and then a second model that is approximate to the first model is obtained, so that the category predicted by the second model is the same as the category predicted by the first model.
[0078] In some embodiments, the second model is a random forest model, and the server can determine the second parameters of each of the multiple local features through the following formula six.
[0079] Formula 6:
[0080] Among them, FI j represents the second parameter of the jth local feature; T represents the decision tree set, T t represents the t-th decision tree; I(j∈T t ) represents the second parameter of the j-th local feature in the t-th decision tree; p(t) represents the sample ratio of the t-th decision tree, and t is a positive integer greater than 1.
[0081] In some embodiments, the second model is a gradient boosting tree model, and the server can determine the second parameters of each of the multiple local features through the following formula seven.
[0082] Formula 7:
[0083] Among them, FI j represents the second parameter of the jth local feature; T represents the decision tree set, T t represents the t-th decision tree; L t represents the loss function of the t-th decision tree; p(j∈T t ) represents the second parameter of the jth local feature in the tth decision tree, p(k∈T t ) represents the second parameter of the k-th feature in the t-th decision tree.
[0084] In this embodiment of the present application, since the second model is used to predict the category and the second parameter, the second model can also be referred to as a "prediction model." Since the second parameter is used to indicate the importance of the local feature to the target category, the second parameter can also be referred to as "importance." The processing of step 301 can be referred to as "performing importance analysis on multiple local features."
[0085] 302. The server generates multiple reference resources based on the multiple local features, where each reference resource includes at least one local feature among the multiple local features.
[0086] The server randomly samples the multiple local features multiple times, obtaining at least one local feature each time. For each sampling, a multimedia resource including the at least one local feature is generated and used as a reference resource. In addition to the at least one local feature, the reference resource may or may not include other features. Because the reference resource may share the same local features with the original multimedia resource or may have different local features, the reference resource can serve as a reference.
[0087] In an embodiment of the present application, during 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 generates a reference resource based on the at least one local feature obtained by sampling. The reference resource is similar to the multimedia resource, and the more local features the reference resource includes, the higher the degree of similarity to the multimedia resource. By performing multiple random samplings on the multiple local features, the server can obtain multiple reference resources similar to the multimedia resource. Optionally, the server randomly samples the multiple local features using a Gaussian distribution, a uniform distribution, or the like.
[0088] The reference resource is a multimedia resource that is adjusted based on the original multimedia resource, and therefore can also be called a "disturbance multimedia resource."
[0089] 303. For any reference resource, the server determines a first target category of the reference resource based on the first model.
[0090] In an embodiment of the present application, the first model is used to predict the category of the input multimedia resource. Based on the first model, the server can determine the first target category of each reference resource. That is, for any reference resource, the reference resource is input into the first model, and the first model outputs the category of the reference resource, which is called the first target category.
[0091] 304. The server trains a third model based on the first target categories of the multiple reference resources and the multiple reference resources. The third model is used to generate third parameters of the multiple local features of the multimedia resource in the process of predicting the category of the multimedia resource. The third parameter of a local feature is used to indicate the interpretability of the local feature.
[0092] In an embodiment of the present application, the third model is a machine learning model with a simple structure, such as a decision tree model, a linear model, etc. In order to train a third model with similar performance to the first model, the server can use the first target category predicted by the first model as the label information of the reference resource, and then train the third model based on multiple reference resources and the label information of multiple reference resources. The third model and the first model are both models used to predict the category of multimedia resources. Since the first target category is predicted by the first model and participates in the training of the third model, the trained third model is a model that is similar to the first model.
[0093] The server determines the third parameters of each of the multiple local features through the trained third model, and can interpret the target category obtained by the first model based on the multiple local features, thereby constructing the relationship between the multiple local features and the target category.
[0094] In some embodiments, the server can train a third model based on the first target category predicted by the first model for the reference resource and the second target category predicted by the third model for the reference resource. Accordingly, for any reference resource, the server determines the second target category of the reference resource based on the third model; determines the training loss of the third model based on the first target category of the reference resource and the second target category of the reference resource, where the training loss is used to indicate the difference between the first target category and the second target category; and updates the model parameters of the third model based on the training loss. The third model can predict the category of the input multimedia resource, and the server can predict the input reference resource based on the third model to obtain the second target category of the reference resource. Since the first target category is the label information of the reference resource, which is used to indicate the true category of the reference resource, the server can determine the training loss of the third model based on the second target category and the first target category. The training loss is positively correlated with the accuracy of the third model. The smaller the training loss, the smaller the difference between the first target category and the second target category, the higher the similarity between the first model and the third model, and the higher the accuracy of the third model. In this embodiment, the third model is trained based on the difference between the category predicted by the first model and the category predicted by the third model, so that the result predicted by the third model gradually approaches the result predicted by the first model, and then the trained third model can obtain the same prediction result as the first model, so that the third parameters of the multiple local features obtained by the third model are highly accurate.
[0095] In some embodiments, as shown in Formula 8, the third model is a linear model with L1 regularization.
[0096] Formula 8:
[0097] Where g(x′) represents the third model; L represents the loss function of the third model; f represents the first 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 degree of similarity between the reference resource and the multimedia resource.
[0098] In the embodiment of the present application, the process of training the third model is implemented through the above steps 302-304. In this embodiment, since multiple reference resources are generated based on multiple local features of the multimedia resource, the reference resources are similar to the multimedia resource, and since the trained third model and the first model are both used to predict categories, the third model is a model similar to the first model. In this way, the category of the multimedia resource can be accurately predicted based on the third model, so that the third parameter of the local features generated by the third model during the category prediction process is highly accurate.
[0099] In the embodiment of the present application, since the third parameter is used to indicate the degree of interpretability of the local feature, the third parameter can also be referred to as "interpretability." Since the third model is used to predict the third parameter, the third model can also be referred to as an "interpretable model."
[0100] 305. The server determines a third parameter of each of the multiple local features based on the third model. The third parameter of a local feature is used to indicate the interpretability of the local feature.
[0101] In an embodiment of the present application, the third model after training is partially similar to the first model, and the third model can explain the processing process and processing basis of the first model to obtain the target category based on the multimedia resource. Therefore, based on the third model after training, the server can process multiple local features of the multimedia resource and obtain the third parameters of each of the multiple local features. Among them, the third parameter is used to indicate the degree of interpretability of the local feature. The larger the third parameter 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 first model to obtain the target category based on the local feature with a higher degree of interpretability, which can improve the interpretability of the first model.
[0102] In some embodiments, the server inputs the multiple local features into the third model, and the third model generates third parameters of the multiple local features in the process of predicting the category of the multimedia resource based on the multiple local features.
[0103] 306. The server determines rules for multiple local features based on the multiple local features and the target category, and determines a fourth parameter of each rule based on the rules for the multiple local features. The rule is used to determine the category of the multimedia resource including the local feature as the target category. The fourth parameter of a rule is used to indicate the credibility of the rule.
[0104] In an embodiment of the present application, the server can generate multiple interpretable rules that correspond one-to-one to the multiple local features of a multimedia resource based on the multiple local features and the target category. Optionally, each rule includes a conditional portion and a conclusion portion, typically expressed in an "if-then" format. The conditional portion is "if the multimedia resource includes a certain local feature," and the conclusion portion is "then the category of the multimedia resource is the target category." Taking a facial image as an example, where the target category of the facial image is "happy," the rule of the first model may be "if the facial image includes the local feature of raised corners of the mouth, then the category of the facial image is happy." The server can determine whether the first model's classification of the facial image including the local feature of "raised corners of the mouth" as "happy" is correct based on the credibility of the rule. The server determines the fourth parameter of the rule. The larger the fourth parameter, the more likely it is that the category of the multimedia resource corresponding to the local feature of the rule is accurately determined to be the target category; the smaller the fourth parameter, the more likely it is that the category of the multimedia resource corresponding to the local feature of the rule is inaccurate. By extracting rules from the first model, the server can convert the first model into a set of interpretable rules so that users can better understand the decision-making process of the first model in obtaining the target category, thereby improving the reliability of the first model.
[0105] Among them, the fourth parameter of the rule of each local feature indicates the credibility of the rule, that is, it indicates the credibility of the rule in this category prediction process, that is, it indicates whether the rule is reliable in this prediction process, that is, it indicates whether the prediction result obtained using the rule is accurate.
[0106] In some embodiments, the server can determine the fourth parameter of a rule based on the fifth parameter of the local feature corresponding to the rule. Accordingly, the server extracts multiple rules from the rule set of the first model based on multiple local features and target categories. For each rule, the server determines the fourth parameter of the rule based on the fifth parameter of the local feature corresponding to the rule. The fifth parameter indicates the degree of affiliation of the local feature with the multimedia resource, and the fourth parameter is positively correlated with the fifth parameter. The server can extract multiple rules from the rule set of the first model based on the multiple local features and target categories. Each rule includes a conditional portion and a conclusion portion. The conditional portion includes the local feature of the multimedia resource, and the conclusion portion includes the target category of the multimedia resource for the first model. By determining the fifth parameter of the local feature in the conditional portion, the server can determine the degree of affiliation of the local feature with the multimedia resource, that is, the degree of association between the local feature and the multimedia resource, such as indicating the proportion of the local feature in the multimedia resource. After obtaining the fifth parameter, the server determines a parameter that is positively correlated with the fifth parameter as the fourth parameter. For example, the fifth parameter may be used as the fourth parameter, or the product of the fifth parameter and a preset proportion may be used as the fourth parameter. In this embodiment, by determining the rules of each of the multiple local features, the first model is converted into multiple rules corresponding one-to-one to the multiple local features, which facilitates the interpretation and analysis of the first model; and the fourth parameter is determined based on the fifth parameter of each rule. Since the fifth parameter represents the degree of affiliation of the local feature to the multimedia resource, the determined fourth parameter has high accuracy.
[0107] In the embodiment of the present application, since the fourth parameter represents the credibility of the rule, the fourth parameter can also be called "confidence". Since the fifth parameter represents the degree of membership of the local feature to the multimedia resource, the fifth parameter can also be called "membership".
[0108] 307. For any local feature, the server performs a weighted summation on the second parameter, the third parameter, and the fourth parameter corresponding to the local feature to obtain a first parameter of the local feature, where the first parameter is used to indicate the contribution of the local feature to the target category.
[0109] In an embodiment of the present application, the second parameter is used to indicate the importance of the local feature to the target category, the third parameter is used to indicate the interpretability of the local feature, and the fourth parameter of the rule is used to indicate the credibility of the rule, that is, the credibility of determining the category of the multimedia resource including the local feature corresponding to the rule as the target category. For any local feature, the server can obtain the first parameter of the local feature by weighted summing the second parameter, the third parameter and the fourth parameter of the rule of the local feature. The server analyzes multiple first parameters of multiple local features and can determine the local features on which the first model obtains the target category based on the multimedia resource.
[0110] The larger the first parameter, the greater the contribution of the local feature to the target category, meaning that the first model is more influenced by the local feature when obtaining the target category. Therefore, by analyzing the first parameters of multiple local features, it can be determined that the local feature with a larger first parameter is the feature that the first model uses to obtain the target category based on the multimedia resource, while the local feature with a smaller first parameter is not the local feature that the first model uses to obtain the target category based on the multimedia resource. This helps users understand the decision basis for the first model to obtain the target category.
[0111] In the embodiment of the present application, the above steps 301, 305-307 are used to implement a process of determining the first parameters of multiple local features based on multiple local features and target categories of multimedia resources. Since the second parameter represents the importance of the local feature to the target category, the third parameter represents the interpretability of the local feature, and the fourth parameter represents the credibility of the rules of the local feature. Among them, the importance can be regarded as a basic contribution of the local feature to the prediction result. On this basis, combined with the interpretability of the local feature and the credibility of the rule, the integration of the interpretation information of multiple dimensions is achieved, and the contribution degree obtained is more accurate.
[0112] 308. For any local feature among the multiple local features, the server constructs an initial path of the local feature, where the starting point of the initial path is used to represent the local feature, and the end point of the initial path is used to represent the target category.
[0113] In an embodiment of the present application, for any local feature, the server can determine the initial path of the local feature based on the local feature and the target category. The initial path includes multiple nodes, and adjacent nodes among the multiple nodes are connected by edges. For any node, the adjacent node of the node is the node closest to the node among the multiple nodes. The server can set initial values for the multiple nodes by initializing the multiple nodes in the initial path. For any node other than the starting point, the initial value of the node represents the distance from the starting point of the initial path to the node. Among them, the initial value of the starting point is 0, and the initial values of other nodes are infinity.
[0114] 309. The server performs a relaxation operation on the initial path to obtain a path of local features, where the path is used to represent a process of obtaining a target category based on the local features.
[0115] Optionally, during the relaxation operation on the initial path, the server can relax all edges connecting nodes in the initial path. For an edge connecting node u and node v in the initial path, if the sum of the initial value of node u and the edge weight 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 edge weight. If the sum of the initial value of node u and the edge weight is not less than the initial value of node v, the server does not change the initial value of node v. After performing the above-mentioned processing on all edges in the initial path, the server can obtain a path of local features. The end point and starting point of this path are consistent with those of the initial path. This path represents the process by which the first model obtains the target category based on the local features. The length of this path can be used to reflect the complexity of the process by which the first model obtains the target category based on the local features. The longer the path, the more complex the process by which the first model obtains the target category based on the local features represented by the starting point of the path, after a series of processing. In other words, the probability that the first model will determine the category of the multimedia resource containing the local features as the target category is lower. By analyzing the paths of multiple local features, the server can understand the processing process of the first model to obtain the prediction type based on different local features, and through the lengths of multiple paths, it can determine the complexity of the multiple processing processes for obtaining the target category based on multiple local features, so that the path with the shortest length and the simplest processing process can be determined as the most critical path in the first model, so as to further optimize the internal processing process of the first model. Among them, the shorter the length of the local feature path, the simpler the processing process for obtaining the target category based on the local feature. Since the first model generally obtains the target category based on the simplest processing process, the probability of the first model obtaining the target category based on the local feature is greater.
[0116] In an embodiment of the present application, the path of the local feature is a path that does not have a negative loop. In some embodiments, the process of the server performing a relaxation operation on the initial path to obtain the path of the local feature includes the following steps: the server performs a relaxation operation on the initial path to obtain a first path; if there is no negative loop in the first path, the server uses the first path as the path of the local feature. If there is a negative loop in the first path, the server again performs a relaxation operation on the initial path to obtain a second path; if there is no negative loop in the second path, the server uses the second path as the path of the local feature.
[0117] In an embodiment of the present application, after the server performs a relaxation operation on all edges in the initial path, it is necessary to check the resulting path. For an edge in the path connecting node u and node v, if the sum of the value of node u and the weight of the edge is less than the value of node v, it indicates that there is a negative loop in the path and the path is unusable. At this point, the server can re-relax the initial path of the local feature until there are no negative loops in the resulting path.
[0118] In an embodiment of the present application, there are multiple intermediate nodes between the starting point and the end point of the initial path. Through the relaxation operation, the shortest path between the starting point and the end point can be obtained. The shortest path can represent the processing process of obtaining the target category based on local features, thereby ensuring the accuracy of the path.
[0119] 310. The server generates model interpretation information of the first model based on the first parameters and paths of the plurality of local features. The model interpretation information is used to explain a process of the first model obtaining a target category based on multimedia resources.
[0120] In an embodiment of the present application, the server can determine the probability of the first model obtaining the target category based on any local feature based on the contribution degree of multiple local features indicated by multiple first parameters to the target category. The server can determine the internal processing flow of the first model obtaining the target category based on the local features based on the processing process of the first model represented by multiple paths obtaining the target category based on multiple local features. Therefore, the server can generate model explanation information of the first model based on multiple first parameters and multiple paths. Optionally, the model explanation information is in the form of a table, text, picture, etc., which is not limited by the embodiment of the present application. By generating the model explanation information of the first model, the server can explain the process of the first model obtaining the target category based on multimedia resources, thereby helping users better understand the decision-making process of the first model and improving the credibility and reliability of the first model.
[0121] In some embodiments, the server can also perform accuracy, efficiency, and stability assessments on the first model. For example, the server obtains multiple sample multimedia resources and the categories to which each sample multimedia resource belongs. Using the first model, the server predicts the categories for the multiple sample multimedia resources to evaluate the accuracy, efficiency, and stability of the first model. Accuracy assessment is used to assess the accuracy of the first model's prediction results. Optionally, methods such as cross-validation are used to assess the accuracy of the first model. Efficiency assessment is used to assess the speed and efficiency of the first model's predictions. Optionally, metrics such as the first model's inference time are used to assess the efficiency of the first model. Stability assessment is used to assess the performance stability of the first model across different types of multimedia resources and application scenarios. Optionally, metrics such as the first model's generalization ability are used to assess the stability of the first model. After the assessment, if the first model's performance is poor, the server can optimize the first model using hyperparameter tuning techniques to improve its performance. During hyperparameter tuning of the first model, the hyperparameter range must first be selected. Optionally, hyperparameters include the learning rate, regularization parameter, number of hidden layer nodes, and number of iterations. After determining the hyperparameter range, you need to select a search method to traverse the hyperparameter space. Common search methods include grid search, random search, Bayesian optimization, etc. During the search process, you need to evaluate the impact of each hyperparameter combination on the performance of the first model. Cross-validation and other methods are usually used to evaluate the performance of the first 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 using the following formula 9.
[0122] Formula 9:
[0123] Where L is the loss function for the hyperparameter combination θ; X is the input of the first model; Y is the output of the first model; Θ is the hyperparameter space.
[0124] The embodiment of the present application provides a method for generating model interpretation information, which determines the first parameters and paths of the multiple local features based on multiple local features and target categories of multimedia resources. Due to the contribution of the multiple local features indicated by the multiple first parameters to the prediction type, the relationship between the multiple local features and the target category can be determined. Based on the path, the processing process of obtaining the target category based on the local features can be understood. In this way, based on the information of multiple dimensions of the multiple local features, the model interpretation information of the first model is generated. Based on the model interpretation information, the process of the first model obtaining the target category based on the multimedia resource can be accurately and detailedly explained, thereby improving the credibility and reliability of the model interpretation.
[0125] FIG4 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. Referring to FIG4 , the device includes: a first determination module 401 , a second determination module 402 , and a first generation module 403 .
[0126] A first determination module 401 is configured to determine a first parameter of each of the plurality of local features based on the plurality of local features of the multimedia resource and a target category, wherein the target category is predicted based on a first model for the multimedia resource, the first model being configured to predict the category of the input multimedia resource, and the first parameter of a local feature being configured to indicate a contribution of the local feature to the target category;
[0127] A second determination module 402 is configured to determine paths for each of the plurality of local features based on the plurality of local features and the target category, wherein the starting point of a path of a local feature represents the local feature, the end point represents the target category, and the path represents a process of obtaining the target category based on the local feature;
[0128] The first generating module 403 is used to generate model explanation information of the first model based on the first parameters and paths of the plurality of local features, where the model explanation information is used to explain the process of the first model obtaining the target category based on the multimedia resource.
[0129] In some embodiments, FIG5 is a block diagram of another device for generating model explanation information according to an embodiment of the present application. Referring to FIG5 , the first determination module 401 includes:
[0130] A first determining unit 501 is configured to determine a plurality of second parameters of a plurality of local features based on a second model, wherein the second model is configured to predict the second parameters of the local features, and the second parameter of a local feature is configured to indicate the importance of the local feature to the target class;
[0131] A second determining unit 502 is configured to determine a plurality of third parameters of a plurality of local features based on a third model, wherein the third model is configured to determine the third parameters of the local features, and the third parameter of a local feature is configured to indicate the interpretability of the local feature;
[0132] a third determining unit 503 configured to determine, based on the multiple local features and the target category, rules for each of the multiple local features, and determine a fourth parameter for each rule based on the rules for each of the multiple local features, wherein the rule is configured to determine the category of the multimedia resource including the local feature as the target category, and the fourth parameter of each rule is configured to indicate a degree of credibility of the rule;
[0133] The summing unit 504 is configured to perform a weighted summation of the second parameter and the third parameter of any local feature and the corresponding fourth parameter of the local feature to obtain the first parameter of the local feature.
[0134] In some embodiments, the second model includes a plurality of decision trees;
[0135] The first determining unit 501 is configured to determine, for any local feature among the multiple local features, a second parameter of the local feature in each decision tree based on the second model; and determine an average value of the second parameter of the local feature in each decision tree as the second parameter of the local feature.
[0136] In some embodiments, the third determination unit 503 is used to extract multiple rules from the rule set of the first model based on multiple local features and target categories; for any rule, the fourth parameter of the rule is determined based on the fifth parameter of the local feature corresponding to the rule, the fifth parameter is used to indicate the degree of affiliation of the local feature to the multimedia resource, and the fourth parameter is a parameter positively correlated with the fifth parameter.
[0137] In some embodiments, referring to FIG5 , the apparatus further includes:
[0138] A second generating module 404 is configured to generate a plurality of reference resources based on the plurality of local features, each reference resource including at least one local feature among the plurality of local features;
[0139] A prediction module 405 is configured to determine, for any reference resource, a first target category of the reference resource based on the first model;
[0140] The training module 406 is used to train a third model based on the first target categories of the multiple reference resources and the multiple reference resources. The third model is used to generate third parameters of the multiple local features of the multimedia resource in the process of predicting the category of the multimedia resource.
[0141] In some embodiments, the training module 406 is used to determine, for any reference resource, the second target category of the reference resource based on the third model; determine the training loss of the third model based on the first target category of the reference resource and the second target category of the reference resource, the training loss being used to indicate the difference between the first target category and the second target category; and update the model parameters of the third model based on the training loss.
[0142] In some embodiments, the second determination module 402 is used to construct an initial path of the local feature for any local feature among multiple local features, where the starting point of the initial path is used to represent the local feature, and the end point of the initial path is used to represent the target category; and a relaxation operation is performed on the initial path to obtain the path of the local feature.
[0143] An embodiment of the present application provides a device for generating model interpretation information, which determines the first parameters and paths of each of the multiple local features based on multiple local features and target categories of multimedia resources. Due to the contribution of the multiple local features indicated by the multiple first parameters to the prediction type, the relationship between the multiple local features and the target category can be determined, and the processing process of obtaining the target category based on the local features can be understood based on the path. In this way, based on the information of multiple dimensions of each of the multiple local features, model interpretation information of the first model is generated. Based on the model interpretation information, the process of the first model obtaining the target category based on the multimedia resource can be accurately and detailedly explained, thereby improving the credibility and reliability of the first model.
[0144] It should be noted that the device for generating model interpretation information provided in the above embodiment is merely illustrative of the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal can be 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 are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0145] 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 serves 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 serves 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 do not limit this.
[0146] FIG6 is a structural block diagram of a terminal 600 provided according to an embodiment of the present application.
[0147] Typically, the terminal 600 includes a processor 601 and a memory 602 .
[0148] The processor 601 includes one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 is 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 also includes 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 is 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 also includes an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0149] The memory 602 includes one or more computer-readable storage media, which are non-transitory. The memory 602 also includes high-speed random access memory and non-volatile memory, such as one or more disk storage devices and 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 executed by the processor 601 to implement the method for generating model interpretation information provided in the method embodiment of the present application.
[0150] In some embodiments, terminal 600 may also optionally include a peripheral device interface 603 and at least one peripheral device. Processor 601, memory 602, and peripheral device interface 603 are connected via a bus or signal lines. Each peripheral device is connected to peripheral device interface 603 via a bus, signal lines, or circuit boards. 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.
[0151] The peripheral device interface 603 can be used to connect at least one I / O (Input / Output)-related peripheral device 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 are implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0152] The RF circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. In some embodiments, the RF 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 RF circuit 604 communicates with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 604 also includes circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0153] Display screen 605 is used to display a user interface (UI). This UI includes graphics, text, icons, videos, and any combination thereof. When display screen 605 is a touch screen, it is also capable of collecting touch signals on or above the surface of display screen 605. These touch signals are input as control signals to processor 601 for processing. In this case, display screen 605 is also used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there is a single display screen 605, located on the front panel of terminal 600; in other embodiments, there are at least two display screens 605, located on different surfaces of terminal 600 or in a foldable design; in still other embodiments, display screen 605 is a flexible display screen, located on a curved or foldable surface of terminal 600. Display screen 605 can also be configured as a non-rectangular irregular shape, also known as a special-shaped screen. Display screen 605 is made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0154] 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 arranged on the front panel of the terminal, and the rear camera is arranged 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 panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 also includes a flash. The flash is a single-color 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 is used for light compensation at different color temperatures.
[0155] The audio circuit 607 includes 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 are multiple microphones, which are respectively arranged at different parts of the terminal 600. The microphone can 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 is a traditional thin 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 also includes a headphone jack.
[0156] Power supply 608 is used to power various components in terminal 600. Power supply 608 can be AC power, DC power, a disposable battery, or a rechargeable battery. When 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 charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery is also configured to support fast charging technology.
[0157] 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 .
[0158] The accelerometer 610 detects the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 600. For example, the accelerometer 610 is used to detect the components of gravity acceleration along the three coordinate axes. Based on the gravity acceleration signal collected by the accelerometer 610, the processor 601 controls the display screen 605 to display the user interface in either a landscape or portrait view. The accelerometer 610 is also used to collect game or user motion data.
[0159] The gyroscope sensor 611 detects the orientation and rotation angle of the terminal 600. It works in conjunction with the accelerometer 610 to collect the user's 3D movements of the terminal 600. Based on the data collected by the gyroscope sensor 611, the processor 611 implements the following functions: motion sensing (for example, changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0160] The pressure sensor 612 is provided on the side frame of the terminal 600 and / or below the display screen 605. When the pressure sensor 612 is provided on the side frame of the terminal 600, it detects the user's gripping signal of the terminal 600. The processor 601 then performs left-hand or right-hand identification or shortcut operations based on the gripping signal collected by the pressure sensor 612. When the pressure sensor 612 is provided below the display screen 605, the processor 601 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 605. Operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0161] The optical sensor 613 is used to detect ambient light intensity. In one embodiment, the processor 601 controls the display brightness of the display screen 605 based on the ambient light intensity detected 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 decreased. In another embodiment, the processor 601 also dynamically adjusts the shooting parameters of the camera assembly 606 based on the ambient light intensity detected by the optical sensor 613.
[0162] Proximity sensor 614, also known as a distance sensor, is typically located on the front panel of terminal 600. Proximity sensor 614 is used to detect the distance between the user and the front of terminal 600. In one embodiment, when proximity sensor 614 detects that the distance between the user and the front of terminal 600 is gradually decreasing, processor 601 controls display screen 605 to switch from the screen-on state to the screen-off state. When proximity sensor 604 detects that the distance between the user and the front of terminal 600 is gradually increasing, processor 601 controls display screen 605 to switch from the screen-off state to the screen-on state.
[0163] Those skilled in the art will appreciate that the structure shown in FIG6 does not limit the terminal 600 , and the terminal 600 may include more or fewer components than shown, or combine certain components, or adopt a different component arrangement.
[0164] FIG7 is a schematic diagram of the structure 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 includes 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 method for generating model interpretation information provided by the above-mentioned various method embodiments. Of course, the server also has components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server also includes other components for implementing device functions, which will not be described in detail here.
[0165] The present application also provides a computer-readable storage medium having at least one computer program stored therein. 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 is a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0166] 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.
[0167] Those skilled in the art will understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing related hardware through a program, and the program is stored in a computer-readable storage medium, and the above-mentioned storage medium is a read-only memory, a disk or an optical disk, etc.
[0168] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for generating model explanation information, executed by a computer device, the method comprising: Determining first parameters of each of the plurality of local features based on a plurality of local features and a target category of the multimedia resource, wherein the target category is predicted based on a first model for the multimedia resource, the first model is used to predict the category of the input multimedia resource, and the first parameter of one of the local features is used to indicate the contribution of the local feature to the target category; Based on the multiple local features and the target category, determine the paths of the multiple local features respectively, wherein a starting point of the path of a local feature is used to represent the local feature, an end point is used to represent the target category, and the path is used to represent a processing process of obtaining the target category based on the local feature; Based on the first parameters and paths of each of the multiple local features, model interpretation information of the first model is generated, and the model interpretation information is used to explain the process of the first model obtaining the target category based on the multimedia resource.
2. The method according to claim 1, wherein: The determining of the first parameters of the plurality of local features based on the plurality of local features of the multimedia resource and the target category comprises: Determine, based on a second model, a second parameter of each of the plurality of local features, wherein the second model is used to predict the second parameter of the local feature, and the second parameter of one of the local features is used to indicate the importance of the local feature to the target category; Based on a third model, determining a third parameter of each of the plurality of local features, wherein the third model is used to determine a third parameter of the local feature, and the third parameter of one of the local features is used to indicate the interpretability of the local feature; Based on the multiple local features and the target category, determine the rules of the multiple local features respectively, and based on the rules of the multiple local features respectively, determine the fourth parameter of each rule, wherein the rule is used to determine the category of the multimedia resource including the local features as the target category, and the fourth parameter of each rule is used to indicate the credibility of the rule; For any local feature, a weighted sum is performed on the second parameter and the third parameter of the local feature and a fourth parameter corresponding to the local feature to obtain a first parameter of the local feature.
3. The method according to claim 2, wherein: The second model includes a plurality of decision trees; The determining, based on the second model, second parameters of each of the plurality of local features comprises: For any local feature among the multiple local features, determining a second parameter of the local feature in each decision tree based on the second model; An average value of the second parameter of the local feature in each decision tree is determined as the second parameter of the local feature.
4. The method according to claim 2, wherein: The determining, based on the multiple local features and the target category, respective rules of the multiple local features, and determining, based on the respective rules of the multiple local features, a fourth parameter of each rule, comprises: Extracting rules for each of the plurality of local features from a rule set of the first model based on the plurality of local features and the target category; For any rule, the fourth parameter of the rule is determined based on the fifth parameter of the local feature corresponding to the rule, the fifth parameter is used to indicate the degree of affiliation of the local feature to the multimedia resource, and the fourth parameter is a parameter positively correlated with the fifth parameter.
5. The method according to claim 2, wherein: The method further comprises: Based on the multiple local features, generate multiple reference resources, each reference resource includes at least one local feature of the multiple local features; For any reference resource, determining a first target category of the reference resource based on the first model; The third model is trained based on the first target categories of each of the multiple reference resources and the multiple reference resources, and the third model is used to generate third parameters of each of the multiple local features during the process of predicting the category of the multimedia resource.
6. The method according to claim 5, wherein: The step of training the third model based on the first target category of each of the plurality of reference resources and the plurality of reference resources comprises: For any reference resource, determining a second target category of the reference resource based on the third model; Determining a training loss of the third model based on a first target category of the reference resource and a second target category of the reference resource, wherein the training loss is used to indicate a difference between the first target category and the second target category; Based on the training loss, model parameters of the third model are updated.
7. The method according to claim 1, wherein: The determining, based on the multiple local features and the target category, respective paths of the multiple local features comprises: For any local feature among the multiple local features, construct an initial path of the local feature, where a starting point of the initial path is used to represent the local feature, and an end point of the initial path is used to represent the target category; A relaxation operation is performed on the initial path to obtain the path of the local feature.
8. A device for generating model explanation information, the device comprising: A first determination module, configured to determine a first parameter of each of the plurality of local features based on a plurality of local features of the multimedia resource and a target category, wherein the target category is obtained by predicting the multimedia resource based on a first model, the first model is used to predict the category of the input multimedia resource, and the first parameter of one of the local features is used to indicate the contribution degree of the local feature to the target category; A second determination module is used to determine the paths of the plurality of local features based on the plurality of local features and the target category, wherein a starting point of a path of the local feature is used to represent the local feature, an end point is used to represent the target category, and the path is used to represent a processing process of obtaining the target category based on the local feature; A generation module is used to generate model interpretation information of the first model based on the first parameters and paths of each of the multiple local features, wherein the model interpretation information is used to explain the process of the first model obtaining the target category based on the multimedia resource.
9. A computer device, comprising 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 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, wherein the computer-readable storage medium is used to store at least one computer program, wherein the at least one computer program is used to execute the method for generating model interpretation information as described in any one of claims 1 to 7.
11. A computer program product, comprising a computer program, wherein 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
Patent Citations
Model interpretation method and device, electronic equipment and computer readable storage medium
CN110837895A
Feature mining method and device for classification label
CN111160473A
Interpretation method and device for an artificial intelligence discrimination model, equipment and a storage medium
CN111914567A
Model decision interpretation implementation method and device and computer equipment
CN112116028A
Prediction interpretation
US20210142169A1
