Explanatable image recognition system and construction method thereof
By introducing a concept predictor and a locator into the image recognition model, joint optimization of semantic and spatial interpretation is achieved, which solves the problems of limited interpretation range and low credibility in existing technologies and improves the application credibility of the model in high-risk scenarios.
Patent Information
- Application Number
- CN202511559521.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-02-17
AI Technical Summary
Existing interpretable image recognition technologies suffer from limited semantic interpretation, inaccurate locational interpretation, and a lack of unified semantic and locational interpretation, resulting in limited interpretation scope, low credibility, and difficulty in application in high-risk scenarios.
A concept predictor and a concept locator are introduced. The image is encoded into a 3D feature map by a feature encoder. The concept predictor predicts multiple concept labels, and the concept locator constrains the activation of concepts within a specific region of the image. Combined with the category predictor, the category label is output, thus achieving joint optimization of semantic and spatial interpretation.
It improves the intuitiveness and reliability of the model output, enabling users to better understand the semantic factors and spatial location basis of the model's judgments, and enhancing the credibility of the model's application in high-risk scenarios such as healthcare, industry, and security.
Smart Images

Figure CN121544930A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, more specifically to the field of interpretable image recognition, and more specifically to an interpretable image recognition system and its construction method. Background Technology
[0002] Explainable image recognition is a crucial research area in artificial intelligence, widely applied in medical image analysis, industrial inspection, security monitoring, autonomous driving, and robotic perception. Through explainable image recognition technology, systems can not only perform target detection and classification but also provide users with intuitive decision-making support, helping them understand the reasons behind the model's judgments and thus increasing trust in the model and its reliability. In medical image analysis, explainable image recognition technology can assist doctors in identifying lesions such as tumors, nodules, and bleeding areas, and explain the model's predictions through visualization or semantic labels, improving diagnostic efficiency and accuracy. In industrial inspection, explainable image recognition can detect defects in components or surface flaws in products, and identify key areas, providing a basis for quality control.
[0003] Currently, representative interpretable image recognition methods can be categorized into three types. The first type involves adapting an arbitrary end-to-end model to a concept-bottleneck model. This method provides concept annotations during training, adjusts the dimension of a layer in the model to match the number of concepts provided, and adds an intermediate loss to guide the neurons in that layer to learn these concepts and perform category reasoning based on them. The second type is interpretable object recognition methods based on prototype learning. This method, based on a prototype learning framework, learns a set of prototype images or features for each category, calculates the similarity between local features of the input image and each prototype, and generates a decision-making basis. This method makes the classification results intuitively understandable; users can see which prototypes the model considers most similar to the input image, thus improving the model's interpretability and credibility. The third type is interpretable image recognition methods based on segmentable concepts. This method proposes combining general image segmentation techniques with concept-driven interpretability to achieve accurate localization and semantic interpretation of any concept. Specifically, the method first uses a large image segmentation model to generate pixel-level region masks of the input image, and then performs semantic annotation and feature matching on each masked region based on the concept set to generate an interpretable basis for category decisions.
[0004] In summary, current explainable image recognition technologies suffer from the following problems: First, semantic interpretation is limited. Most methods rely on predefined or manually labeled concept sets, making it difficult to cover all potential features or key attributes, thus limiting the scope of interpretation. Second, location-based interpretation has inherent drawbacks. When generating key regions using attention maps or saliency maps, location-based interpretable methods suffer from inaccurate boundaries, region drift, and poor consistency. Furthermore, they cannot establish semantic associations with categories or concepts, resulting in incomplete interpretations and limited credibility. Finally, there is a lack of unified semantic and location-based interpretations. Existing methods typically provide only a single type of interpretation, making it difficult to effectively combine semantic concepts with spatial location information. The resulting interpretations are one-sided, lack intuitiveness and completeness, limiting the credibility of explainable image recognition applications in high-risk scenarios.
[0005] It should be noted that the background information presented here is only for illustrating relevant information about the present invention to aid in understanding the technical solutions of the present invention, and does not imply that the relevant information is necessarily prior art. In the absence of evidence indicating that the relevant information was disclosed before the filing date of this invention, the relevant information should not be considered prior art. Summary of the Invention
[0006] Therefore, the purpose of this invention is to overcome the shortcomings of the prior art and provide an interpretable image recognition system and its construction method.
[0007] The objective of this invention is achieved through the following technical solution:
[0008] According to a first aspect of the present invention, an interpretable image recognition system is proposed for predicting and outputting category labels and interpretable information for a specified image, wherein the interpretable information includes multiple concept labels and a key feature region map corresponding to each concept label. The system includes a feature encoder, a concept predictor, a concept locator, and a category predictor, wherein: the feature encoder is used to encode the image into a three-dimensional feature map; the concept predictor is configured with a concept label set consisting of multiple real concept labels, and is used to encode the three-dimensional feature map into multiple first concept activation maps with the same number of real labels as the concept label set, wherein each first concept activation map corresponds to one real concept label, and, based on all the first concept activation maps corresponding to the image, predicts and outputs multiple predicted concept labels for the image, wherein the multiple predicted concept labels are multiple real concept labels in the concept label set that match the key features of the image; the concept locator is used to mask regions other than the key feature regions that match the real concept labels of each first concept activation map to obtain regions that match the key features of the first concept activation map. Figure 1A first concept activation map is assigned a real concept label to the corresponding second concept activation map. All second concept activation maps are spatially pooled to obtain the concept vector of the image. The second concept activation map corresponding to each predicted concept label predicted by the output concept predictor is used as a key feature region map. The category predictor is used to predict and output the category label of the image based on the concept vector of the image.
[0009] According to a second aspect of the present invention, an interpretable image recognition method is proposed, the method comprising: acquiring an interpretable image recognition system as described in the first aspect of the present invention and a target image to be recognized; using the acquired interpretable image recognition system to recognize the target image, so as to predict a category label, multiple concept labels, and a key feature region map corresponding to each predicted concept label of the target image.
[0010] According to a third aspect of the present invention, a method for constructing an interpretable image recognition system as described in the first aspect of the present invention is provided, characterized in that the method comprises: S1, acquiring a training set and an initial interpretable image recognition model, wherein the training set includes multiple image samples, each image sample is configured with a true category label and multiple true concept labels, wherein the true concept labels of all image samples form a non-repeating concept label set, and the initial interpretable image recognition model includes a feature encoder, a concept predictor, a concept locator, and a category predictor, wherein the concept predictor is configured with the concept label set acquired in the training set; S2, taking each image sample in the acquired training set as input, and using each image sample corresponding to... The predicted category labels and predicted concept labels are used as the prediction outputs. Multiple rounds of iterative training are performed on the initial interpretable image recognition model to obtain the final interpretable image recognition system. Each iteration includes: encoding each image sample in the training set into a 3D feature map by a feature encoder; encoding the 3D feature map of each image sample into multiple first concept activation maps that correspond one-to-one with the number of true concept labels in the concept label set by a concept predictor; predicting and outputting multiple predicted concept labels for each image sample based on all the first concept activation maps corresponding to that image sample; and performing Gaussian masking on all the first concept activation maps corresponding to each image sample by a concept locator to obtain multiple first concept activation maps that correspond to the first concept activation maps. Figure 1A corresponding second concept activation map is generated. The ground truth label corresponding to each first concept activation map is assigned to the second concept activation map corresponding to the first concept activation map. Spatial pooling is performed on all second concept activation maps corresponding to each image sample to obtain the concept vector of the image. The category predictor predicts and outputs the category label of the image sample based on the concept vector of each image sample. The cross-entropy loss between the predicted category label and the ground truth category label, the cross-entropy loss between the predicted concept label and the ground truth concept label, and the mean squared error loss between each first concept activation map and the corresponding second concept activation map are calculated using a preset loss function. The parameters in the concept predictor, concept locator, and feature encoder are updated with all the calculated losses.
[0011] Optionally, in step S2, Gaussian masking is performed on all first concept activation maps corresponding to each image sample in the following manner: a Gaussian mask is constructed for each first concept activation map of each image sample, wherein the Gaussian mask is a two-dimensional matrix with the same size as the first concept activation map, and the value of each element in each Gaussian mask is determined in the following manner:
[0012]
[0013] in, Indicates the index of the image sample. Indicates the index of the first concept activation graph. Indicates the row index of the Gaussian mask. The column index representing the Gaussian mask. This represents the total number of image samples in the training set. This represents the total number of first-concept activation maps corresponding to an image sample. This indicates the row number of the first-concept activation graph. This indicates the number of columns in the first-concept activation graph. Indicates the first The first image sample The first concept activation map of the Gaussian mask of the first concept activation map. Line number The values of the elements in the column. , The numbers represent the order of the numbers. The first image sample The first concept activates the row and column coordinates of the largest element in the graph. The first preset parameter is a parameter configured according to the iteration round to control the value of each element in the Gaussian mask; the first concept activation map is processed by the corresponding Gaussian mask of each first concept activation map to obtain the second concept activation map corresponding to each first concept activation map.
[0014] Optionally, the first preset parameter can be configured as follows:
[0015]
[0016] in, This indicates the first preset parameter. This indicates the preset preheating cycle. Indicates the total number of iterations. Indicates the current iteration round. This represents the initial standard deviation of the preset Gaussian mask. This represents the final standard deviation of the preset Gaussian mask.
[0017] Optionally, in step S3, the preset loss function is:
[0018]
[0019] in, This represents the predicted cross-entropy loss determined based on a preset cross-entropy loss function. This predicted cross-entropy loss includes the concept cross-entropy loss between the predicted concept label and the actual concept label, and the category cross-entropy loss between the predicted category label and the actual category label. This represents the mean squared error loss between the activation maps of the first and second concepts, determined based on a preset mean squared error loss function. This represents the weighting coefficient.
[0020] Optionally, the preset cross-entropy loss function is:
[0021]
[0022] in, This represents the total number of image samples in the training set. , The numbers represent the order of the numbers. The true and predicted concept labels of an image sample Indicates the first Image sample concept cross-entropy loss, , The numbers represent the order of the numbers. The true class label and the predicted class label of an image sample Indicates the first Class cross-entropy loss for image samples, This represents the weight of the predefined concept cross-entropy loss.
[0023] Optionally, the preset mean squared error loss function is:
[0024]
[0025] in, This represents the total number of image samples in the training set. Indicates the first All first-concept activation maps corresponding to each image sample. Indicates the first All second-concept activation maps corresponding to each image sample This represents the mean square error function.
[0026] Compared with the prior art, the advantages of the present invention are as follows:
[0027] This invention improves existing image recognition models by introducing a concept predictor to ensure the accuracy of predicted concept labels, and by using a concept locator to constrain concept activation within specific regions of the image, achieving precise localization of key components. The joint optimization of semantic and spatial interpretation enables the model output to simultaneously provide intuitive semantic information and reliable spatial positioning information, thereby enhancing users' understanding and trust in the model's judgment criteria. Attached Figure Description
[0028] The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:
[0029] Figure 1 This is a schematic diagram comparing a traditional image recognition model according to an embodiment of the present invention with an interpretable image recognition model proposed in this invention;
[0030] Figure 2 This is a schematic diagram illustrating the steps of constructing an interpretable image recognition model according to an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of the training framework for an interpretable image recognition model according to an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram comparing the concept localization performance of an interpretable image recognition model and a benchmark model according to an embodiment of the present invention.
[0033] Figure 5 This diagram illustrates the output of concept localization interpretation results by an interpretable image recognition model according to an embodiment of the present invention on multiple datasets. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention is further described in detail below through specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0035] As mentioned in the background section, existing interpretable image recognition methods still have the following shortcomings. First, semantic interpretation is limited. Most methods rely on predefined or manually labeled concept sets, which cannot cover all potential features or key attributes, thus limiting the scope of interpretation. Second, location-based interpretation has inherent drawbacks. Existing location-based interpretable methods generate key regions through attention maps or saliency maps, but suffer from problems such as inaccurate boundaries, region drift, and poor consistency. Furthermore, they cannot establish semantic associations with categories or concepts, resulting in incomplete interpretations and limited credibility. Third, there is a lack of unified semantic and location-based interpretations. Existing methods typically provide only one type of interpretation, emphasizing semantic interpretation, i.e., using language to describe concept or category features, or emphasizing location-based interpretation, i.e., using attention maps or saliency maps to indicate key regions. However, due to the significant differences in the generation mechanism and representation of these two types of interpretations, existing research has rarely been able to effectively combine semantic concepts with spatial location information. This results in one-sided, unintuitive, and incomplete interpretations, making it difficult for users to simultaneously understand the semantic factors and spatial location basis of the model's judgments. Consequently, this limits the credibility of interpretable image recognition in high-risk scenarios such as healthcare, industry, and security.
[0036] To address the aforementioned problems, this invention proposes a scheme for constructing an interpretable image recognition system. This scheme aims to achieve comprehensive interpretation of image recognition while ensuring classification accuracy and user interpretability. Its core lies in using a concept bottleneck model to decompose categories into interpretable concepts and introducing a concept locator to constrain the spatial activation of concepts, thereby unifying semantic and locational interpretations. The interpretable image recognition method proposed in this invention mainly consists of two parts: a concept bottleneck-based image recognition module and a dynamically spatially constrained concept locator. Traditional image recognition models extract image features from the input image using a backbone model, and then pass them through a category predictor to obtain the classification result; the overall process framework of this invention is as follows: Figure 1 As shown, on the one hand, the uninterpretable image features are refined into conceptual bottlenecks that include semantic interpretation (the relevant modules are the concept predictor and concept vector in the figure), and on the other hand, the semantic concept prediction process is refined from the whole image to the local image that includes local interpretation (the relevant modules are the concept activation map and concept locator in the figure).
[0037] According to one embodiment of the present invention, the interpretable image recognition system proposed in this invention is an interpretable image recognition system obtained by improving and retraining existing traditional image recognition models. See [link to relevant documentation]. Figure 1Traditional image recognition models include an image feature encoder and a category predictor. The image feature encoder encodes the image to be recognized into a feature vector, and the category predictor predicts the category of the image to be recognized based on the feature vector. The interpretable image recognition system proposed in this invention differs from existing image recognition models in the following ways: structurally, a concept predictor and a concept locator are embedded between the image feature encoder and the category predictor; functionally, the image feature encoder encodes the image to be recognized into a three-dimensional feature map (three-dimensional feature matrix).
[0038] According to an embodiment of the present invention, an interpretable image recognition system is proposed. This system predicts category labels and interpretable information for an output image. The interpretable information comprises multiple concept labels and a key feature region map corresponding to each concept label. The concept localization information is a key feature region map corresponding to each predicted concept label. The interpretable image recognition system includes a feature encoder, a concept predictor, a concept localizer, and a category predictor. The feature encoder encodes the image into a three-dimensional feature map. The concept predictor is configured with a concept label set consisting of multiple real concept labels. It encodes the three-dimensional feature map into multiple first concept activation maps, the same number of which are real labels in the concept label set. Each first concept activation map corresponds to one real concept label. Furthermore, based on all the first concept activation maps corresponding to the image, the system predicts and outputs multiple predicted concept labels (i.e., ...) for the image. Figure 1 (Semantic interpretation in the image), the multiple predicted concept labels are multiple real concept labels that match the key features of the image in the concept label set; the concept locator is used to mask the regions other than the key feature regions that match the real concept labels of each first concept activation map to obtain the region that matches the key feature regions of the first concept activation map. Figure 1 For each corresponding second concept activation map, the ground truth concept label of each first concept activation map is assigned to the second concept activation map corresponding to that first concept activation map. All second concept activation maps are then spatially pooled to obtain the concept vector of the image. Finally, the second concept activation map corresponding to each predicted concept label predicted by the output concept predictor is used as a key feature region map (i.e., ...). Figure 1 (Location-based interpretation in the image); the category predictor is used to predict the category label of the image based on the concept vector of the image.
[0039] To facilitate understanding of the construction process of the interpretable image recognition system proposed in this invention, the construction process of the interpretable image recognition system will be described in detail below.
[0040] According to one embodiment of the present invention, a method for constructing the interpretable image recognition system is proposed, with reference to... Figure 2In summary, the method includes steps S1 and S2, and each step will be described in detail below with reference to the embodiments and accompanying drawings.
[0041] S1. Obtain a training set and an initial interpretable image recognition model. The training set includes multiple image samples, each image sample is configured with a real category label and multiple real concept labels, wherein the real concept labels of all image samples form a non-repeating concept label set. The initial interpretable image recognition model includes a feature encoder, a concept predictor, a concept locator and a category predictor, wherein the concept predictor is configured with the concept label set obtained from the training set.
[0042] According to one embodiment of the present invention, the obtained initial interpretable image recognition model can be a model built from scratch, or it can be a model obtained by modifying a traditional image recognition model. For the latter, the construction process of the initial interpretable image recognition model is as follows: First, a trained traditional image recognition model is obtained, and the output of the image feature encoder is adjusted to a three-dimensional feature map. For example, taking a backbone model of convolutional neural networks such as ResNet as an example, the output of the image feature encoder is adjusted to the required three-dimensional feature map by removing the last fully connected layer and pooling layer in the network structure of the image feature encoder. For backbone models of the Transformer class, the global [CLS] token is not used as the image feature representation, but the tokens of all image blocks after the input image is divided are retained. Each image block token corresponds to a spatial region of the image, so its feature vector naturally contains spatial location information. By rearranging these tokens according to the original image division order, the required three-dimensional feature map can be formed. Other backbone models also have corresponding technical means, which will not be described in detail here. Then, two modules, a concept predictor and a concept locator, are embedded between the image feature encoder and the category predictor, and the concept label set in the training set is configured in the concept predictor.
[0043] S2. Using each image sample in the acquired training set as input and the predicted category label and predicted concept label corresponding to each image sample as the predicted output, the initial interpretable image recognition model is trained iteratively through multiple rounds to obtain the final interpretable image recognition system. (Reference) Figure 3In each iteration, the operations performed by the interpretable image recognition model include: encoding the input image (image sample) into a three-dimensional feature map by the image encoder (feature encoder); encoding the three-dimensional feature map into multiple first concept activation maps (i.e., the concept activation maps in the figure) by the concept predictor; performing Gaussian masking on each concept activation map by the concept locator; and performing spatial pooling on the processed concept activation maps to obtain the concept vector of each input image; and predicting the category of the image based on the concept vector of each input image by the category predictor. In summary, the operations performed by the interpretable image recognition model in each iteration can be divided into five steps: S21, S22, S23, S24, and S25. To facilitate understanding of the process of constructing the training interpretable image recognition model of this invention, S21, S22, S23, S24, and S25 are described in detail below.
[0044] S21. The feature encoder encodes each image sample in the training set into a three-dimensional feature map;
[0045] S22. The concept predictor encodes the three-dimensional feature map of each image sample into multiple first concept activation maps that are consistent with the number of real concept labels in the concept label set and correspond one-to-one with the real concept labels. Based on all the first concept activation maps corresponding to each image sample, the predictor predicts and outputs multiple predicted concept labels for the image sample.
[0046] According to one embodiment of the present invention, each three-dimensional feature map encoded by the feature encoder is... As input to the concept predictor, each 3D feature map is further encoded by the concept predictor. Each size is The first concept activation graph (two-dimensional graph), in which, This represents the number of true concept labels in the concept label set. Each first concept activation map is the spatial activation distribution of a true concept label in the concept label set. In addition, the concept predictor also needs to output multiple predicted concept labels for each image based on the first concept activation map corresponding to each encoded image. For example, assuming the input image is an orange cat and the concept label set includes multiple true concept labels such as "pointed ears", "yellow fur", "long ears", "long tail", "four legs", etc., the predicted concept labels output by the concept predictor may include multiple true concept labels such as "pointed ears", "yellow fur", "long tail", "four legs".
[0047] S23. The concept locator performs Gaussian masking on all first concept activation maps corresponding to each image sample to obtain multiple images that are related to the first concept activation maps. Figure 1A corresponding second concept activation map is generated, and the real concept label corresponding to each first concept activation map is assigned to the second concept activation map corresponding to the first concept activation map. In addition, all second concept activation maps corresponding to each image sample are spatially pooled to obtain the concept vector of the image.
[0048] To constrain each concept to be activated only in a local spatial region, restrictions need to be imposed on each first concept activation map. According to one embodiment of the invention, the first step is to find the region of the ground truth label corresponding to each first concept activation map within that first concept activation map. Then, other regions outside this region are masked to highlight the ground truth label. Specifically, since the first concept activation map is the spatial activation distribution of its corresponding ground truth label, it is only necessary to find the coordinates of the maximum value in each first concept activation map. The local region where these coordinates are located is the image that best matches the ground truth label corresponding to that first concept activation map. A Gaussian mask is constructed based on the coordinates of the maximum value in each first concept activation map. Finally, the constructed Gaussian mask is used to process the first concept activation map to obtain the second concept activation map corresponding to each first concept activation map.
[0049] According to an embodiment of the present invention, the second concept activation map corresponding to each first concept activation map is obtained by: constructing a Gaussian mask for each first concept activation map of each image sample, wherein the Gaussian mask is a two-dimensional matrix with the same size as the first concept activation map, and the value of each element in each Gaussian mask is determined by:
[0050]
[0051] ,
[0052] in, Indicates the index of the image sample. Indicates the index of the first concept activation graph. Indicates the row index of the Gaussian mask. The column index representing the Gaussian mask. This represents the total number of image samples in the training set. This represents the total number of first-concept activation maps corresponding to an image sample. This indicates the row number of the first-concept activation graph. This indicates the number of columns in the first-concept activation graph. Indicates the first The first image sample The first concept activation map of the Gaussian mask of the first concept activation map. Line number The values of the elements in the column. , The numbers represent the order of the numbers. The first image sample The first concept activates the row and column coordinates of the largest element in the graph. This represents a first preset parameter, which is a parameter configured according to the iteration round to control the value of each element in the Gaussian mask. The first concept activation map is processed using the Gaussian mask corresponding to each first concept activation map to obtain a second concept activation map corresponding to each first concept activation map. Specifically, the element in the Gaussian mask at the same coordinate is multiplied by the element in the first concept activation map to obtain the value at the same coordinate in the second concept activation map. For example, suppose the first concept activation map is... Then the Gaussian mask is also a 3×3 matrix. Let the Gaussian mask be... The final second concept activation graph is as follows It should be understood that the data in the examples above are for illustrative purposes only, and the actual data should be used in specific applications.
[0053] According to one embodiment of the present invention, the first preset parameter is configured in the following manner:
[0054]
[0055] in, This indicates the first preset parameter. This indicates the preset preheating cycle. Indicates the total number of iterations. Indicates the current iteration round. This represents the initial standard deviation of the preset Gaussian mask. This represents the final standard deviation of the preset Gaussian mask.
[0056] According to one embodiment of the present invention, the concept locator also needs to generate the concept vector of the image based on all the second concept activation maps corresponding to each image sample. Specifically, for an image sample, spatial pooling (global average pooling) is performed on all the second concept activation maps corresponding to it to obtain the concept vector of the image sample.
[0057] S24. The category predictor predicts and outputs the category label of each image sample based on the concept vector of that image sample.
[0058] S25. Calculate the cross-entropy loss between the predicted category label and the true category label, the cross-entropy loss between the predicted concept label and the true concept label, and the mean squared error loss between each first concept activation map and the corresponding second concept activation map using a preset loss function, and update the parameters in the concept predictor, concept locator, and feature encoder with all the calculated losses.
[0059] According to one embodiment of the present invention, the preset loss function is:
[0060]
[0061] in, This represents the predicted cross-entropy loss determined based on a preset cross-entropy loss function. This predicted cross-entropy loss includes the concept cross-entropy loss between the predicted concept label and the actual concept label, and the category cross-entropy loss between the predicted category label and the actual category label. This represents the mean squared error loss between the activation maps of the first and second concepts, determined based on a preset mean squared error loss function. This represents the weighting coefficient.
[0062] According to one embodiment of the present invention, the preset cross-entropy loss function is:
[0063]
[0064] in, This represents the total number of image samples in the training set. , The numbers represent the order of the numbers. The true and predicted concept labels of an image sample Indicates the first Image sample concept cross-entropy loss, , The numbers represent the order of the numbers. The true class label and the predicted class label of an image sample Indicates the first Class cross-entropy loss for image samples, This represents the weight of the predefined concept cross-entropy loss.
[0065] According to one embodiment of the present invention, the preset mean square error loss function is:
[0066]
[0067] in, This represents the total number of image samples in the training set. Indicates the first All first-concept activation maps corresponding to each image sample. Indicates the first All second-concept activation maps corresponding to each image sample This represents the mean square error function.
[0068] To better illustrate the beneficial effects of this invention, the inventors conducted comparative experiments. The experimental results are as follows: Figure 4 and Figure 5 As shown, where, Figure 4 This paper demonstrates the difference in concept localization performance between the interpretable image recognition system proposed in this invention and a traditional image recognition model (benchmark model) on the CUB bird fine-grained recognition dataset. The "concept activation L1 norm" represents the average activation area of the concept; a lower value indicates that the concept is more concentrated in the target region. The "human evaluation score" represents the average rating of the accuracy of the concept localization region obtained in user surveys; a higher value indicates that users are more satisfied with the model's output concept and corresponding localization region. Experimental results show that the interpretable image recognition system proposed in this invention has superior concept recognition and localization capabilities compared to the benchmark model, providing users with more accurate explanations for decision-making. References Figure 5 , Figure 5 The experimental data presented here demonstrates that the interpretable image recognition system proposed in this invention performs well in recognizing general scene categories (Places), general object categories (ImageNet), and fine-grained categories (CUB). The experimental data shows that the invention has good performance in general scene categories, general object categories, and fine-grained categories. When outputting the recognized category results, it can simultaneously output the key basis for decision-making, including the semantic concepts that constitute the categories and their spatial positions on the input image, demonstrating the good versatility of the method.
[0069] In summary, this invention introduces a concept predictor to ensure the accuracy of predicted concept labels, while utilizing a concept locator to constrain concept activation within specific regions of the image, thus achieving precise localization of key components. The joint optimization of semantic and spatial interpretation enables the model output to simultaneously possess intuitive semantic information and reliable spatial positioning information, thereby enhancing users' understanding and trust in the model's judgment criteria.
[0070] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.
[0071] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0072] Computer-readable storage media can be tangible devices that hold and store instructions for use by an instruction execution device. Computer-readable storage media can include, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.
[0073] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An explainable image recognition system for predicting an output of a class label of a specified image with explainable information, wherein, The interpretable information includes a plurality of concept labels and a key feature region map corresponding to each concept label, and the system comprises a feature encoder, a concept predictor, a concept locator and a category predictor, wherein: The feature encoder is configured to encode the image into a three-dimensional feature map; The concept predictor is configured with a concept label set composed of a plurality of real concept labels, and is configured to encode the three-dimensional feature map into a plurality of first concept activation maps with the same number of real concept labels in the concept label set, wherein each first concept activation map corresponds to a real concept label, and based on all the first concept activation maps corresponding to the image, a plurality of predicted concept labels of the image are predicted and output, wherein the plurality of predicted concept labels are a plurality of real concept labels in the concept label set that match the key features of the image; The concept locator is configured to mask other regions except the key feature region matching the real concept label of each first concept activation map to obtain a plurality of second concept activation maps corresponding to the first concept activation map, to configure the real concept label of each first concept activation map to the second concept activation map corresponding to the first concept activation map, and to perform spatial pooling on all the second concept activation maps to obtain a concept vector of the image, and to output the second concept activation map corresponding to each predicted concept label predicted by the concept predictor as a key feature region map; The category predictor is configured to predict and output a category label of the image based on the concept vector of the image.
2. An interpretable image recognition method, characterized by, The method comprises: Obtaining the interpretable image recognition system of claim 1 and the target image to be recognized; Using the obtained interpretable image recognition system to recognize the target image to predict a category label, a plurality of concept labels and a key feature region map corresponding to each predicted concept label of the target image.
3. A method for constructing the interpretable image recognition system of claim 1, characterized in that, The method comprises: S1, obtaining a training set and an initial interpretable image recognition model, wherein the training set comprises a plurality of image samples, each image sample is configured with a real category label and a plurality of real concept labels, wherein the real concept labels of all image samples form a non-redundant concept label set, and the initial interpretable image recognition model comprises a feature encoder, a concept predictor, a concept locator and a category predictor, wherein the concept predictor is configured with the concept label set in the obtained training set; S2, using each image sample in the obtained training set as input and using the predicted category label and the predicted concept label corresponding to each image sample as predicted output, the initial interpretable image recognition model is trained for multiple rounds to obtain a final interpretable image recognition system, wherein each round of iteration comprises: The feature encoder encodes each image sample in the training set into a three-dimensional feature map; The concept predictor encodes the three-dimensional feature map of each image sample into a plurality of first concept activation maps corresponding to the number of real concept labels in the concept label set and corresponding to the real concept labels one by one, and based on all the first concept activation maps corresponding to each image sample, a plurality of predicted concept labels of the image sample are predicted and output; Gaussian mask processing is performed on all the first concept activation maps corresponding to each image sample by the concept locator to obtain a plurality of second concept activation maps corresponding one-to-one to the first concept activation maps, a true concept label corresponding to each first concept activation map is configured to the second concept activation map corresponding to the first concept activation map, and spatial pooling is performed on all the second concept activation maps corresponding to each image sample to obtain a concept vector of the image; A class label of each image sample is predicted and output by the class predictor based on the concept vector of the image sample; A cross-entropy loss between the predicted class label and a true class label, a cross-entropy loss between the predicted concept label and a true concept label, and a mean square error loss between each first concept activation map and the corresponding second concept activation map are calculated by using a preset loss function, and parameters in the concept predictor, the concept locator and the feature encoder are updated based on all the calculated losses.
4. The method of claim 3, wherein, In step S2, Gaussian mask processing is performed on all the first concept activation maps corresponding to each image sample in the following manner: A Gaussian mask of each first concept activation map of each image sample is constructed, the Gaussian mask being a two-dimensional matrix with the same size as the first concept activation map, wherein the value of each element in each Gaussian mask is determined in the following manner: wherein, denotes an index of an image sample, denotes an index of a first concept activation map, denotes a row index of a Gaussian mask, denotes a column index of a Gaussian mask, denotes a total number of image samples in a training set, denotes a total number of first concept activation maps corresponding to one image sample, denotes a number of rows of a first concept activation map, denotes a number of columns of a first concept activation map, denotes a value of an element at a row and a column of a Gaussian mask of a first concept activation map of an image sample, , denotes a row coordinate and a column coordinate of a maximum element in a first concept activation map of an image sample, denotes a first preset parameter, the first preset parameter being a parameter configured according to an iteration round for controlling a size of each element value in a Gaussian mask; Each first concept activation map is processed with the corresponding Gaussian mask of the first concept activation map to obtain a second concept activation map corresponding to each first concept activation map.
5. The method of claim 4, wherein, The first preset parameter is configured in the following manner: wherein, represents a first preset parameter, represents a preset preheating round, represents a total iteration round, represents a current iteration round, represents a preset initial standard deviation of a Gaussian mask, represents a preset final standard deviation of a Gaussian mask.
6. The method of claim 3, wherein, In step S3, the preset loss function is: wherein, represents a predicted cross-entropy loss determined based on a preset cross-entropy loss function, the predicted cross-entropy loss including a concept cross-entropy loss between a predicted concept label and a true concept label, a class cross-entropy loss between a predicted class label and a true class label, represents a mean square error loss between the first concept activation map and the second concept activation map determined based on a preset mean square error loss function, represents a weight coefficient.
7. The method of claim 6, wherein, The preset cross-entropy loss function is: in, This represents the total number of image samples in the training set. , The numbers represent the order of the numbers. The true and predicted concept labels of an image sample Indicates the first Image sample concept cross-entropy loss, , The numbers represent the order of the numbers. The true class label and the predicted class label of an image sample Indicates the first Class cross-entropy loss for image samples, This represents the weight of the predefined concept cross-entropy loss.
8. The method of claim 6, wherein, The preset mean square error loss function is: wherein, denotes the total number of image samples in the training set, denotes all first concept activation maps corresponding to the denotes all second concept activation maps corresponding to the denotes the mean squared error function. 9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is executable by a processor to implement the steps of the method in any one of claims 2-8.
10. An electronic device, comprising: Comprise: One or more processors; And A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method in any one of claims 2-8 by executing the executable instructions.