Image classification model local interpretation optimization method based on multi-level superpixel architecture

By using the multi-level superpixel architecture generated by the fuzzy clustering algorithm in the image classification model and selecting superpixels using the particle swarm algorithm, the problem of single local interpretation in the existing technology is solved, and the generation of multi-level local interpretation is realized, which is consistent with human multi-grained cognitive mechanism and accelerated interpretation generation.

CN119810526APending Publication Date: 2025-04-11DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411865790.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing image classification model has a single local interpretation of the granularity, and the superpixel coverage area is basically consistent, which cannot conform to the human multi-grained cognitive mechanism.

Method used

A multi-level superpixel architecture generated based on the fuzzy clustering algorithm is adopted, and superpixels are selected layer by layer through the particle swarm algorithm to form multi-level local interpretation. This method establishes connections between different levels of interpretation through pruning strategies, and generates multi-level explanations that conform to human cognitive mechanisms.

Benefits of technology

It provides a multi-level explanation with multi-grained characteristics, helping humans better judge whether they believe in the prediction results of the model, and accelerate the interpretation generation process through pruning algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810526A_ABST
    Figure CN119810526A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification model local interpretation optimization method based on a multi-level superpixel architecture, and belongs to the field of interpretable artificial intelligence. According to the invention, the fuzzy clustering algorithm is introduced to generate the multi-level super-pixel architecture, and a basis is provided for generating explanation with multi-granularity features. On the basis, the particle swarm optimization is used as an efficient optimization technology, selection is performed from top to bottom in the multi-layer super-pixel architecture, and a particle swarm optimization optimal solution is generated on each layer to serve as explanation of the current layer. Besides, in the top-to-bottom selection process, the optimal solution of the previous level guides the pruning of the superpixels of the next level, the relation between interpretations of different levels is established, and finally, each layer of interpretation is constructed to form multi-level interpretation. The generated multi-level explanation is used for explaining a prediction classification label of an image classification model to an input image and helping people to judge whether model prediction is believed or not.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of explainable artificial intelligence and relates to a local explanation optimization method for an image classification model based on a multi-level superpixel architecture. Background Art

[0002] Deep convolutional neural networks (DCNNs) have become the mainstream method for image classification, showing excellent performance. Various DCNN architectures, such as residual neural networks (ResNet) and densely connected networks (DenseNet), have shown excellent classification performance in various challenging image classification tasks in different application fields. However, the DCNN structure is very complex, consisting of dozens to hundreds of layers, which makes it difficult for humans to interpret or understand. This problem is particularly important in fields such as medical diagnosis, because doctors or patients must understand the internal principles and decision-making basis of the deep model to confirm the validity of the prediction. Therefore, providing explanations for the prediction results of deep convolutional neural networks for fields such as medical diagnosis has become a practical problem that needs to be solved urgently.

[0003] Explainable deep learning aims to provide explanations for the behaviors and actions of deep learning models in an understandable way. Existing interpretable deep learning methods can be divided into global interpretability methods and local interpretability methods. Global interpretability methods focus on explaining the internal knowledge representation of the model by training a more understandable and smaller model on the entire dataset. Local interpretability methods focus on explaining the decision process of the model for a single input sample. Generally speaking, it is easier to explain the prediction of a single instance than to explain the entire black box model. Among them, the representative local interpretability method is the model-independent local interpretability framework, which uses superpixels as interpretable features and provides superpixel-based mask images to explain the classification prediction results of deep convolutional neural networks by adopting more interpretable models such as decision trees. In addition, some studies have solved some problems existing in this framework, such as the fixed number of selected superpixels and imprecise explanations. However, the explanations generated by these methods are limited to a single granularity and do not consider the different contributions of objects and backgrounds in the image. Since the human brain has multi-granular cognitive characteristics, multi-granular explanations can better help humans judge whether to believe the prediction results of the model.

