Explanatable classification method and device, computer equipment and storage medium

By introducing a fully connected layer architecture with periodic feature perturbation and multi-head attention mechanism into financial and medical image classification models, the problems of high accuracy and interpretability of the models under complex background interference and noise are solved, achieving more accurate classification results and intuitive decision display.

CN120852865APending Publication Date: 2025-10-28PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510956707.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-28

Smart Images

  • Figure CN120852865A_ABST
    Figure CN120852865A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image classification of financial and medical scenes, and discloses an interpretable classification method and device, computer equipment and a storage medium. The method comprises the following steps: performing feature extraction on an input image to obtain image features; performing periodic disturbance processing on the image feature vector to obtain disturbance features; performing attention perturbation modulation processing on the perturbation features to generate dynamic change optimization features reflecting feature importance; aggregating the feature important disturbance trajectories of the optimized features to generate a visual heat map; and mapping the optimized features to category probability distribution to output an image classification result. The invention provides an innovative full-connection layer architecture for image classification application of financial and medical scenes, and realizes double improvement of performance and interpretability in an image classification task by combining periodic feature disturbance with an attention mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology in financial and medical scenarios, and in particular to an interpretable classification method, apparatus, computer equipment, and storage medium. Background Technology

[0002] In key image classification processing technologies in critical fields such as finance and healthcare, performance improvements in critical image classification tasks, such as financial document recognition (e.g., bills, contracts, signature verification) and medical image analysis (e.g., X-rays, CT scans, pathological slide quality inspection), have long relied on increasing the complexity of model architectures and expanding the scale of data. However, this inevitably brings challenges such as a dramatic increase in computational costs and the "black box" nature of the classification model's decision-making process.

[0003] The fully connected layer, which forms the core of traditional classification models, suffers from static feature processing modes that are ill-suited to the blurring, distortion, and background interference commonly found in financial images, or the complex anatomical variations, diverse lesion morphologies, and subtle pathological features in medical images. This makes the model sensitive to noise, and its decision-making basis difficult to trace and understand, which is particularly prominent in scenarios requiring high credibility and interpretability, such as financial risk control and medical diagnosis.

[0004] Existing research mainly attempts to improve the model through two approaches: first, by introducing attention mechanisms (such as Transformer and Squeeze-and-Excitation modules) to dynamically adjust feature weights, enabling the model to focus on key fields on financial documents or on suspected lesion areas in medical images; second, by enhancing the robustness of the model through perturbations (such as adversarial training and MixUp), in order to improve its ability to cope with financial fraud forgery attacks or common noise and artifacts in medical images.

[0005] Regarding interpretability, while gradient-based visualization methods (such as Grad-CAM) can generate heatmaps, their static nature cannot reflect the dynamic changes in feature importance. They generally face the dilemma of balancing high-precision classification results with clear and reliable visual interpretation. Summary of the Invention

[0006] This invention provides an interpretable classification method, apparatus, computer device, and medium, aiming to solve the technical problem of how to achieve a dual improvement in performance and understandability of existing classification models.

[0007] Firstly, an interpretable classification method is provided, including:

[0008] Feature extraction is performed on the input image to obtain image features;

[0009] The image feature vector is periodically perturbed to obtain perturbed features;

[0010] The perturbation features are subjected to attention perturbation modulation processing to generate optimized features that reflect the dynamic changes in the importance of the features;

[0011] The feature-important perturbation trajectories of the optimized features are aggregated to generate a visual heatmap;

[0012] The optimized features are mapped to a category probability distribution to output the image classification result.

[0013] Secondly, an interpretable classification device is provided, comprising:

[0014] The feature extraction module is used to extract features from the input image to obtain image features;

[0015] The feature perturbation module is used to periodically perturb the image feature vector to obtain perturbation features;

[0016] The feature modulation module is used to perform attention perturbation modulation processing on the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features;

[0017] The heatmap generation module is used to aggregate the feature-important perturbation trajectories of the optimized features and generate a visual heatmap.

[0018] The classification output module is used to map the optimized features to a category probability distribution to output the image classification result.

[0019] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described interpretable classification method.

[0020] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described interpretable classification method.

