A hierarchical feature interpretation classification network construction method based on a human visual system
By constructing a hierarchical feature interpretation classification network based on the human visual system, and combining a large language model and a visual language model, an automated hierarchical interpretation framework was realized. This solved the reliability and interpretability issues of black-box classification networks, detected malicious attacks at the feature level, and improved the security and transparency of deep neural networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-23
AI Technical Summary
Existing black-box classification network interpretation methods lack reliability and practicality. The single, crude post-inference interpretation cannot meet users' understanding needs, and traditional methods require additional concept-level annotation, which is time-consuming and laborious, and difficult to deploy and generalize.
We construct a hierarchical feature interpretation classification network based on the human visual system, which integrates large language models and visual language models. Through hierarchical natural language concepts and image patch concepts, we realize an automated hierarchical interpretation framework, divide the shallow-medium-deep feature channels of the convolutional classification model, and use the visual language model for mapping and alignment loss fine-tuning to generate multimodal classification decision interpretations.
It significantly reduces the cost of manual annotation, improves the understandability and granularity of the reasoning process, can detect malicious attacks at the feature level, provides clear and intuitive feature consistency comparisons, and enhances the security and transparency of deep neural networks.
Smart Images

Figure CN122263968A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image classification technology, specifically relating to a method for constructing a hierarchical feature interpretation classification network based on the human visual system. Background Technology
[0002] With the development of deep learning algorithms, an increasing number of image classification network architectures have emerged. These networks generally achieve performance metrics far exceeding those of traditional methods in relevant task contexts. However, this performance improvement is accompanied by a geometric increase in the number of network model parameters and their depth and width. Simultaneously, it has raised concerns among users regarding their reliability and decision security.
[0003] Therefore, much research on black-box explanations has begun to offer decision-making attributions or conceptual explanations for data-driven black-box models. However, most of these explanations are post-explanations; the model itself remains a black box to the user. A singular, coarse post-explanation can only provide users with a rough reference to the model's reasoning basis—"that's probably how it is." Even different users may have different understandings of the explanation, and their judgments about the model's reasoning basis may differ for the same explanation of the same sample. This can lead to a decrease in the reliability and practicality of the explanation methods.
[0004] Recent work has combined interpretable structures and black-box classification networks to explain and intervene in the decision-making of black-box classification networks. For example, it combines graph neural networks (GNNs) and knowledge distillation methods. (Graph Neural Network Paper Reference: https: / / doi.org / 10.1016 / j.aiopen.2021.01.001; Knowledge Distillation Paper Reference: https: / / doi.org / 10.48550 / arXiv.1503.02531). This paper presents a visual reasoning explanation framework that approximates black-box classification networks on some categories. It uses human-understandable reasoning logic based on an interpretable network structure to explain the reasoning process of the original black-box classification network. However, this approximation process may lose key information from the original black-box classification network, and local fitting may not accurately reproduce the reasoning process of the target black-box model. Furthermore, concept-based explanations often require additional concept-level annotations, which are time-consuming and labor-intensive. This may cause deployment and generalization difficulties for both self-explanatory and post-explanatory methods. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this invention aims to provide a hierarchical feature interpretation classification network construction method based on the human visual system. This method achieves a hierarchical interpretation framework that conforms to human visual perception patterns. It integrates large language models and visual language models, realizing a model-oriented hierarchical concept. It not only possesses full automation capabilities, significantly reducing manual annotation costs, but also improves the understandability of the reasoning process and the granularity of interpretation. Furthermore, based on a multimodal hierarchical concept structure, this invention supports the detection of malicious attacks on images at the feature level, overcoming the limitations of traditional pixel-level detection. It provides clear and intuitive feature consistency comparisons, offering a safer and more transparent application foundation for deep neural network classification models.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for constructing a hierarchical feature interpretation and classification network based on the human visual system includes the following steps: Step 1), construct a set of hierarchical natural language concepts and hierarchical image patch concepts that include color, texture, and shape; Step 2) By analyzing the convolutional class model, channel activation is performed on the hierarchical image patch concept set obtained in Step 1), and the shallow-medium-deep feature channels of the convolutional class model are divided. The shallow-medium-deep feature channels correspond to three different levels of features. Step 3), based on the hierarchical natural language concept set and visual language model in Step 1), map the corresponding level of natural language concepts to the shared vector space of the visual language model. At the same time, according to the activation channels divided in Step 2), extract the hierarchical feature map sequences of the shallow, middle and deep layers of the convolutional class model, remap and align the hierarchical text concept embeddings, and fine-tune the convolutional class model according to the alignment loss. Step 4) Based on the shared vector space of image patch concepts and natural language concepts, the convolution output mapping vectors of the shallow, medium and deep convolution outputs of the convolutional classification model are used to match the hierarchical concepts in the natural language concepts and image patch concepts sets to generate hierarchical multimodal classification decision explanations. Step 5) Based on the hierarchical multimodal classification decision interpretation in Step 4), the decision error of the convolutional classification model and the difference between the natural language concepts of color, texture, and shape matched by the corresponding erroneous sample and the visual features of the real category are compared to detect whether the sample has been maliciously attacked at the feature level.
[0007] The specific steps of step 1) are as follows: 1.1) Construct natural language prompt templates using LLMs based on categories from any image classification dataset as input. : , , , in Refers to the category name in the corresponding dataset ( ), iterate over all After categorizing, you can get the total. A hierarchical concept in natural language. For category The number of hierarchical natural language concepts generated, and the hierarchical natural language concept generation process are as follows: ; 1.2) The GroundedSAM detection model, which combines the Segment Anything Model and Grounding-DINO, is used to realize the concept of shape image patches of classified objects contained in image data samples. Extraction, for any image sample ,in Refers to the corresponding dataset, and These are the sample image and the sample image category label, It is a dataset The number of samples and the process of generating the shape image patch concept are as follows: , in Indicates the index input sample image Category tags The corresponding category name, then according to Sample image Foreground region separation is achieved by performing a frequency domain transformation on the foreground region using a Fourier transform function, followed by random perturbation of the phase parameters to scramble the image spatial information, and then obtaining... The process for obtaining the foreground color information is as follows: , , in and Let these represent the Fast Fourier Transform (FFT) function and its inverse FFT function, respectively. express Fourier transform of the mid-foreground region and These represent the amplitude and phase values of the frequency domain variable, respectively. It is a random phase perturbation; 1.3) Simultaneously based on Select Random cutting and splicing Foreground area size is Image blocks, writing , The calculation process is as follows: , in , and The input sample images are respectively Length and height; 1.4) Finally, the dataset For each sample image, hierarchical feature extraction is performed iteratively to obtain the concept of hierarchical image patches. : .
[0008] The specific method for step 2) is as follows: Using three different layered HVSCs as inputs, the pre-trained model calculates and statistically analyzes the channel activation values of the color, texture, and shape concepts of correctly classified samples in the shallow, middle, and deep layers of the convolutional module. The convolutional channel indices of each layer are sorted in descending order, and the first K, M, and L channels are selected as the feature processing channels for their respective layers. The convolutional channel partitioning process for color is as follows: , , in Refers to the convolution module of the pre-trained model The channel activation score matrix of a shallow convolutional layer. This represents the total number of convolutional layers in the pre-trained model. This indicates the total number of convolutional channels in this layer. This indicates that the K channels with the highest activation values are selected.
[0009] The convolution channel partitioning process for texture and shape is represented as follows: , , , , In the above formula Representative model number The feature map output from the convolutional layer is obtained through the following process: , in Refers to the pre-trained model from input to the first... The mapping function of the convolutional layer, and then according to... , and Get the corresponding , and The process is as follows: , , , in the above formula These represent the height and width of the feature map output by the current convolutional layer, respectively. To refer to the nonlinear function of the pre-trained model, that is... , .
[0010] The specific steps of step 3) are as follows: 3.1) Based on the color, texture, and shape channels obtained in step 2), , and Output feature maps of the activation channels of the pre-trained network's convolutional modules in shallow, middle, and deep layers. , and and using mapping functions Mapped to the same dimension space of the VLM encoder used ( , The length of the embedding vector is included, along with the input sample image. corresponding , and The image encoder of VLM is used to represent the natural language concepts at each level corresponding to the sample categories. ) and text encoder ( ), embedded into the same vector space, and utilizing the input samples Each level of image patch concept is matched and its corresponding optimal value is discovered. Natural Language Concepts , and Finally, mean squared error loss is used to align activation channel mapping vectors at different levels and fuse image patch concepts and natural language concept embedding vectors for the input sample image. The alignment loss is described as follows: , in It can be any linear layer or non-linear layer. , , and These are the hyperparameters of the various sub-losses in the alignment loss. It is a fusion function of natural language concept embedding vectors and image patch concept embedding vectors, such as the mean function. , To compare the loss function, represents the set batch size (Batch Size). Under this condition, make the current sample image The activation channel mapping vectors at each level and other categories (excluding subsets) simultaneously belong to the category labels. Other samples The corresponding activation channel mapping vectors should be as far apart as possible to ensure the sparsity of the mapping vectors; 3.2) Use Compared to the loss, given the set batch size, the current sample... The activation channel mapping vectors at each level and other categories (excluding subsets) simultaneously belong to the category labels. Other samples The corresponding activation channel mapping vectors should be as far apart as possible to ensure the sparsity of the mapping vectors. The calculation process is as follows: , , , in, This is the similarity score matrix of the batch samples. To exclude samples Self-indexed similarity score, As a unit array, This is the matrix of positive and negative samples in the current batch, i.e.: , in That is, the class label vector of the current batch of samples. The number of categories in the dataset; 3.3) To ensure that the model's classification inference process remains unchanged during alignment, the class likelihood value output by the original pre-trained model is used to align the current likelihood value, i.e.: , in Refers to the nonlinear function of the original pre-trained model. Refers to the nonlinear function of the pre-trained model being aligned and fine-tuned, above. and These represent the input batch sample images and their corresponding batch sample labels, respectively.
[0011] The specific steps of step 4) are as follows: 4.1) By aligning and fine-tuning the classification model, mapping vectors for color, texture, and shape are obtained from the shallow, middle, and deep layers of the convolutional module, respectively. Based on the mapping vectors at different levels, similarity matching searches are performed in the corresponding natural language concept space and image patch concept space to obtain hierarchical concept interpretations. , and For the input sample image The process is as follows: , , , in The function represents a matching function for the concept of cosine similarity between vectors. That is, the input sample obtained in step 2). of , and , and These refer to the text encoder and image encoder in a visual language model, respectively. That is, the remapping function constructed using linear or nonlinear layers in step 3). and That is, the hierarchical natural language concepts and image patch concepts obtained in step 1); 4.2) Input the mapping vectors of each level in the same space and the embedding vectors of natural language concept sets / image patch concepts. After matching, obtain the natural language concept / image patch concept that is most similar to the mapping vector.
[0012] The specific method for step 5) is as follows: Interpretation based on the color, texture, and shape concepts output by the model ( ), and the model's inference and classification results Compared with the feature extracted using the hierarchical feature extraction module Layered image patch concept If the conceptual interpretation of an image is inconsistent with the concept of hierarchical image patches, it may be vulnerable to attack. The attacked feature level corresponds to the inconsistent concept. .
[0013] An electronic device includes a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor, when executing the program stored in the memory, implements the steps of the method described above.
[0014] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0015] The beneficial effects of this invention are: (1) This invention divides the convolution channels of the convolutional classification network (black box) according to the three main components of human visual perception: color, texture and shape, so that the convolutional blocks of the model itself have self-interpretive ability.
[0016] (2) This invention combines a large language model to generate hierarchical natural language concepts, and the generation of image patch concepts is also fully automatic for a given dataset based on the hierarchical feature extraction module, which greatly reduces the manual and time costs required for concept annotation.
[0017] (3) The visual language model and multimodal, hierarchical concepts combined in this invention provide users with a more understandable and finer-grained explanation of the reasoning process of convolutional classification, and based on this explanation, image malicious attack detection at the feature level can be achieved. Attached Figure Description
[0018] Figure 1 Framework diagram of a hierarchical feature interpretation and classification network construction method based on the human visual system.
[0019] Figure 2 A schematic diagram illustrating the layered features. Detailed Implementation
[0020] The present invention will now be described in further detail with reference to the accompanying drawings.
[0021] like Figure 1 As shown, a method for constructing a hierarchical feature interpretation classification network based on the human visual system specifically includes the following steps: Step 1), construct a hierarchical set of natural language concepts and image patch concepts containing color, texture, and shape; 1.1) Using LLMs to classify arbitrary image datasets The categories in the text are used as input to construct natural language prompts: , What is the shape of the {object}? , What color is the {object}? , What does the texture of an {object} look like? in Refers to the category name in the corresponding dataset ( ), iterate over all After categorizing, you can get the total. A hierarchical concept in natural language. For category The number of hierarchical natural language concepts generated, and the hierarchical natural language description generation process are as follows: ; 1.2) The GroundedSAM detection model, which combines the Segment Anything Model and Grounding-DINO, is used to realize the concept of shape image patches in the corresponding data samples. Extraction, for any image sample ,in Refers to the corresponding dataset, and These are the sample image and the sample image category label, It is a dataset The number of samples and the process of generating the shape image patch concept are as follows: , Next according to Sample image Foreground region separation is achieved by performing a frequency domain transformation on the foreground region using a Fourier transform function, followed by random perturbation of the phase parameters to scramble the image spatial information, and then obtaining... The process for obtaining the foreground color information is as follows: , , in and Let these represent the Fast Fourier Transform (FFT) function and its inverse FFT function, respectively. express Fourier transform of the mid-foreground region and These represent the amplitude and phase values of the frequency domain variable, respectively. It is a random phase perturbation; 1.3) Simultaneously based on Select Random cutting and splicing Foreground area size is Image blocks, in which , and The input sample images are respectively Length and height, The calculation process is as follows: , in This represents the image patch cropping function. This represents a function for randomly stitching together image patches; 1.4) Finally, the dataset For each sample image, hierarchical feature extraction is performed iteratively to obtain the concept of hierarchical image patches: , Among them is It is a dataset The number of samples in The index of the input image sample; This step constructs a multimodal, fine-grained hierarchical concept for any image classification dataset to divide the convolution channels of different levels (shallow, medium, and deep) of the aligned convolutional classification model, providing a human-understandable hierarchical data foundation and enhancing model interpretability.
[0022] Step 2) By analyzing the channel activations on the hierarchical image patch concept set obtained in Step 1) of the pre-trained convolutional class model, the shallow-medium-deep channels of the pre-trained convolutional class model are divided, corresponding to three different levels of features. Using three different layered HVSCs as inputs, the pre-trained model calculates and statistically analyzes the channel activation values of the color, texture, and shape concepts of correctly classified samples in the shallow, middle, and deep layers of the convolutional module. The convolutional channel indices of each layer are sorted in descending order, and the first K, M, and L channels are selected as the feature processing channels for their respective layers. The convolutional channel partitioning process for color is as follows: , , in Refers to the convolution module of the pre-trained model The channel activation score matrix of a shallow convolutional layer. This represents the total number of convolutional layers in the pre-trained model. This indicates the total number of convolutional channels in this layer. This indicates selecting the K channels with the highest activation values; the definitions of parameters N, i, A, etc., need to be completed. Similarly, the convolution channel partitioning process for texture and shape is represented as follows: , , , , In the above formula Representative model number The feature map output from the convolutional layer is obtained through the following process: , in Refers to the pre-trained model from input to the first... The mapping function of the convolutional layer, and then according to... , and The corresponding , and The process is as follows: , , , In the above formula These represent the height and width of the feature map output by the current convolutional layer, respectively. To refer to the nonlinear function of the pre-trained model, that is... , This step uses the hierarchical concept set from step 1) as the data foundation to divide the convolutional classification model into shallow (corresponding to color concepts), mid-layer (corresponding to texture concepts), and deep (corresponding to shape concepts) channels. This refines the concept feature extraction function of the convolutional module from shallow to deep, providing support for building hierarchical concept interpretation and feature-level malicious attack detection in subsequent steps. Step 3), based on the different levels of natural language concept sets and visual language models from step 1), maps the corresponding level concepts to the shared vector space. At the same time, according to the activation channels divided in step 2), it extracts the hierarchical feature map sequences of the shallow, mid, and deep layers of the convolutional classification model and remaps and aligns the hierarchical text concept embeddings. The convolutional classification model is then fine-tuned based on the alignment loss. 3.1) Based on the activation channels defined in step 2) , and Output feature maps of the activation channels of the pre-trained network's convolutional modules in shallow, middle, and deep layers. , and and using mapping functions Remapping embeddings into the same-dimensional space as the VLM encoder used ( , The length of the embedding vector is included, along with the input samples obtained in step 1). corresponding , and Natural language concepts at various levels corresponding to sample categories ( The image encoders using VLM are respectively used. ) and text encoder ( ), embedded into the same vector space, and utilizing the input samples Each level of image patch concept is matched and its corresponding optimal value is discovered. Natural Language Concepts , and Finally, mean squared error loss is used to align activation channel mapping vectors at different levels and fuse image patch concepts and natural language concept embedding vectors for the input sample. The alignment loss is described as follows: , in , , and These are the hyperparameters of the various sub-losses in the alignment loss. It is a fusion function of natural language concept embedding vectors and image patch concept embedding vectors, such as the mean function. , and These refer to the text encoder and image encoder in a visual language model, respectively. It can be any linear layer or non-linear layer. 3.2) Use the index of the input image sample; Compared to the loss, given the set batch size, the current sample... The activation channel mapping vectors at each level and other categories (excluding subsets) simultaneously belong to the category labels. Other samples The corresponding activation channel mapping vectors should be as far apart as possible to ensure the sparsity of the mapping vectors. The calculation process is as follows: , , , in, This is the similarity score matrix of the batch samples. To exclude samples Self-indexed similarity score, As a unit array, This is the positive and negative sample matrix of the current batch, i.e. ; 3.3) To ensure that the model's classification inference process remains unchanged during alignment, the class likelihood value output by the original pre-trained model is used to align the current likelihood value, i.e.: , in Refers to the nonlinear function of the original pre-trained model. Refers to the nonlinear function of the pre-trained model being aligned and fine-tuned, above. and These represent the input batch sample images and their corresponding batch sample labels, respectively. Based on the hierarchical concept set in step 1) and the shallow-medium-deep convolution activation channels divided in step 2), the activation channels of different levels of convolution modules and the natural language and image patch concept embedding vectors are aligned using a visual language model to enhance the feature extraction capability of the corresponding channels, improve the model's generalization ability, and provide support for the construction of hierarchical concept interpretation in subsequent steps.
[0023] Step 4), such as Figure 2 As shown, based on the image patch concepts and natural language concept descriptions generated in step 1) based on the Human Visual System (HVS), and the shared vector space provided by the visual language model, the feature map sequences output by the first K, M, and L activated channels of the convolutional classification model in step 3) are remapped to find and match the hierarchical concepts (color-related concept set, texture-related concept set, and shape-related concept set) in the natural language concept and image patch concept set. Finally, a hierarchical concept explanation based on HVS is generated. The inactive convolutional channels in each layer of the model are regarded as residual channels, and other information of the input image is retained and passed to the next layer for processing. The model fuses the HVS features and residual features of all layers in the final linear layer for classification. 4.1) By aligning and fine-tuning the classification model in step 3), mapping vectors for color, texture, and shape can be obtained from the shallow, middle, and deep layers of the convolutional module, respectively. Based on the mapping vectors at different levels, similarity matching searches are performed in the natural language concept space and image patch concept space of the corresponding levels in step 1) to obtain hierarchical concept interpretations. , and For input samples The process is as follows: , , , in The function represents a matching function for the concept of cosine similarity between vectors. That is, the input sample obtained in step 2). of , and , and These refer to the text encoder and image encoder in a visual language model, respectively. That is, the remapping function constructed using linear or nonlinear layers in step 3). and That is, the hierarchical natural language concepts and image patch concepts obtained in step 1). and Corresponding to Types of natural language concept interpretation and image patch concept interpretation; 、 Parameter definition 4.2) Input the mapping vectors and natural language concept set embeddings / image patch concept set embeddings at each level in the same space, and obtain the natural language concept / image patch concept most similar to the mapping vector after matching. This step matches the feature maps output by the convolutional channels at different levels divided in step 2) with the hierarchical natural language concepts and image patch concepts in step 1) based on the shared vector space of the visual language model. This provides natural language and image patch concept explanations in the shallow, medium, and deep activation channels of the pre-trained model, respectively, enhancing the decision interpretation capability of the convolutional classification model and providing support for malicious attack detection at the image feature level in subsequent steps.
[0024] Step 5): Based on the hierarchical multimodal classification decision interpretation in Step 4), by analyzing the decision errors of the convolutional classification model and comparing the natural language concepts and image patch concepts of color, texture, and shape matched with the corresponding erroneous samples with the differences in visual features of the true category, it detects whether the sample has been subjected to malicious attacks at the feature level; based on the color, texture, and shape concept interpretations output by the model in Step 4... ), and the model's inference and classification results Compared with the feature extracted using the hierarchical feature extraction module Layered image patch concept If the conceptual interpretation of an image is inconsistent with the concept of hierarchical image patches, it may be vulnerable to attack. The attacked feature level corresponds to the inconsistent concept. .
[0025] The hierarchical concept construction method based on the Human Vision System (HVS) is a general paradigm that generates a set of natural language concepts and image patch concepts containing color, texture, and shape features based on large language models (LMs) and hierarchical feature extraction modules, according to a classification dataset. The convolutional channel layering method based on HVS features inputs the concept of layered image blocks into the pre-trained convolutional classification model to obtain the channel activations of the shallow, middle and deep layers of the network model, and processes the color, texture and shape features corresponding to the first K, M and L channels respectively. The cross-modal concept alignment method based on the Vision Language Model (VLM) remaps the feature maps of the corresponding activation channels of the shallow, middle and deep layers of the pre-trained convolutional integral model to the vector embedding space of the VLM, while aligning the corresponding hierarchical natural language concepts, and fine-tunes the pre-trained convolutional integral model according to the alignment constraint loss. The hierarchical interpretation generation method of convolutional class model based on the shared vector space of multimodal concept set refers to the process of matching the corresponding concept interpretations in the natural language concept set of color, texture and shape and the image patch concept set, respectively, based on the embedding vectors obtained by remapping the feature outputs of the shallow, middle and deep layers of the convolutional class model after alignment fine-tuning. A malicious attack detection method based on hierarchical fine-grained classification decision interpretation of image features detects whether an input sample image is maliciously attacked at the HVS feature level by generating hierarchical feature interpretations, which include image patch concepts of color, texture and shape, as well as natural language concept interpretations, and combining them with misclassification decisions of input samples.
[0026] Convolutional classification models, any Convolutional Neural Network (CNN) classification model, such as ResNet-50, VGG-18, and MobileNet; A pre-trained model refers to a convolutional classification model trained on arbitrary data and loaded with the corresponding weight parameters. The human visual system (HVS) is a framework of human visual perception mainly composed of three main features: color, texture, and shape. Large Language Models (LLMs) refer to pre-trained generative models trained on large-scale data, possessing rich prior knowledge, and highly consistent with human cognitive consensus. Generative models, generative task models, mainly include categories such as text-to-text, text-to-image, image-to-image, and image-to-text; The hierarchical feature extraction module extracts color, texture, and shape image patch features of data samples based on superpixel segmentation methods (such as Simple Linear Iterative Clustering, SLIC), Fourier transform, and semantic segmentation. The concept of layered feature image patches, which include visual image patches with color, texture, and shape; Layered natural language concepts, including natural language descriptions of color, texture, and shape; Convolutional channels refer to the convolutional kernels (operators) in a convolutional block of a neural network. For example, if the input image has RGB 3 channels, after... After the convolutional block of channels, the output feature map channels are ; Feature maps are the feature outputs of the intermediate layers of the convolutional modules in a convolutional neural network. Channel activation: For any input and corresponding output, in a convolutional neural network, if the mean of the feature map of the output of one convolutional channel is greater than the activation threshold, then that convolutional channel is activated at the corresponding output for that input.
[0027] The method for constructing the Human Vision System Concept (HVSC) based on the human visual system, wherein HVSC is composed of hierarchical natural language concepts ( ) and the concept of image patches ( The system consists of two parts: the former contains category-specific natural language descriptions of color, texture, and shape generated by LLMs using prompt templates for the corresponding dataset; the latter contains image patches of color, texture, and shape of samples from the corresponding dataset extracted by a hierarchical feature extraction module. This invention utilizes the division of the convolutional channels of the convolutional classification network (black box) according to the three main components of human visual perception—color, texture, and shape—to give the model's convolutional blocks self-interpretive capabilities. Furthermore, based on the progressive nature and feature fusion characteristics of convolutional neural network feature processing, the features of the three levels are aligned in the shallow, middle, and deep layers of the model's convolutional modules, respectively, thereby generating corresponding hierarchical interpretations at different stages of model feature extraction. Compared to single-level interpretation methods, such as Grad-Cam and CRAFT, the hierarchical interpretation of this invention is more consistent with human visual perception and recognition patterns.
[0028] This invention combines a large language model to generate hierarchical natural language concepts, and the generation of image patch concepts is also fully automatic for a given dataset based on the hierarchical feature extraction module, which greatly reduces the manual and time costs required for concept annotation.
[0029] This invention combines a visual language model with multimodal and hierarchical concepts to provide users with a more understandable and finer-grained explanation of the reasoning process of convolutional classification models. Based on this explanation, feature-level image malicious attack detection can be achieved. Typically, image malicious attack detection targets the pixel level, while feature attacks based on deep neural networks are often difficult to identify. This invention's hierarchical features, combined with the concept of hierarchical image patches and corresponding natural language descriptions, provide users with an intuitive comparison of classification feature consistency, thereby achieving efficient image feature-level malicious attack detection.
[0030] The present invention also includes an electronic device comprising a memory and a processor, the memory for storing various computer program instructions, and the processor for executing the computer program instructions to complete all or part of the above steps; the electronic device can communicate with one or more external devices, and can also communicate with one or more devices that enable a user to interact with the electronic device, and / or with any device that enables the electronic device to communicate with one or more other computing devices; the electronic device can also communicate with one or more networks (e.g., local area networks, wide area networks, and / or public networks) via a network adapter.
[0031] The present invention also includes a computer-readable storage medium storing a computer program that can be executed by a processor. The computer-readable storage medium may include, but is not limited to, magnetic storage devices, optical discs, digital multifunction disks, smart cards, and flash memory devices. Furthermore, the readable storage medium described in the present invention can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" includes, but is not limited to, wireless channels and various other media (and / or storage media) capable of storing, containing, and / or carrying code and / or instructions and / or data.
Claims
1. A method for constructing a hierarchical feature interpretation and classification network based on the human visual system, characterized in that, Includes the following steps: Step 1), construct a set of hierarchical natural language concepts and hierarchical image patch concepts that include color, texture, and shape; Step 2) By analyzing the convolutional class model, channel activation is performed on the hierarchical image patch concept set obtained in Step 1), and the shallow-medium-deep feature channels of the convolutional class model are divided. The shallow-medium-deep feature channels correspond to three different levels of features. Step 3), based on the hierarchical natural language concept set and visual language model in Step 1), map the corresponding level of natural language concepts to the shared vector space of the visual language model. At the same time, according to the activation channels divided in Step 2), extract the hierarchical feature map sequences of the shallow, middle and deep layers of the convolutional class model, remap and align the hierarchical text concept embeddings, and fine-tune the convolutional class model according to the alignment loss. Step 4) Based on the shared vector space of image patch concepts and natural language concepts, the convolution output mapping vectors of the shallow, medium and deep convolution outputs of the convolutional classification model are used to match the hierarchical concepts in the natural language concepts and image patch concepts sets to generate hierarchical multimodal classification decision explanations. Step 5) Based on the hierarchical multimodal classification decision interpretation in Step 4), the decision error of the convolutional classification model and the difference between the natural language concepts of color, texture, and shape matched by the corresponding erroneous sample and the visual features of the real category are compared to detect whether the sample has been maliciously attacked at the feature level.
2. The method for constructing a hierarchical feature interpretation and classification network based on the human visual system according to claim 1, characterized in that, The specific steps of step 1) are as follows: 1.1) Construct natural language prompt templates using LLMs based on categories from any image classification dataset as input. : , , , in Refers to the category name in the corresponding dataset, iterating over all After categorizing, you can get the total. A hierarchical concept in natural language. For category The number of hierarchical natural language concepts generated, and the hierarchical natural language concept generation process are as follows: ; 1.2) The GroundedSAM detection model, which combines the Segment Anything Model and Grounding-DINO, is used to realize the concept of shape image patches of classified objects contained in image data samples. Extraction, for any image sample ,in Refers to the corresponding dataset, and These are the sample image and the sample image category label, It is a dataset The number of samples and the process of generating the shape image patch concept are as follows: , in Indicates the index input sample image Category tags The corresponding category name, then according to Sample image Foreground region separation is achieved by performing a frequency domain transformation on the foreground region using a Fourier transform function, followed by random perturbation of the phase parameters to scramble the image spatial information, and then obtaining... The process for obtaining the foreground color information is as follows: , , in and Let these represent the Fast Fourier Transform (FFT) function and its inverse FFT function, respectively. express Fourier transform of the mid-foreground region and These represent the amplitude and phase values of the frequency domain variable, respectively. It is a random phase perturbation; 1.3) Simultaneously based on Random cutting and splicing Foreground area size is Image blocks, writing , The calculation process is as follows: , in , and The input sample images are respectively Length and height; 1.4) Finally, the dataset For each sample image, hierarchical feature extraction is performed iteratively to obtain the concept of hierarchical image patches. : 。 3. The method for constructing a hierarchical feature interpretation and classification network based on the human visual system according to claim 2, characterized in that, The specific method for step 2) is as follows: Using three different layered HVSCs as inputs, the pre-trained model calculates and statistically analyzes the channel activation values of the color, texture, and shape concepts of correctly classified samples in the shallow, middle, and deep layers of the convolutional module. The convolutional channel indices of each layer are sorted in descending order, and the first K, M, and L channels are selected as the feature processing channels for their respective layers. The convolutional channel partitioning process for color is as follows: , , in Refers to the convolution module of the pre-trained model The channel activation score matrix of each convolutional layer This represents the total number of convolutional layers in the pre-trained model. This indicates the total number of convolutional channels in this layer. This indicates that the K channels with the highest activation values are selected.
4. The method for constructing a hierarchical feature interpretation and classification network based on the human visual system according to claim 3, characterized in that, The convolution channel partitioning process for texture and shape is represented as follows: , , , , In the above formula Representative model number The feature map output from the convolutional layer is obtained through the following process: , in Refers to the pre-trained model from input to the first... The mapping function of the convolutional layer, and then according to... , and Get the corresponding , and The process is as follows: , , , in the above formula These represent the height and width of the feature map output by the current convolutional layer, respectively. To refer to the nonlinear function of the pre-trained model, that is... , .
5. The method for constructing a hierarchical feature interpretation and classification network based on the human visual system according to claim 4, characterized in that, The specific steps of step 3) are as follows: 3.1) Based on the color, texture, and shape channels obtained in step 2), , and Output feature maps of the activation channels of the pre-trained network's convolutional modules in shallow, middle, and deep layers. , and and using mapping functions Mapping to the same-dimensional space as the VLM encoder used, while simultaneously mapping the input sample image. corresponding , and The image encoder of VLM is used to represent the natural language concepts at each level corresponding to the sample categories. ) and text encoder ( Embedded into the same vector space, and utilizing the input sample image Each level of image patch concept is matched and its corresponding optimal value is discovered. Natural Language Concepts , and Finally, mean squared error loss is used to align activation channel mapping vectors at different levels and fuse image patch concepts and natural language concept embedding vectors for the input sample. The alignment loss is described as follows: , in It is an arbitrary linear / nonlinear layer. , , and These are the hyperparameters of the various sub-losses in the alignment loss. It is a fusion function of natural language concept embedding vectors and image patch concept embedding vectors, and a mean function. , The contrast loss function represents the loss function that makes the current sample image, given a set batch size, perform the following: The activation channel mapping vectors at each level and other categories (excluding subsets) simultaneously belong to the category labels. Other samples The corresponding activation channel mapping vectors should be as far apart as possible to ensure the sparsity of the mapping vectors; 3.2) Use Comparing the losses, The calculation process is as follows: , , , in, This is the similarity score matrix of the batch samples. To exclude samples Self-indexed similarity score, As a unit array, This is the matrix of positive and negative samples in the current batch, i.e.: , in That is, the class label vector of the current batch of samples. The number of categories in the dataset; 3.3) Align the current likelihood value with the class likelihood value output by the original pre-trained model, i.e.: , in Refers to the nonlinear function of the original pre-trained model. Refers to the nonlinear function of the pre-trained model being aligned and fine-tuned, above. and These represent the input batch sample images and their corresponding batch sample labels, respectively.
6. The method for constructing a hierarchical feature interpretation classification network based on the human visual system according to claim 5, characterized in that, The specific steps of step 4) are as follows: 4.1) By aligning and fine-tuning the classification model, mapping vectors for color, texture, and shape are obtained from the shallow, middle, and deep layers of the convolutional module, respectively. Based on the mapping vectors at different levels, similarity matching searches are performed in the corresponding natural language concept space and image patch concept space to obtain hierarchical concept interpretations. , and For the input sample image The process is as follows: , , , in The function represents a vector similarity matching function. That is, the input sample obtained in step 2). of , and , and These refer to the text encoder and image encoder in a visual language model, respectively. That is, the remapping function constructed using linear or nonlinear layers in step 3). and That is, the hierarchical natural language concepts and image patch concepts obtained in step 1); 4.2) Input the mapping vectors of each level in the same space and the embedding vectors of natural language concept sets / image patch concepts. After matching, obtain the natural language concept / image patch concept that is most similar to the mapping vector.
7. The method for constructing a hierarchical feature interpretation classification network based on the human visual system according to claim 6, characterized in that, The specific method for step 5) is as follows: Interpretation based on the color, texture, and shape concepts output by the model ( ), and the model's inference and classification results Compared with the feature extracted using the hierarchical feature extraction module Layered image patch concept If the conceptual interpretation of an image is inconsistent with the concept of hierarchical image patches, it may be vulnerable to attack. The attacked feature level corresponds to the inconsistent concept. .
8. An electronic device, characterized in that, The device includes a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor, when executing the program stored in the memory, implements the steps of the method described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-7.