[0004] Multi-granularity distribution is an inherent organizational structure of the world, consisting of coarse-grained, fine-grained, and intermediate levels of their interrelationships. The "global priority" mechanism is an inherent principle of human cognition, representing a cognitive process characterized by "from coarse to fine". Perception starts from high-level features and then moves to low-level features. Granular computing, such as fuzzy sets, simulates the ability of humans to perceive the real world at different granularity levels and exhibits the inherent characteristics of multi-granularity distribution. Fuzzy clustering algorithm is a clustering algorithm based on fuzzy logic and fuzzy sets. The algorithm allows data points to belong to multiple cluster centers to varying degrees, and is widely used in many fields such as image segmentation due to its advantages in processing fuzzy and overlapping data sets.

[0005] Superpixels are considered interpretable features and are used as the basic unit for explaining visual tasks such as image classification. Superpixels are a concept in computer vision that is used to group pixels in an image into coherent and perceptually meaningful regions. Compared to pixels that cannot be directly interpreted by humans, superpixels can generate larger image regions where pixels have similar features, such as color and texture, which helps with subsequent image analysis.

[0006] The present invention forms a local interpretation optimization method of an image classification model based on a multi-level superpixel architecture by selecting superpixels by applying a particle swarm algorithm layer by layer on a multi-level architecture generated based on a fuzzy clustering algorithm, and the method can provide an explanation for the prediction results of the image classification model. The particle swarm algorithm is an optimization algorithm based on swarm intelligence, and its basic idea is to find the optimal solution through collaboration and information sharing between individuals in a group. The algorithm has the advantages of strong global search capability and fast convergence speed, and is widely used in the fields of high-dimensional data feature selection and neural network architecture search. In addition, a multi-level superpixel architecture is generated based on a fuzzy clustering algorithm. Based on this architecture, the particle swarm algorithm is applied layer by layer to optimize and generate explanations at different levels, and a pruning strategy is used to establish the connection between explanations at different levels, and finally a multi-level explanation that conforms to the human cognitive mechanism is generated. Summary of the invention

[0007] In view of the problems that the local interpretation granularity of existing image classification models is single, the superpixel coverage area is basically consistent, and the explanation provided to users is inconsistent with the multi-granularity cognitive mechanism of human beings, the present invention provides a local interpretation optimization method for image classification models based on a multi-level superpixel architecture, which provides explanations for model predictions that are consistent with the human cognitive process.

[0008] The present invention combines fuzzy clustering algorithm and particle swarm algorithm to provide multi-level local interpretation. Among them, the fuzzy clustering algorithm is used to generate a multi-level superpixel architecture; the particle swarm algorithm is used as an efficient optimization technology to select from top to bottom in the multi-level superpixel architecture, and each layer generates a particle swarm algorithm optimal solution as the current level interpretation, and each layer of interpretation is constructed to form a multi-level interpretation. Using the interpretation of each level, the superpixels associated with the unselected superpixels in the next level of interpretation are directly pruned, reducing the search dimension of the particle swarm algorithm in the next level of evolution, establishing the connection between the interpretations of different levels, and finally forming a multi-level local interpretation.

[0009] In the present invention, the generated local explanation is used to explain the prediction of the image classification model for a single input image. The explanation is in the form of masking (blackening) superpixels that are not related to the prediction and retaining superpixels that are related to the prediction. On this basis, the method of the present invention is roughly divided into three stages:

[0010] (1) Superpixel generation stage: The interpretation generated by the present invention is based on superpixels, that is, the superpixels are retained or masked. In the present invention, the input image is simply iterated clustering to efficiently generate superpixels.

[0011] (2) Multi-level superpixel architecture construction stage: The multi-level superpixel architecture is a binary tree, where each node represents a superpixel, and the nodes of each layer constitute a superpixel image. Superpixels are used as data points, and fuzzy clustering is performed with a cluster center of two as the left and right nodes of the initial image. In the formed left superpixel dataset and right superpixel dataset, the above settings are used to continue clustering to generate the left and right nodes of the dataset.