[0021] In the aforementioned interpretable classification method, apparatus, computer device, and storage medium, image features are obtained by extracting features from the input image; periodically perturbing the image feature vectors to obtain perturbed features; attention perturbation modulation processing is applied to the perturbed features to generate optimized features reflecting dynamic changes in feature importance; the feature importance perturbation trajectories of the optimized features are aggregated to generate a visual heatmap; and the optimized features are mapped to a category probability distribution to output the image classification result. In this invention, for image classification applications in financial and medical scenarios, an innovative fully connected layer architecture is proposed. By combining periodic feature perturbation with an attention mechanism, a dual improvement in performance and interpretability is achieved in image classification tasks. Specifically, the core of this invention lies in proposing an innovative fully connected layer architecture that combines periodic perturbation with a multi-head attention mechanism to perform periodic feature perturbation and context-dependent perturbation modulation processing. This allows the model to continuously optimize its feature representation during inference, thereby obtaining more accurate classification results. Simultaneously, an intuitive feature importance heatmap is generated through the perturbation trajectory, providing a clear visualization of the decision-making basis. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of an application environment for an interpretable classification method according to an embodiment of the present invention;

[0024] Figure 2 This is a flowchart illustrating an interpretable classification method in one embodiment of the present invention;

[0025] Figure 3 yes Figure 1 A schematic diagram of a specific implementation method for step S203;

[0026] Figure 4 yes Figure 3 A schematic diagram of a specific implementation of step S301;

[0027] Figure 5 This is a schematic diagram of the structure of a classification device in one embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;

[0029] Figure 7This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] The interpretable classification method provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can receive the input image from the client, extract features from the input image to obtain image features; perform periodic perturbation processing on the image feature vector to obtain perturbed features; perform attention perturbation modulation processing on the perturbed features to generate optimized features that reflect the dynamic changes in feature importance; aggregate the feature importance perturbation trajectories of the optimized features to generate a visual heatmap; and map the optimized features to a category probability distribution to output the image classification result. In this invention, for image classification applications in financial and medical scenarios, an innovative fully connected layer architecture is proposed. By combining periodic feature perturbation with an attention mechanism, a dual improvement in performance and interpretability in image classification tasks is achieved. Specifically, the core is the proposal of an innovative fully connected layer architecture that combines periodic perturbation with a multi-head attention mechanism to perform periodic feature perturbation and context-dependent perturbation modulation processing, enabling the model to continuously optimize its feature representation during inference, thereby obtaining more accurate classification results; at the same time, it also generates an intuitive feature importance heatmap through perturbation trajectories, providing a clear visualization of the decision-making basis. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will now be described in detail through specific embodiments.

[0032] Please see Figure 2 As shown, Figure 2 A flowchart illustrating an interpretable classification method provided in an embodiment of the present invention includes the following steps:

[0033] S201. Extract features from the input image to obtain image features;

[0034] In step S201, a convolutional neural network (CNN) structure can be used to extract features from the input image. This CNN structure contains multiple convolutional layers and pooling layers, aiming to extract high-level feature representations from the input image. Specifically, the input image is processed sequentially through each convolutional and pooling layer. The convolutional layers extract local features of the image through convolution operations, while the pooling layers downsample the output of the convolutional layers to reduce the dimensionality of the data while retaining important features. Through the alternating processing of convolutional and pooling layers, high-level features of the image are gradually abstracted, providing strong feature support for subsequent classification tasks.

[0035] For example, in input image processing in financial scenarios, feature extraction can be performed on financial documents such as bills and reports to accurately capture key information such as numbers and text, providing precise feature vectors for subsequent classification. Similarly, in input image processing in medical scenarios, feature extraction can be performed on medical images such as X-rays and CT scans to capture key features such as lesions and organ structures, providing strong support for the classification of medical images.

[0036] S202. Periodically perturb the image feature vector to obtain perturbation features;

[0037] In step S202, periodic perturbation processing refers to applying a perturbation to the image feature vector that changes according to a predetermined period. This perturbation can be a sine wave, cosine wave, or other form of periodic signal. By adjusting parameters such as the amplitude, frequency, and phase of the perturbation, different degrees of influence can be generated on the image feature vector. The purpose of periodic perturbation processing is to introduce certain noise or changes to observe the response of the classification model under different feature vectors, thereby revealing the basis and logic of the model's decision-making and improving the interpretability of the classification results. For example, in the periodic perturbation processing of input images in financial scenarios, periodic perturbation processing can be applied to the feature vectors of images such as financial bills and reports. The feature perturbation module generates perturbation signals in the form of sine waves, cosine waves, etc., and finely adjusts the image feature vectors according to preset amplitude, frequency, and phase parameters. Such processing can not only simulate the small changes in image features in the real environment, but also reveal the decision-making logic of the classification model when facing these changes, thereby improving the interpretability of the classification results in financial scenarios.