[0012] (3) Multi-level local explanation evolution generation stage: The generated explanation can help humans judge whether to trust the prediction of the image classification model. The explanation provided is optimized based on the initial classification label of the input image. The particle swarm algorithm is applied to each level in the multi-level superpixel architecture to generate the optimal solution for each level. The number of nodes of each level of the superpixel in the multi-level superpixel architecture is consistent with the dimension of the particles. The optimal solution formed uses the threshold method to select and mask superpixels. In the top-down selection process, the optimal solution of the particle swarm algorithm at the previous level guides the pruning of superpixels at the next level. Specifically, if a superpixel in the explanation is not selected, the superpixels represented by the left and right child nodes of the superpixel in the multi-level superpixel architecture are directly masked, that is, the particle dimension of the particle swarm algorithm running at the next level is reduced.

[0013] The present invention pre-constructs a multi-level superpixel architecture through fuzzy clustering and multi-granularity segmentation, adopts a particle swarm algorithm to select superpixels related to prediction as explanations, and adopts a pruning algorithm to establish connections between explanations at different levels and simultaneously accelerate the algorithm running speed.

[0014] In order to achieve the above object, the present invention adopts the following technical solution:

[0015] A local explanation optimization method for an image classification model based on a multi-level superpixel architecture comprises the following steps:

[0016] Step (1): Obtain the initial predicted category label of the input image using the deep convolutional neural network to be interpreted;

[0017] Step (2): Use simple linear iterative clustering to locally cluster the pixels of the input image to generate superpixels;

[0018] Step (3): construct a multi-level superpixel architecture using a fuzzy clustering algorithm; the multi-level superpixel architecture is a binary tree, each node represents a superpixel, and the nodes of each layer constitute a superpixel image;

[0019] Step (4): Use the particle swarm algorithm to select and generate explanations layer by layer from the multi-level pixel architecture to construct a multi-level explanation.

[0020] Furthermore, the step (1) comprises the following steps:

[0021] (1.1) Send the input image to any deep convolutional neural network model to be interpreted and obtain the output Among them, K is the total number of category labels, vector The scalar elements of represent the unnormalized class scores.

[0022] (1.2) Use the Softmax function to output the model Normalize and get the classification label of the model for the input image. The Softmax function formula is as follows:

[0023]

[0024] in, is the probability of predicting category i, K is the total number of category labels, is the output of the model to be explained; The label with the maximum value is the predicted class label label.

[0025] Furthermore, the step (2) comprises the following steps:

[0026] (2.1) According to the image size and the number of superpixels expected to be segmented, the step size S of the cluster center, that is, the maximum spatial distance of the cluster center, is calculated as follows:

[0027]

[0028] Among them, N p is the number of pixels in the input image, N s is the number of superpixels for the expected segmentation.

[0029] (2.2) Initialize cluster centers: Sample on a regular grid with an interval of S pixels to produce superpixels of equal size;

[0030] (2.3) Clustering: Define the 2S×2S range of each cluster center as the search range of the center, calculate the distance from each pixel to the cluster center, and divide the pixels into the closest class based on the distance to the cluster center;

[0031] (2.4) Update cluster center: Calculate the mean of pixels in the corresponding class to update the class center;

[0032] (2.5) Repeat the steps of clustering and updating cluster centers until the maximum number of iterations is reached.

[0033] Furthermore, the step (3) comprises the following steps:

[0034] (3.1) The input image is used as the root node of the multi-level superpixel architecture;

[0035] (3.2) Initialize the superpixels generated in step (2) as the dataset D o ;

[0036] (3.3) Initialize a queue D s Empty. o Join queue D s ;

[0037] (3.4) Cyclic process, queue D s If it is empty, the loop stops;

[0038] Furthermore, the cycle process described in step (3.4) comprises the following steps:

[0039] (3.4.1) Take out the first element of the queue, which is recorded as data set D;

[0040] (3.4.2) According to the superpixel data points in the dataset D, the random initial center point C = [c 1 ,c 2 ]. Where c 1 and c 2Represent the two initial center points of the superpixel dataset respectively;

[0041] (3.4.3) Calculate the confusion matrix U, the formula is as follows:

[0042]

[0043] Among them, c is the number of cluster center points, c j and c k are all cluster centers, S l Represents the lth superpixel R l The number of pixels contained in, m is the confusion factor, x i YesR l Contains pixels; u lj Represents R l and the jth center point c j The degree of membership;

[0044] (3.4.4) Repeat the clustering calculation until the maximum number of iterations is reached. The clustering calculation includes the following steps:

[0045] (a) Adjust the center point position. The formula is as follows:

[0046]

[0047] Where N is the number of superpixels in the dataset D, is the membership degree u lj m to the power of;

[0048] (b) Recalculate the confusion matrix U according to formula (3);

[0049] (3.4.5) Based on the confusion matrix U, the superpixels in the superpixel dataset D are divided into two categories, whose center points are c 1 , c 2 ; The classification method is: if a data point is 1 The distance is less than c 2 The distance between the data points is c 1 The two data sets are denoted as D l and D r , and serve as the left and right child nodes of node D in the multi-level superpixel architecture;

[0050] (3.4.6) If D l Not equal to D(D r is empty) and D r Not equal to D(D l is empty), then D l and D r Join queue D s ;

[0051] Furthermore, the step (4) comprises the following steps:

[0052] (4.1) Obtain the number of nodes in the kth layer of the multi-level superpixel architecture generated in step (3). The layers of the multi-level superpixel architecture are defined from top to bottom, the root node belongs to layer 0, and k is initially 1;

[0053] (4.2) Randomly initialize the population, the position and velocity of each particle are and in and The dimension of is determined by the number of nodes obtained;

[0054] (4.3) Execute the particle swarm algorithm to obtain the optimal solution of the particle swarm algorithm as the explanation of the current level;

[0055] Further, the particle swarm algorithm described in step (4.3) includes the following steps:

[0056] (4.3.1) Calculate the fitness value of each particle. The specific calculation steps are as follows:

[0057] (a) Decode each particle into an image: if the value of a certain dimension of the particle is less than the threshold ε, then mask (blacken) the corresponding superpixel; otherwise, retain the corresponding superpixel;

[0058] (b) Obtain the initial predicted category label label of the input image by the model to be explained in step (1);

[0059] (c) The decoded image is sent to the model to be interpreted and the fitness value fv is calculated as follows:

[0060]

[0061] in, is the probability that the model to be explained classifies the masked image as the initial predicted category label label, K is the total number of category labels, is the output of the model to be explained.

[0062] (4.3.2) Update the individual best historical position of the particle (pbest) and the global best historical position of the population (gbest). The specific update steps are as follows:

[0063] (a) If it is the first generation population, then each particle pbest is the initial position of the particle, and the population gbest is the best value of the current pbest. If not, go to (b) and (c);

[0064] (b) If the fitness of each particle fv>pbest, then update pbest to the current position, otherwise do not update;

[0065] (c) If the fitness fv of each particle is greater than gbest, gbest is updated to the current position, otherwise it is not updated;

[0066] (4.3.3) Update the particle's velocity and position, the formula is as follows:

[0067]

[0068] in, and They are the velocity and position of the ith particle when the number of iterations is cur, gbest cur is the historical global best position at t iterations, is the individual best historical position of the ith particle at the cur iteration number, w is the inertia weight, β 1 and β 2 are two learning factors, r 1 and r 2 are two random numbers ranging from 0 to 1;

[0069] (4.3.4) If the termination condition is met, the optimal solution gbest of the particle swarm algorithm is output. If not, (4.3.1) to (4.3.3) are repeated.

[0070] (4.4) The optimal solution gbest of the decoding particle swarm algorithm is the masked image, and the masked image is used as the interpretation of the current k layer;

[0071] (4.5) Prune the k+1 layer of the multi-level superpixel architecture based on the interpretation of the k layer; if a superpixel is not selected in the interpretation of the k layer, the left and right subtrees of the node represented by the superpixel are pruned, and the number of nodes in the k+1 layer is readjusted;