[0038] In one embodiment, step S202 includes:

[0039] A controllable oscillation signal is superimposed on the image feature vector to perform periodic perturbation processing, thereby obtaining perturbation features; wherein, the controllable oscillation signal includes learnable amplitude parameters, learnable frequency parameters, phase offset parameters, and time index.

[0040] In this embodiment, the learnable amplitude parameter is used to independently adjust the perturbation intensity of each feature dimension to achieve optimal performance; the learnable frequency parameter is used to adjust the rate of change of the perturbation signal, thereby controlling the change of the perturbation signal at different time scales and further enriching the expression of the feature vector; the phase offset parameter is used to randomly initialize the oscillation initiation state, which helps the model to have better exploration capabilities in the early stages of training and avoid getting trapped in local optima; the time index is used to mark the temporal position of the current inference step, which can better understand the changes of the feature vector in the time dimension, thereby making more accurate predictions. Based on this, by periodically perturbing the image feature vector, the generalization ability and robustness of the model can be enhanced.

[0041] In one specific implementation, step S202 generates the perturbation feature according to the following formula.

[0042] Where h represents the image feature; A represents the learnable amplitude parameter used to control the perturbation intensity of each feature dimension; F represents the learnable frequency parameter used to determine the rate of change of the perturbation; φ represents the phase offset parameter; t represents the time index of the current inference step; and ⊙ represents element-wise multiplication.

[0043] Among them, the amplitude parameter A is initialized using a truncated normal distribution to ensure that the initial disturbance amplitude is moderate; the frequency parameter F is initialized using a logarithmic uniform distribution to cover a wide frequency range; and the phase offset parameter φ is initialized using a random uniform distribution to ensure the diversity of the disturbance signal.

[0044] These learnable parameters allow for adaptive adjustment of perturbation features to suit different image features and classification tasks. During inference, perturbation features are dynamically generated based on the time index t of the current inference step and applied to the features of the input image, resulting in a series of perturbed feature vectors. These perturbation features can reveal the basis and logic of the model's decisions in subsequent classification models, thus improving the interpretability of classification results.

[0045] S203. Perform attention perturbation modulation processing on the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features;

[0046] In step S203, attention perturbation modulation processing refers to introducing an attention mechanism to assign different weights to different feature dimensions, emphasizing feature dimensions that have a greater impact on the classification result and suppressing feature dimensions with a smaller impact. Specifically, attention perturbation modulation processing can employ a multi-head attention mechanism, taking perturbation features as input and processing them in parallel through multiple attention heads. Each attention head calculates the correlation score between different feature dimensions and performs a weighted summation of the feature dimensions based on the scores, thereby generating optimized features. These optimized features not only contain the feature information of the input image but also incorporate dynamic changes reflecting the importance of features, providing richer and more accurate feature representations for subsequent classification decisions. For example, in the attention perturbation modulation processing of perturbation features in financial scene images, weights can be assigned to feature dimensions of different financial elements (such as stock charts, transaction data, etc.). For trend line features in stock charts, if they have a significant impact on the classification result, they are given a higher weight through the attention mechanism; while some noise or minor features are given a lower weight. In this way, the device can more accurately capture and analyze the key information of high-importance dimensions in financial images, improving the accuracy and reliability of classification. At the same time, this attention perturbation modulation process also enhances the interpretability of the model, enabling users to more clearly understand how the model makes classification decisions based on the features of the input image.

[0047] In one embodiment, such as Figure 3 As shown, step S203 includes:

[0048] S301. A multi-head self-attention mechanism and a Sigmoid activation function are used to calculate the gating weights of the perturbation features.

[0049] In step S301, the multi-head self-attention mechanism processes perturbation features in parallel using multiple independent attention heads. Each attention head can focus on different parts of the perturbation features, and this parallel processing method can capture the interrelationships within the perturbation features. The Sigmoid activation function is used to map the calculated gating weights to a range of 0 and 1, thereby allocating gating weights to different feature dimensions. In this way, the influence of each dimension of the perturbation features on the final classification result can be adjusted more flexibly, further improving the accuracy and reliability of the classification.

[0050] In one embodiment, such as Figure 4 As shown, step S301 includes:

[0051] S401. Input the perturbation feature simultaneously as the query vector, key vector and value vector into the multi-head self-attention mechanism to calculate the attention weight matrix between different feature dimensions within the perturbation feature;

[0052] S402. Perform an aggregation operation on the attention weight matrix to generate an aggregated weight vector that reflects the importance of each feature dimension;