[0072] (4.6) If the last layer of the multi-level superpixel architecture is reached, the generation of explanations is terminated; the explanations of each layer constitute a multi-level explanation; otherwise, steps (4.2) to (4.5) are repeated; and finally a multi-level local explanation of the classification prediction of the input image by the model to be explained is obtained.

[0073] Beneficial effects of the present invention: The present invention provides a multi-level explanation with multi-granularity features for the prediction of the pre-trained deep convolutional neural network to be explained. First, by introducing fuzzy clustering and multi-granularity segmentation, the superpixel space is reconstructed to generate a multi-level superpixel architecture; on this basis, the optimal solution is generated for each level from top to bottom using the particle swarm algorithm, and the multi-level superpixel architecture of the next level is pruned based on the optimal solution of each layer, so that the explanations of each level are connected, and the search space of the algorithm is further reduced, the speed of generating explanations is accelerated, and a multi-level explanation that is more in line with the human cognitive process is generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a specific flow chart of the present invention;

[0075] Figure 2 is a flow chart of a multi-level superpixel frame building module of the present invention;

[0076] Figure 3 is a flow chart of a multi-level local interpretation generation module of the present invention;

[0077] Figure 4 It is a principle diagram of fitness calculation in the particle swarm algorithm of the present invention;

[0078] Figure 5 is an input image of a specific embodiment of the present invention;

[0079] Figure 6 It is a superpixel map generated by the superpixel generation module of the present invention for the input image;

[0080] Figure 7 It is a schematic diagram of pruning according to a specific embodiment of the present invention;

[0081] Figure 8 It is a multi-layer local explanation of the classification prediction results of the input image generated by the deep convolutional neural network model DenseNet-121. DETAILED DESCRIPTION

[0082] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0083] The present invention provides explanations for the classification predictions of pre-trained image classification models. Superpixels are clustered using fuzzy clustering and multi-granularity segmentation to generate a multi-level superpixel architecture; each layer of superpixel images in the multi-level superpixel architecture is subjected to evolutionary optimization using a particle swarm algorithm, and superpixels related to the prediction are selected based on the initial predicted classification labels to generate explanations; before initializing the particle swarm algorithm for each level of superpixel images, the superpixel architecture of that level is pruned based on the explanation of the previous level, and connections between explanations at different levels are established, and finally a multi-level explanation is generated to help humans determine whether to believe the model's predictions.

[0084] The method of the present invention can be used to provide an explanation of the prediction of the image classification model. The method flow of the present invention is as follows: Figure 1 shown.

[0085] The specific implementation of the present invention will explain the prediction of the input image by the deep convolutional neural network DenseNet-121. Figure 1 As shown), specifically including the following steps:

[0086] Step (1): Use DenseNet-121 to obtain the input image img o The predicted category label of , the steps include:

[0087] (1.1) Figure 5 The original input image img is displayed o Adjust to get an image img of size 224×224 224×224 ;

[0088] (1.2)img 224×224 Send to DenseNet-121 to get the output And use the Softmax function to get the predicted classification label label. The Softmax function formula is as follows:

[0089]

[0090] in, is the probability of predicting category i, K is the total number of category labels, is the output of ResNet-50; take The label with the maximum value is the predicted label, denoted as label. In this specific implementation, the category is "cheetah".

[0091] Step (2): Set the number of pre-generated superpixels N s is 100, and the input image img is clustered using simple linear iterative clustering o The pixels are locally clustered to generate superpixels of the same size. Figure 6 To generate a superpixel map, curve segmentation forms superpixels, and the sizes of superpixels are basically the same.

[0092] Step (3): Use fuzzy clustering and multi-granularity segmentation to build a multi-level superpixel architecture. The flowchart of the multi-level superpixel architecture construction module is as follows: Figure 2 As shown, the steps include:

[0093] (3.1) Input image img o As the root node of the multi-level superpixel architecture, that is, the zeroth layer of the multi-level superpixel architecture;

[0094] (3.2) Initialize queue D s is empty, and the superpixels generated in step (2) are used as the dataset D o Join queue D s ;

[0095] (3.3) Main loop process until queue D s Stop the loop if it is empty:

[0096] (3.3.1) Take out the first element in the queue, denoted as D;

[0097] (3.3.2) Set the number of cluster centers to 2 and randomly initialize the center of the data set, denoted as C = [c 1 ,c 2 ];

[0098] (3.3.3) Calculate the confusion matrix U, the formula is as follows:

[0099]

[0100] Among them, the number of clusters c = 2, the confusion factor m = 2, S l Represents the lth superpixel R l The number of pixels contained in x i YesR l Contains pixels; u lj Represents R l and the jth center point c j The degree of membership;

[0101] (3.3.4) Repeat the clustering process until the maximum number of iterations T = 100 is reached:

[0102] (a) Adjust the cluster center position, the formula is as follows:

[0103]

[0104] Where N is the number of superpixels in the dataset D;

[0105] (b) Recalculate the confusion matrix U according to formula (2);

[0106] (3.3.5) Based on the confusion matrix U, the superpixel data in the dataset D is divided into two categories, denoted as D l and D r . D l and D r They serve as the left and right child nodes of the node D of the multi-level superpixel architecture respectively;

[0107] (3.3.6) If D l Not equal to D and D r If D is not equal to D, then D l and D r Join queue D s .

[0108] Step (4): Generate multi-level interpretations using the particle swarm algorithm and pruning algorithm. The flowchart of the multi-level local interpretation generation module used is as follows: Figure 3 As shown, the steps include:

[0109] (4.1) The first layer superpixel image of the multi-level superpixel architecture is the current layer, denoted by k = 1;

[0110] (4.2) Run the particle swarm algorithm on the superpixel dataset of the kth layer. The specific steps include:

[0111] (4.2.1) Particle swarm initialization: based on the number of superpixels in the kth layer, lev k Initialize the length of the particle's velocity vector and position vector. Particle group size N p is 100, the maximum number of iterations g max is 100;

[0112] (4.2.2) Calculate the fitness of particles. The fitness calculation process of the designed particle swarm algorithm is as follows: Figure 4 As shown, the steps include:

[0113] (a) Get the initial image img obtained in step (1) o Category label label;

[0114] (b) Particle decoding into a masked image: Decode the particle according to the value of a certain index in the particle's position vector and the correspondence between the index and the superpixel to obtain the masked image. The specific decoding method is: if the value of the index is less than 0.5, the corresponding superpixel is masked (blackened); otherwise, the corresponding superpixel is retained;

[0115] (c) Send the masked image to DenseNet-121 to get the output, and apply the Softmax function to calculate the fitness value fv:

[0116]

[0117] (4.2.3) Update the individual and global optimal fitness values ​​of the particle swarm;

[0118] (4.2.4) Update the particle's velocity and position, the formula is as follows:

[0119]

[0120] in, and They are the velocity and position of the ith particle when the number of iterations is cur, gbest cur is the historical global best position when the number of iterations is cur, is the individual best historical position of the ith particle when the number of iterations is cur, and the calculation formula of the inertia weight w is β 1 and β 2 are two learning factors, both of which are 1.49445. 1 and r 2 are two random numbers ranging from 0 to 1;

[0121] (4.2.5) Repeat steps (4.2.2) to (4.2.4) until the maximum number of iterations is reached. The final output of the particle swarm algorithm of the k-th layer is the optimal solution gbest k .

[0122] (4.3) Based on the optimal solution gbest k Prune the k+1 layer. The specific steps are:

[0123] (4.3.1) gbest k Decoded as a masked image. If the value of a certain index in the particle position vector is less than 0.5, the corresponding superpixel is masked (blackened), otherwise, the corresponding superpixel is retained; Figure 7 The first layer optimal solution gbest is shown 1 The position vector of the mask (blackened) value is 0.3, and the superpixel corresponding to the retained value is 0.8. The final decoding is as follows Figure 8 (a) The first level of explanation shown;