[0053] S403. Convert the aggregated weight vector into gated weights using the Sigmoid activation function.

[0054] In this embodiment, by capturing the interrelationships between different feature dimensions within the perturbation feature and dynamically adjusting the gating weight g of the perturbation feature based on these interrelationships, key features that have a significant impact on the classification results can be identified and utilized more effectively.

[0055] In one specific implementation, step S301 calculates the gating weight g of the disturbance feature according to the following formula:

[0056] g=σ(MultiHeadAttention(h,h,h));

[0057] Where σ represents the sigmoid activation function, Multi-HeadAttention represents the multi-head self-attention mechanism, and (h,h,h) represents the multi-head segmentation of the attention weight matrix Q, K, and V of the multi-head attention mechanism.

[0058] Furthermore, the attention weight matrices Q, K, and V in S401 are calculated using the following formulas:

[0059]

[0060] Where Q, K, and V represent the query matrix, key matrix, and value matrix, respectively, and the softmax function is used to calculate the attention weights. k T represents the dimension of the key matrix, and T' represents the transpose operation.

[0061] In this implementation, when calculating the attention weight matrices Q, K, and V, a linear transformation is performed on the query matrix, key matrix, and value matrix, and the attention weights are calculated using the softmax function. This achieves accurate modeling of the correlations between different perturbation features. This not only improves classification accuracy but also enhances model interpretability, allowing users to more intuitively understand the model's decision-making process.

[0062] S302. The periodic perturbation amount of the perturbation feature is modulated using gating weights to optimize the feature importance and obtain the optimized feature.

[0063] In step S302, the larger the gating weight of the perturbation feature, the higher the feature importance and the more significant the influence on the classification result. It is necessary to enhance the role of these perturbation features in the classification process, so that the model's decision depends more on the features with higher importance, thereby improving the interpretability of the model.

[0064] In one embodiment, step S302 includes:

[0065] The gate weights are multiplied element-wise by the periodic perturbation amount of the perturbation feature along the feature dimension to obtain the modulated perturbation amount; the modulated perturbation amount is then superimposed on the perturbation feature to generate an optimized feature that reflects the dynamic changes in the importance of the feature.

[0066] In this embodiment, the influence of periodic perturbations on perturbation features is flexibly controlled through gating weights. Specifically, the gating weights, as adjustable parameters, can dynamically adjust the magnitude of the perturbation based on the importance of different features. When a feature is deemed more important, the gating weights may increase accordingly, thus strengthening the perturbation of that feature and giving it more attention during model training. Conversely, for less important features, the gating weights are decreased to reduce their perturbation and lessen their impact on the output. This dynamic adjustment helps the model capture key features more accurately, improving its generalization ability and performance.

[0067] In one specific implementation, step S302 generates optimized features based on the following formula.

[0068] Here, g represents perturbation modulation gating. This formula modulates the perturbation features according to the gating weight g, which enhances the role of important features in the classification process while weakening the influence of unimportant features, thereby improving the accuracy of classification and the interpretability of the model.

[0069] S204. Aggregate and optimize the feature-important perturbation trajectory to generate a visual heatmap;

[0070] In one embodiment, step S204 includes:

[0071] For each feature dimension of the optimized features, the product of its gating weight and the corresponding amplitude parameter is accumulated within the total number of inference steps, and the average value is taken as the feature importance score; the importance scores of all feature dimensions are normalized, and then the scores are mapped to the input image resolution through an upsampling operation to generate a heatmap.

[0072] In this embodiment, feature importance scores are used to quantify the contribution of each feature in the classification process. Normalization ensures that the feature importance scores are within a comparable range. The upsampling step matches the importance scores to the resolution of the input image, facilitating the generation of intuitive heatmaps. Heatmap visualization visually presents feature importance, allowing users to clearly observe which features play a crucial role in the classification results, further enhancing the model's interpretability. This visualization method is significant for understanding the model's decision-making process, adjusting feature selection strategies, and optimizing model performance.

[0073] In one specific implementation, the feature importance score S in step S204 i The calculation formula is as follows:

[0074]

[0075] Where T represents the total number of reasoning steps, Let A represent the gating weight of the i-th feature at step t. i This represents the amplitude corresponding to the i-th feature;

[0076] Importance score S i After normalization, heatmap visualization is generated by upsampling and aligning with the input image.

[0077] S205. By mapping optimized features to a category probability distribution, the image classification result is output.