[0124] (4.3.2) In the multi-level superpixel architecture, the left and right child nodes of the k+1 level of the masked superpixel at the k level are directly pruned; e.g. Figure 7 As shown, based on gbest 1 After decoding, the interpretation is to directly prune the left and right child nodes of the masked superpixel;

[0125] (4.3.3) Based on the pruning results, adjust the number of superpixel nodes at the k+1 level; Figure 7 It can be obtained that the number of superpixel nodes in the second layer is lev 2 Adjusted from 4 to 2;

[0126] (4.4)k++, repeat steps (4.2) to (4.3) until reaching the last layer of the multi-level superpixel architecture.

[0127] Figure 8 a~d show the input image img o, the four-layer local explanation of the DenseNet-121 model prediction category "cheetah" generated by this specific implementation. The explanation is presented in the form of a masked image with superpixels as the basic unit. The multi-granularity characteristics of the multi-level explanation are reflected in the figure. From coarse granularity to fine granularity, the size of superpixels gradually decreases. The final explanation provided to the user retains the characteristics of "cheetah", namely the head features and leopard features.

Claims

1. A local explanation optimization method for an image classification model based on a multi-level superpixel architecture, characterized in that: The steps include: Step (1): Obtain the initial predicted category label of the input image using the deep convolutional neural network to be interpreted; Step (2): Use simple linear iterative clustering to locally cluster the pixels of the input image to generate superpixels; Step (3): construct a multi-level superpixel architecture using a fuzzy clustering algorithm; the multi-level superpixel architecture is a binary tree, each node represents a superpixel, and the nodes of each layer constitute a superpixel image; Step (4): Use the particle swarm algorithm to select and generate explanations layer by layer from the multi-level pixel architecture to construct a multi-level explanation.

2. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 1, characterized in that: The step (1) comprises the following steps: (1.1) Send the input image to any deep convolutional neural network model to be interpreted and obtain the output Among them, K is the total number of category labels, vector The scalar elements of represent the unnormalized class scores; (1.2) Use the Softmax function to output the model Normalize and get the classification label of the model for the input image; the Softmax function formula is as follows: in, is the probability of predicting category i, K is the total number of category labels, is the output of the model to be explained; The label with the maximum value is the predicted class label label.

3. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 1, characterized in that: The step (2) comprises the following steps: (2.1) According to the image size and the number of superpixels expected to be segmented, the step size S of the cluster center, that is, the maximum spatial distance of the cluster center, is calculated as follows: Among them, N p is the number of pixels in the input image, N s is the number of superpixels for the expected segmentation; (2.2) Initialize cluster centers: Sample on a regular grid with an interval of S pixels to produce superpixels of equal size; (2.3) Clustering: Define the 2S×2S range of each cluster center as the search range of the center, calculate the distance from each pixel to the cluster center, and divide the pixels into the closest class based on the distance to the cluster center; (2.4) Update cluster center: Calculate the mean of pixels in the corresponding class to update the class center; (2.5) Repeat the steps of clustering and updating cluster centers until the maximum number of iterations is reached.

4. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 1, characterized in that: The step (3) comprises the following steps: (3.1) The input image is used as the root node of the multi-level superpixel architecture; (3.2) Initialize the superpixels generated in step (2) as the dataset D o ; (3.3) Initialize a queue D s Empty; set data set D o Join queue D s ; (3.4) Cyclic process, queue D s If it is empty, the loop stops.

5. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 4 is characterized in that: The cycle process described in step (3.4) comprises the following steps: (3.4.1) Take out the first element of the queue, which is recorded as data set D; (3.4.2) Based on the superpixel data points in the dataset D, a random initial center point C = [c1, c2]; where c1 and c2 represent the two initial center points of the superpixel dataset respectively; (3.4.3) Calculate the confusion matrix U, the formula is as follows: Among them, c is the number of cluster center points, c j and c k are all cluster centers, S l Represents the lth superpixel R l The number of pixels contained in, m is the confusion factor, x i YesR l Contains pixels; u lj Represents R l and the jth center point c j The degree of membership; (3.4.4) Repeat the clustering calculation until the maximum number of iterations is reached. The clustering calculation includes the following steps: (a) Adjust the center point position. The formula is as follows: Where N is the number of superpixels in the dataset D, is the membership degree u lj m to the power of; (b) Recalculate the confusion matrix U according to formula (3); (3.4.5) Based on the confusion matrix U, the superpixels in the superpixel dataset D are divided into two categories, whose center points are c1 and c2 respectively. The classification method is: if the distance between a data point and c1 is less than the distance between it and c2, then the data point is classified into the c1 category. The two datasets are denoted as D l and D r , and serve as the left and right child nodes of node D in the multi-level superpixel architecture; (3.4.6) If D l Not equal to D(D r is empty) and D r Not equal to D(D l is empty), then D l and D r Join queue D s .

6. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 1, characterized in that: The step (4) comprises the following steps: (4.1) Obtain the number of nodes in the kth layer of the multi-level superpixel architecture generated in step (3); wherein the layers of the multi-level superpixel architecture are defined from top to bottom, the root node belongs to layer 0, and k is initially 1; (4.2) Randomly initialize the population, the position and velocity of each particle are and in and The dimension of is determined by the number of nodes obtained; (4.3) Execute the particle swarm algorithm to obtain the optimal solution of the particle swarm algorithm as the explanation of the current level; (4.4) The optimal solution gbest of the decoding particle swarm algorithm is the masked image, and the masked image is used as the interpretation of the current k layer; (4.5) Prune the k+1 layer of the multi-level superpixel architecture based on the interpretation of the k layer; if a superpixel is not selected in the interpretation of the k layer, the left and right subtrees of the node represented by the superpixel are pruned, and the number of nodes in the k+1 layer is readjusted; (4.6) If the last layer of the multi-level superpixel architecture is reached, the generation of explanations is terminated; the explanations of each layer constitute a multi-level explanation; otherwise, steps (4.2) to (4.5) are repeated; and finally a multi-level local explanation of the classification prediction of the input image by the model to be explained is obtained.

7. The local interpretation optimization method of an image classification model based on a multi-level superpixel architecture according to claim 6, characterized in that: The particle swarm algorithm described in step (4.3) includes the following steps: (4.3.1) Calculate the fitness value of each particle. The specific calculation steps are as follows: (a) Decode each particle into an image: if the value of a certain dimension of the particle is less than the threshold ε, then mask (blacken) the corresponding superpixel; otherwise, retain the corresponding superpixel; (b) Obtain the initial predicted category label label of the input image by the model to be explained in step (1); (c) The decoded image is sent to the model to be interpreted and the fitness value fv is calculated as follows: in, is the probability that the model to be explained classifies the masked image as the initial predicted category label label, K is the total number of category labels, is the output of the model to be explained; (4.3.2) Update the individual best historical position pbest of the particle and the global best historical position gbest of the population. The specific update steps are as follows: (a) If it is the first generation population, then each particle pbest is the initial position of the particle, and the population gbest is the best value of the current pbest. If not, go to (b) and (c); (b) If the fitness of each particle fv>pbest, then update pbest to the current position, otherwise do not update; (c) If the fitness fv of each particle is greater than gbest, gbest is updated to the current position, otherwise it is not updated; (4.3.3) Update the particle's velocity and position, the formula is as follows: in, and They are the velocity and position of the ith particle when the number of iterations is cur, gbest cur is the historical global best position at t iterations, is the individual best historical position of the i-th particle at the cur iteration number, w is the inertia weight, β1 and β2 are two learning factors, r1 and r2 are two random numbers ranging from 0 to 1; (4.3.4) If the termination condition is met, the optimal solution gbest of the particle swarm algorithm is output. If not, (4.3.1) to (4.3.3) are repeated.