[0078] In this embodiment, the optimized features can be further processed through a fully connected layer, mapping them to a predefined category probability distribution space. This step utilizes the fully connected network structure in deep learning to calculate the probability value of each category through linear transformation and nonlinear activation of the feature vector. The final output is the image classification result, that is, the category to which the input image belongs is determined based on the calculated probability distribution.

[0079] As can be seen, the above scheme proposes an innovative fully connected layer architecture for image classification applications in financial and medical scenarios. By combining periodic feature perturbation with an attention mechanism, it achieves a dual improvement in performance and interpretability in image classification tasks. Specifically, the core of this approach lies in proposing an innovative fully connected layer architecture that combines periodic perturbation with a multi-head attention mechanism to perform periodic feature perturbation and context-dependent perturbation modulation processing. This allows the model to continuously optimize its feature representation during inference, thereby obtaining more accurate classification results. Furthermore, it generates intuitive feature importance heatmaps through perturbation trajectories, providing a clear visualization of the decision-making basis.

[0080] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0081] In one embodiment, an interpretable classification device is provided, which corresponds one-to-one with the interpretable classification methods described in the above embodiments. For example... Figure 5 As shown, the interpretable classification device includes a feature extraction module 501, a feature perturbation module 502, a feature modulation module 503, a heatmap generation module 504, and a classification output module 505. Detailed descriptions of each functional module are as follows:

[0082] Feature extraction module 501 is used to extract features from the input image to obtain image features;

[0083] The feature perturbation module 502 is used to periodically perturb the image feature vector to obtain perturbation features;

[0084] The feature modulation module 503 is used to perform attention perturbation modulation processing on the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features;

[0085] The heatmap generation module 504 is used to aggregate the important perturbation trajectories of optimized features and generate a visual heatmap.

[0086] The classification output module 505 is used to map optimized features to a category probability distribution to output image classification results.

[0087] In one embodiment, the feature perturbation module 502 is specifically used for:

[0088] The perturbation feature is generated using the following formula.

[0089]

[0090] Where h represents the image feature; A represents the learnable amplitude parameter used to control the perturbation intensity of each feature dimension; F represents the learnable frequency parameter used to determine the rate of change of the perturbation; φ represents the phase offset parameter; t represents the time index of the current inference step; and ⊙ represents element-wise multiplication.

[0091] In one embodiment, the feature modulation module 503 includes a weight calculation unit and a feature optimization unit;

[0092] The weight calculation unit is specifically used to calculate the gating weights of the perturbation features using a multi-head self-attention mechanism and a Sigmoid activation function.

[0093] The feature optimization unit is specifically used to optimize the feature importance of the perturbation features based on the gating weights of the perturbation features, so as to obtain optimized features.

[0094] In one embodiment, the weight calculation unit is more specifically used for:

[0095] The gate weight g of the disturbance feature is calculated using the following formula:

[0096] g=σ(MultiHeadAttention(h,h,h));

[0097] Where σ represents the sigmoid activation function, Multi-HeadAttention represents the multi-head self-attention mechanism, and (h,h,h) represents the multi-head split of the attention weight matrix Q, K, and V of the multi-head attention mechanism.

[0098] The attention weight matrices Q, K, and V are calculated using the following formulas:

[0099]

[0100] Where Q, K, and V represent the query matrix, key matrix, and value matrix, respectively, and the softmax function is used to calculate the attention weights. k T represents the dimension of the key matrix, and T' represents the transpose operation.

[0101] In one embodiment, the feature optimization unit is more specifically used for:

[0102] The perturbation feature is generated using the following formula.

[0103]

[0104] Where g represents perturbation modulation gating.

[0105] In one embodiment, the heat map generation module 504 is specifically used for:

[0106] Calculate the feature importance score S using the following formula. i :

[0107]

[0108] Where T represents the total number of reasoning steps, Let A represent the gating weight of the i-th feature at step t. i This represents the amplitude corresponding to the i-th feature;

[0109] Importance score S i After normalization, heatmap visualization is generated by upsampling and aligning with the input image.

[0110] Specific limitations regarding the interpretable classification device can be found in the limitations of the interpretable classification method above, and will not be repeated here. Each module in the aforementioned interpretable classification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0111] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements functions or steps on the server side of an interpretable classification method.

[0112] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements functions or steps on the client side of an interpretable classification method.

[0113] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0114] Feature extraction is performed on the input image to obtain image features;

[0115] Periodically perturb the image feature vector to obtain perturbed features;

[0116] Attention perturbation modulation is applied to the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features;

[0117] Aggregate and optimize the feature-important perturbation trajectories to generate a visual heatmap;

[0118] The optimized features are mapped to a class probability distribution to output the image classification result.

[0119] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0120] Feature extraction is performed on the input image to obtain image features;

[0121] Periodically perturb the image feature vector to obtain perturbed features;

[0122] Attention perturbation modulation is applied to the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features;

[0123] Aggregate and optimize the feature-important perturbation trajectories to generate a visual heatmap;

[0124] The optimized features are mapped to a class probability distribution to output the image classification result.

[0125] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0126] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0128] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. An interpretable classification method, characterized in that, include: Feature extraction is performed on the input image to obtain image features; The image feature vector is periodically perturbed to obtain perturbed features; The perturbation features are subjected to attention perturbation modulation processing to generate optimized features that reflect the dynamic changes in the importance of the features; The feature-important perturbation trajectories of the optimized features are aggregated to generate a visual heatmap; The optimized features are mapped to a category probability distribution to output the image classification result.

2. The interpretable classification method as described in claim 1, characterized in that, The process of periodically perturbing the image feature vector to obtain perturbed features includes: A controllable oscillation signal is superimposed on the image feature vector to perform periodic perturbation processing, thereby obtaining perturbation features; wherein, the controllable oscillation signal includes a learnable amplitude parameter, a learnable frequency parameter, a phase offset parameter, and a time index; The learnable amplitude parameter is used to independently control the perturbation intensity of each feature dimension; The learnable frequency parameter is used to regulate the rate of change of the disturbance signal; The phase offset parameter is used to randomly initialize the oscillation start state; The time index is used to mark the temporal position of the current inference step.

3. The interpretable classification method as described in claim 1, characterized in that, The step of performing attention perturbation modulation processing on the perturbation features to generate optimized features that reflect dynamic changes in feature importance includes: The gating weights of the perturbation features are calculated using a multi-head self-attention mechanism and a Sigmoid activation function. The periodic perturbation amount of the perturbation feature is modulated using the gating weight to optimize the feature importance, thereby obtaining optimized features.

4. The interpretable classification method as described in claim 3, characterized in that, The method employs a multi-head self-attention mechanism and a sigmoid activation function to calculate the gating weights of the perturbation features, including: The perturbation feature is simultaneously used as a query vector, key vector, and value vector and input into a multi-head self-attention mechanism to calculate the attention weight matrix between different feature dimensions within the perturbation feature. The attention weight matrix is ​​aggregated to generate an aggregated weight vector that reflects the importance of each feature dimension; The aggregated weight vector is converted into gated weights using the Sigmoid activation function.

5. The interpretable classification method as described in claim 4, characterized in that, The calculation yields the attention weight matrix between different feature dimensions within the perturbation feature, including: Perform a dot product operation on the transpose of the query vector and the key vector to obtain the dot product result; Divide the dot product result by the square root of the dimension of the key vector to obtain the scaling result; The scaling result is normalized to generate the attention weight matrix.

6. The interpretable classification method as described in claim 3, characterized in that, The method of using the gated weights to modulate the periodic perturbation amount of the perturbation feature to optimize feature importance and obtain optimized features includes: The gate weights are multiplied element-wise by the periodic perturbation amount of the perturbation feature along the feature dimension to obtain the modulated perturbation amount. The modulated perturbation is superimposed on the perturbation feature to generate an optimized feature that reflects the dynamic changes in the importance of the feature.

7. The interpretable classification method as described in claim 1, characterized in that, The aggregation of the optimized features to generate a visual heatmap includes: For each feature dimension of the optimized feature, the product of its gating weight and the corresponding amplitude parameter is accumulated within the total number of inference steps, and the average value is taken as the feature importance score; The importance scores of all feature dimensions are normalized, and then the scores are mapped to the input image resolution through an upsampling operation to generate a heatmap.

8. An interpretable classification device, characterized in that, include: The feature extraction module is used to extract features from the input image to obtain image features; The feature perturbation module is used to periodically perturb the image feature vector to obtain perturbation features; The feature modulation module is used to perform attention perturbation modulation processing on the perturbation features to generate optimized features that reflect the dynamic changes in the importance of the features; The heatmap generation module is used to aggregate the feature-important perturbation trajectories of the optimized features and generate a visual heatmap. The classification output module is used to map the optimized features to a category probability distribution to output the image classification result.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the interpretable classification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the interpretable classification method as described in any one of claims 1 to 7.