High-definition image explainable classification method and device, computer device and storage medium
By extracting low-dimensional feature vectors from high-resolution images through a pre-trained StyleGAN encoder and transformation network, and combining an interpretable classifier and generator, the computational collapse and feature decoupling problems of fuzzy neural networks in high-resolution image classification are solved, achieving interpretable classification and accuracy of high-resolution images.
Patent Information
- Application Number
- CN202411432169.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Existing technologies struggle to effectively extract fuzzy rules from high-resolution images from unstructured data, leading to computational failures or insufficient feature decoupling in fuzzy neural networks during image classification, thus failing to accurately interpret complex image details.
A pre-trained StyleGAN encoder is used to construct the latent space. Low-dimensional interpretable feature vectors are extracted through a transformation network. High-resolution image classification is performed by combining an interpretable classifier and a pre-trained generator. The reasoning process of the human brain's visual cortex and parietal cortex is simulated. A fuzzy neural network structure is designed to achieve interpretability and accuracy.
It achieves interpretable classification of high-definition images, alleviates the problems of rule explosion and computational crash, improves the effectiveness and interpretability of feature extraction, and ensures the accuracy of classification and visualization.
Smart Images

Figure CN119313964B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a high-definition image explainable classification method and device, computer equipment and a storage medium. BACKGROUND
[0002] Fuzzy neural networks combine fuzzy logic and neural networks, and have both the self-learning ability of neural networks and the explainable ability of fuzzy systems. Fuzzy neural networks can learn a set of fuzzy rules with appropriate language labels from data using the learning ability of neural networks, making it easy for people to understand the decision-making process of the model. Fuzzy neural networks are an important part of explainable artificial intelligence (XAI) and have been widely used in medical, financial, and educational fields. However, fuzzy neural networks are usually used to explain structured data, but for unstructured data such as images, text, or speech, if the image pixels, words (characters), or waveform points are directly used as the input of the fuzzy neural network, on the one hand, since the activation strength of the fuzzy rule is usually the product of all input membership values less than 1, a large number of inputs will make the activation strength of all rules almost zero, resulting in model calculation collapse; on the other hand, a large number of inputs without semantic meaning will also reduce the understanding and mastery of fuzzy rules by people. Therefore, in order to use fuzzy rules to explain complex unstructured information, feature extraction needs to be performed in advance.
[0003] The way of manually defining image features is time-consuming and laborious; the feature extraction method using convolutional neural networks + dimension reduction extracts low-dimensional feature maps, and the specific semantics of the feature maps are still unknown; and the automatic feature extraction method relying solely on deep learning can hardly guarantee the effectiveness and usability of the extracted features in subsequent fuzzy reasoning. In summary, it is not easy to extract key features needed for fuzzy rule reasoning from unstructured data. The existing methods for image classification using explainable fuzzy rules can usually only handle low-dimensional and simple images, and there are still few methods for high-definition images.
[0004] In existing research, a variational autoencoder is used to extract features from images, and then a fuzzy neural network is used for explainable classification based on low-dimensional features. However, due to the insufficient reconstruction ability of VAE, the accuracy and effectiveness of feature extraction for large-size high-definition images still face challenges. In existing research, an image-encoding mapping network is constructed to extract features from images, and an encoding-feature mapping network and a pre-trained StyleGAN generator are used for image reconstruction to ensure the effectiveness of feature extraction. However, it is difficult to balance the quality of image reconstruction and the degree of decoupling of extracted features, resulting in insufficient detail restoration of images, inaccurate feature extraction, and low degree of feature decoupling. SUMMARY
[0005] Therefore, it is necessary to provide a high-definition image interpretable classification method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems.
[0006] A high-resolution image interpretable classification method, the method comprising:
[0007] The acquired high-resolution images are encoded using a pre-trained StyleGAN encoder to obtain the latent encoding and construct the latent space.
[0008] The latent code is extracted from complex image information using a transformation network to extract low-dimensional, interpretable feature vectors; the transformation network is used to obtain the feature vectors corresponding to the latent code by utilizing the feature orientations in the latent space.
[0009] The feature vectors are used to reason and classify, resulting in interpretable classification results. The interpretable classifier is used to simulate the reasoning and classification process of the human brain by using linguistic variables and IF-THEN rules, while the effective classification ability of the fuzzy neural network classifier is used to ensure the accuracy of classification.
[0010] A pre-trained generator is used to map the latent space to the image space, resulting in a reconstructed high-resolution image.
[0011] In one embodiment, the implementation process of the transformation network includes: first determining the form of the feature orientation, then searching for the feature orientation from the latent space, and finally designing an eigenvalue metric method to transform the feature orientation into a feature vector.
[0012] In one embodiment, samples in the potential space w In the h The eigenvalues of each feature are samples in the latent space. w With characteristic direction Cosine similarity; samples in the latent space w In the h The feature values for each feature are:
[0013] ;
[0014] in, For samples in the latent space w In the h The eigenvalues of each feature. For samples in the latent space w With characteristic direction.
[0015] The mathematical expression for the transformation network is:
[0016] ;
[0017] wherein, is the latent code, is the latent code w output obtained after the input conversion network, s is the feature vector corresponding to the latent code, is a set of feature directions on all features, is the L1 norm.
[0018] In one of the embodiments, the method further comprises a feature visualization method based on the pre-trained generator, and the specific steps of the feature visualization method comprise:
[0019] the latent code w is changed by moving in the latent space, so that the first h feature of the generated image is changed, and the moved latent code is obtained as:
[0020] ;
[0021] wherein, w is the initial latent code, is the moved latent code, is the direction of the first h feature, is the moving step.
[0022] According to the initial latent code and the moved latent code, the change of the latent code is determined as:
[0023] ;
[0024] According to the feature value calculation formula of a certain latent code sample on the first h feature, the feature values of the latent codes before and after moving on the first h feature are determined as:
[0025] ;
[0026] According to the feature values of the latent codes before and after moving on the first h feature, the change amount of the feature values is determined as:
[0027] .
[0028] According to the change of the latent code and the change amount of the feature values, the mapping relationship from to is determined as:
[0029] ;
[0030] The mapping relationship from to The mapping relationship reflects the change of the feature value on the latent code, and then reflects in the generated image using the pre-trained generator.
[0031] In one embodiment, the interpretable classifier includes a fuzzification layer, a fuzzy logic layer, and a classification layer.
[0032] In the fuzzification layer, an additional D node is added for each feature. D The node is initialized in a random manner and is continuously adjusted during the training process.
[0033] When the antecedent of the fuzzy rule contains D the node, it indicates that the feature corresponding to the node is ignored, and the fuzzy rule is rewritten as a more concise rule of the antecedent. D In one embodiment, the pre-trained generator is a pre-trained StyleGAN generator.
[0034] In one embodiment, according to the structural design of the fuzzy neural network model of the interpretable classifier, the fuzzy IF THEN rule is directly extracted from the model after the model is trained.
[0035] An interpretable classification device for high-definition images, the device comprising:
[0036] A latent code determination module of a pre-trained StyleGAN is configured to encode the obtained high-definition image using a pre-trained StyleGAN encoder to obtain a latent code, and convert the input image space to a latent space.
[0037] A feature extraction module is configured to extract a low-dimensional and interpretable feature vector from complex image information using a conversion network from the latent code; the conversion network is configured to obtain a feature vector corresponding to the latent code using the feature direction in the latent space.
[0038] An interpretable classification module is configured to infer and classify the feature vector using an interpretable classifier to obtain a classifiable classification result; the interpretable classifier is configured to simulate the reasoning and classification process of the human brain by means of language type variables and IF-THEN rules, and to ensure the accuracy of the classification by means of the effective classification ability of the fuzzy neural network classifier.
[0039] A visualization module is configured to map the latent space to the image space using a pre-trained generator to obtain a reconstructed high-definition image.
[0040]
[0041] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0042] A computer readable storage medium, which stores a computer program, the computer program is executed by a processor to implement the steps of any of the above methods.
[0043] The high-definition image interpretable classification method, device, computer device and storage medium, the method simulates the process of image perception, feature extraction, inductive reasoning and adjustment learning of the human brain. Based on the latent space of the pre-trained StyleGAN, the conversion network is designed to simulate the feature extraction of the visual cortex of the brain, effectively converting the high-dimensional latent code into low-dimensional and decoupled classification features, and relieving the problems of rule explosion and calculation collapse; the fuzzy neural network is used to simulate the reasoning function of the parietal lobe and prefrontal cortex of the brain, and an improved method of fuzzy neural network structure suitable for high-definition image interpretable classification model is designed, realizing the interpretable classification of low-dimensional features; the fuzzy rules used for classification are visualized and analyzed, and a feature visualization method is designed based on the pre-trained StyleGAN generator, further improving the interpretability. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 A framework diagram of the high-definition image interpretable classification model in one embodiment;
[0045] Figure 2 A flowchart of the high-definition image interpretable classification method in one embodiment;
[0046] Figure 3 A feature visualization flowchart of the high-definition image interpretable classification model in one embodiment;
[0047] Figure 4 A structure diagram of the fuzzy neural network in the high-definition image interpretable classification model in another embodiment;
[0048] Figure 5 A membership function of the first classification feature in another embodiment;
[0049] Figure 6 Feature visualization image examples in another embodiment, where (a) is picture 1, (b) is picture 2;
[0050] Figure 7 A feature visualization diagram of picture 1 in another embodiment;
[0051] Figure 8 A feature visualization diagram of picture 2 in another embodiment;
[0052] Figure 9 Fuzzy rules for another embodiment;
[0053] Figure 10 Fuzzy rules for another embodiment for classifying a single image with a fuzzy neural network into class 0, where (a) is the original image and class label, and (b) is the fuzzy rule and its contribution;
[0054] Figure 11 Fuzzy rules for another embodiment for classifying a single image with a fuzzy neural network into class 1, where (a) is the original image and class label, and (b) is the fuzzy rule and its contribution;
[0055] Figure 12 Block diagram of the structure of the interpretable classification device for high-definition images in one embodiment;
[0056] Figure 13 Internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION
[0057] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.
[0058] The human brain is a perfect model for feature perception and reasoning decision-making of complex information based on signal transmission between neurons. The human brain can not only quickly identify and classify objects, but also give reasonable reasons and explanations. Taking the classification of fish by the human brain as an example, when a person sees an image of a fish, the light reflected by the image reaches the eyeball, and the image information is collected by the retina. After the retina perceives the light signal, it is converted into an electrical signal by the optic nerve and continuously transmitted to the next level of nerve cells through the “electro-chemical” method, and finally projected to the visual cortex. There are nerve cells sensitive to various stimuli in the visual cortex, so some nerve cells will be activated by the nerve current impulses from the eyes, enabling the visual cortex to extract some “features” related to the image, such as “long dorsal fin”, “fish tail”, “streamlined shape”, “pink” and the like. Finally, the “features” extracted by the visual cortex flow into the parietal and frontal cortex, and the neurons in these brain areas can reason and classify objects based on the extracted features. The classification process comes with explanations, for example, the human brain compares the object in front of the eyes with the fish in memory, and when it believes that the key features of the object in front of the eyes (such as dorsal fin, tail, color) correspond to the key features of the fish in memory, it classifies the object in front of the eyes as “fish”. In daily life, people may encounter different fish, including various colors, various patterns, eyes protruding, and normal eyes, long tail, and short tail, etc. The human brain will continuously receive information about fish, and through continuous comparison and connection, use the images of different fish and the corresponding labels to modify the activation of the visual cortex, the extraction of features, and the activation of the neurons in the parietal and frontal cortex, and finally complete the classification and identification of the object “fish”.
[0059] Inspired by the image perception, feature extraction, and interpretable classification process in the human brain, the present application proposes a high-definition image interpretable classification method. The method designs a high-definition image interpretable classification model (referred to as StyleGAN-FNN) based on a pre-trained StyleGAN model and a fuzzy neural network. The model involves three components: a conversion network T , a pre-trained generator G , and an interpretable classifier C . The model framework is shown in Figure 1 . The model uses the latent space of the pre-trained StyleGAN, effectively extracts low-dimensional, semantically meaningful, and fully decoupled features s from complex image information through the conversion network T , simulates the transmission of electrical signals in the visual pathway and the feature extraction process in the visual cortex in the human brain; and inputs the low-dimensional features s to the interpretable classifier CThe high-definition image interpretable classification method is used to simulate the process of the human brain parietal lobe and prefrontal cortex classifying the features from the visual cortex.
[0060] The interpretability of the high-definition image interpretable classification method proposed in the present application is embodied in two aspects: one is the feature vector used for classification s , and the other is the IF-THEN fuzzy rule used for classification.
[0061] In one embodiment, as shown in Figure 2 , a high-definition image interpretable classification method is provided, which comprises the following steps:
[0062] Step 100: encoding the obtained high-definition image by using a pre-trained StyleGAN encoder to obtain latent encoding and construct a latent space.
[0063] Specifically, considering that the latent space of the pre-trained StyleGAN contains sufficient information in the image, it is a feasible means to directly extract features from the latent space rather than from the input image space. Directly extracting classification features from the latent space can avoid modification of the latent space, so that the model focuses on how to obtain decoupled features, further enhancing the effectiveness of feature extraction and the understandability of generated explanations.
[0064] Step 102: extracting a low-dimensional and interpretable feature vector from complex image information by using a conversion network on the latent encoding; the conversion network is used to obtain a feature vector corresponding to the latent encoding by using the feature direction in the latent space.
[0065] Specifically, the conversion network T is used to effectively extract low-dimensional, semantic and sufficiently decoupled features s from complex image information to simulate the transmission of electrical signals in the visual pathway and the feature extraction process of the visual cortex in the human brain.
[0066] The conversion network T is used to realize the mapping from the latent space to the feature space . For the conversion network T , the input is the latent encoding sample w in the latent space, and the output is the feature vector , where represents w the feature value on the first h feature, the larger the value, the stronger the corresponding semantic on the feature; the smaller the value, the weaker the corresponding semantic on the feature, w . w .
[0067] Step 104: The feature vector is inferred and classified by an interpretable classifier to obtain a class interpretable classification result; the interpretable classifier is used to simulate the reasoning and classification process of the human brain by means of language variables and IF-THEN rules, and at the same time, the effective classification ability of the fuzzy neural network classifier is used to ensure the accuracy of the classification.
[0068] Specifically, considering the characteristics of human brain reasoning, the interpretable classifier is implemented using a fuzzy neural network, which simulates the reasoning and classification process of the human brain by means of language variables and IF-THEN rules consistent with human thinking, and at the same time, the effective classification ability of the fuzzy neural network classifier is used to ensure the accuracy of the classification.
[0069] In order to enable the fuzzy neural network to flexibly learn the classification rules using the multiple features generated by the conversion network, the structure of the fuzzy neural network is improved, and an additional D node is added to each feature in the fuzzification layer part, representing "Don't care".
[0070] Step 106: Map the latent space to the image space using the pre-trained generator to obtain the reconstructed high-definition image.
[0071] Specifically, the high-definition image interpretable classification model (referred to as StyleGAN-FNN) is composed of the conversion network, the interpretable classifier, and the pre-trained generator. Its structure is as Figure 1 shown.
[0072] In the above high-definition image interpretable classification method, the method simulates the process of image perception, feature extraction, inductive reasoning, and adjustment learning of the human brain. This method is based on the latent space of the pre-trained StyleGAN, and designs a conversion network to simulate the feature extraction of the brain visual cortex, effectively converting high-dimensional latent encoding into low-dimensional, decoupled classification features, which alleviates the problem of rule explosion and computational collapse; a fuzzy neural network is used to simulate the reasoning function of the brain parietal lobe and prefrontal cortex, and a fuzzy neural network structure improvement method suitable for the high-definition image interpretable classification model is designed, which realizes the interpretable classification using low-dimensional features; the fuzzy rules used for classification are visualized and analyzed, and a feature visualization method is designed based on the pre-trained StyleGAN generator, which further improves the interpretability.
[0073] In one embodiment, the implementation process of the conversion network in step 102 includes: first determining the form of the feature direction, then finding the feature direction from the latent space, and finally designing a feature value measurement method to convert the feature direction into a feature vector.
[0074] Specifically, (1) define the feature direction
[0075] For the h Each feature defines the latent space. The feature direction of this feature is ,in Existing literature mainly classifies feature orientations into two categories: sample-independent feature orientations and sample-dependent feature orientations. Research shows that sample-dependent feature orientations offer more complete decoupling and higher interpretability; therefore, the first category is defined as... h The direction of each feature ,in, For latent encoding-feature mapping function, H The set of latent encoding-feature mapping functions for features is denoted as . .
[0076] (2) Solving for characteristic directions
[0077] Due to the eigenvectors As the input to downstream classification tasks, it is necessary to obtain domain-relevant, decoupled, and controllable features. Based on the above considerations, a supervised approach is adopted to obtain feature directions. Specifically, firstly, we define... H The meaning of each feature (such as "smile", "age", "wearing glasses" in a face dataset) is then used to pre-train an additional multi-class classifier for these features. This serves as a form of supervision for training. To obtain orthogonal feature directions, a relevant loss function is introduced during the training process.
[0078] (3) Solving for eigenvalues
[0079] Given feature direction Measure different latent codes w Score on this feature This allows us to obtain the latent encoding. w Corresponding feature vector s。 Existing eigenvalue measurement methods are typically qualitative, involving manual judgment. Specifically, this involves inputting different latent codes into the generator. G The generated image is obtained, and then the prominence of corresponding features on the image is manually observed to obtain the relative magnitude of the feature values. For example, for the gender feature, assuming the feature direction points to male, if the image... Male If it is a woman, then The eigenvalue for gender is higher than .
[0080] However, this method of measuring feature values through human vision only provides relative results of the feature value magnitude, not quantitative values. For a given latent encoded sample...w In the h Eigenvalues on each feature It can be measured using formula (1):
[0081] (1)
[0082] in, The feature direction is independent of the sample, that is, the unit normal vector of the hyperplane in the latent space that can separate the two semantics of the feature; is a coefficient.
[0083] In one embodiment, samples in the potential space w In the h The eigenvalues of each feature are samples in the latent space. w With characteristic direction Cosine similarity; samples in the latent space w In the h The feature values for each feature are:
[0084] (2)
[0085] in, For samples in the latent space w In the h The eigenvalues of each feature. For samples in the latent space w With characteristic direction;
[0086] The mathematical expression for the transformation network is:
[0087] (3)
[0088] in, For latent encoding, For latent encoding w The output obtained after inputting into the conversion network, s The feature vector corresponding to the latent encoding. for w The set of feature directions over all features. It is an L1 norm.
[0089] Specifically, inspired by formula (1), after obtaining the feature orientation through training, the sample is defined. w In the h Eigenvalues on each feature for w With characteristic direction The cosine similarity is shown in formula (2). In summary, the transformation network... T It can be expressed by formula (3).
[0090] Conversion Network T By utilizing the feature directions in the latent space, we can obtain the feature vector corresponding to the latent encoding. This allows us to obtain low-dimensional, interpretable feature vectors. s The input is then fed into an interpretable classifier for classification.
[0091] In one embodiment, the method further includes a feature visualization method based on a pre-trained generator, the specific steps of which include:
[0092] latent encoding w By moving through the latent space, the first image generated is... h The following features change, resulting in the latent encoding after the shift:
[0093] (4)
[0094] in, w For the initial potential encoding, For the potential encoding after the move, For the first h The direction of each feature This represents the movement step size;
[0095] Based on the initial latent code and the latent code after the move, the change in the latent code is determined as follows:
[0096] (5)
[0097] Based on a certain potential encoded sample in the first h The formula for calculating the eigenvalues of the features (i.e., formula (2)) is used to determine the latent encoding before and after the move at the th feature. h Eigenvalues on each feature and for:
[0098] (6)
[0099] because for w In the h The result of the modification on each feature, therefore, Therefore, we have:
[0100] (7)
[0101] Let's assume Therefore:
[0102] (8)
[0103] Based on the potential coding before and after the movement in the firsth the change amount of the feature value is determined as:
[0104] (9)
[0105] According to the change of the latent code and the change amount of the feature value, the mapping relationship from to is determined as:
[0106] (10)
[0107] The change of the feature value is reflected on the latent code by using the mapping relationship from to , and then reflected in the generated image by using the pre-trained generator.
[0108] Formula (10) establishes the mapping relationship from to . By using formula (10), the change of the feature value can be conveniently reflected on the latent code, and then reflected in the generated image by using the generator G . Figure 3 FIG. 1 is a schematic diagram of a feature visualization process in a high-definition image interpretable classification model, showing the proposed feature visualization method, wherein the dashed path is a feature visualization path, and the influence of the change of the feature value on the generated image for a specific feature is intuitively displayed, which is a variable used for classification by the fuzzy neural network.
[0109] Specifically, the specific meaning of each dimension in the feature vector s directly affects the intuitive degree of the fuzzy rule antecedent and the understanding degree of the fuzzy rule by people. The visualization of the feature is usually obtained by the method of latent space traversal: since the feature vector s generates a new latent code w by the encoder network, the change of s will directly cause the change of w , and then reflected on the generated image by the generator G . Therefore, by continuously modifying s and displaying and comparing the generated image, the visualization of the feature can be completed and the specific meaning of s can be found. However, in the present method, since s is directly converted from the latent code w , the change of s cannot affect w and then affect the generated image; in addition, due to the complexity of the conversion network T , it is difficult to solve TThe inverse function of the function is also very complex. For this reason, it is necessary to design an eigenvalue visualization method for this model. It should be noted that although according to the introduction of the feature direction solving method in the foregoing, the meaning of each feature is determined in advance, that is, the eigenvalue visualization method seems to be redundant. However, when other feature direction solving methods are used, especially unsupervised methods, the new eigenvalue visualization method is very important. H
[0110] In one embodiment, as shown in FIG. 1, the interpretable classifier in step 104 includes a fuzzification layer, a fuzzy logic layer, and a classification layer. The fuzzification layer is used to fuzz the input feature vector X = (x1, x2, …, xn)T. Figure 4 s The fuzzy set is represented by a Gaussian membership function. The fuzzification layer has a total of 4xn nodes, wherein, in addition to assigning 3 membership functions to each feature corresponding to the terms low, medium, and high, one more node is additionally added to each feature. H The nodes are initialized in a random manner and are continuously adjusted during the training process. When the fuzzy rule antecedent contains the node, it indicates that the feature corresponding to the node is ignored, and the fuzzy rule is rewritten as a more concise rule of the antecedent. D D D D
[0111] Specifically, when the fuzzy rule antecedent contains the node, it indicates that the corresponding feature is ignored, and the fuzzy rule can be rewritten as a more concise rule of the antecedent. For example, if a rule extracted after training is as shown in equation (11): D
[0112] (11)
[0113] It can be rewritten as equation (12):
[0114] (12)
[0115] The “Don’t care” node is initialized in a random manner and is continuously adjusted during the training process. The addition of the “Don’t care” node makes the feature selection and learning in the fuzzy neural network training process more flexible.
[0116] The output of the i-th fuzzification layer node of the j-th feature is represented by equation (13), wherein, h z indicates the fuzzy value of the feature in the fuzzy set For D Node value, And respectively represent the mean and standard deviation of the Gaussian membership function.
[0117] (13)
[0118] The fuzzy logic layer is used to represent the fuzzy rule base. To achieve this purpose, the parameters of this layer are set to discrete 0 / 1 values if using denotes the adjacency matrix of the l layer and the l -1 layer, then for the fuzzy logic layer, where is the element in the row and the i column of the j . When the weights of the fuzzy logic layer are discrete 0 / 1 values, the model can be directly translated into a set of fuzzy rules, with good interpretability.
[0119] In order to make the fuzzy logic layer of the model be able to represent various forms of fuzzy rules, each fuzzy logic layer contains several fuzzy intersection nodes and fuzzy union nodes, which respectively perform fuzzy intersection operation (and operation) and fuzzy union operation (or operation). Let the l fuzzy intersection nodes of the layer together constitute a fuzzy intersection sub-layer l , . Let the output of the th node of the layer be i , and the output of the th node of the i layer be . According to the meaning of fuzzy intersection operation and fuzzy union operation, their calculations are shown in equation (14):
[0120] (14)
[0121] where denotes the output of the l th node of the j -1 layer, denotes the adjacency matrix of the layer and the l -1 layer, and the element in it denotes the connection between the th node of the i layer and the l th node of the j -1 layer.The connection weights of each node; similarly... express Layers and l The adjacency matrix of level -1, where the elements are... express The first layer i The node and the first l -1st floor j The connection weight of each node.
[0122] In this application, the fuzzy intersection operation uses the min operator, and the fuzzy union operation uses the max operator. The fuzzy intersection and fuzzy union nodes of the fuzzy logic layer essentially perform fuzzy intersection and fuzzy union operations on the upper-level nodes whose connecting edge weights are 1. Considering that each fuzzy logic layer node represents the antecedent connective in a fuzzy rule, the output value of the fuzzy logic layer node is... The activation level on the corresponding fuzzy rules. The input to the classification layer is the activation level value calculated by each fuzzy logic layer node connected to the classification layer. The goal of the classification layer is to merge these activation level values, output the score for each category, and finally obtain the final classification category. In summary, the number of nodes in the classification task layer is the same as the number of classification categories. C The final output of the classification layer is shown in formula (15):
[0123] (15)
[0124] in, This indicates the final output category. Indicates the relationship with the first i The first classification layer node is connected to the first j The output of each fuzzy logic layer node This represents the weight matrix of the classification layer. It can be seen that in the classification layer, the weights correspond to the consequent weights of the fuzzy rules.
[0125] Fuzzy neural networks are trained using gradient descent. After training, the feature vectors are... s After inputting into the fuzzy neural network, the corresponding output category can be obtained through forward computation.
[0126] In one embodiment, the pre-trained generator in step 106 is a pre-trained StyleGAN generator.
[0127] In one embodiment, based on the structural design of the fuzzy neural network model of the interpretable classifier, after the model is trained, the fuzzy IF THEN rule is directly extracted from the model.
[0128] It should be understood that, although Figure 2The steps in the flowcharts are shown in sequence according to the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated herein, there is no strict order limitation for the execution of the steps, and the steps can be executed in other orders. Moreover, Figure 2 At least a part of the steps in the flowcharts can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the sub-steps or stages is not necessarily sequential, but can be alternately executed with other steps or at least a part of the sub-steps or stages of other steps.
[0129] In a verification embodiment, in order to verify the effect of the model, the StyleGAN-FNN model is trained on the high-definition face dataset CelebA-HQ, and the features extracted by the model are analyzed using the proposed feature visualization method (see formula (10)) to show the specific meaning and decoupling effect of the features, and finally the ability of the model to perform interpretable classification on high-definition images is further verified by combining the fuzzy rules extracted from the fuzzy neural network.
[0130] (1) Dataset
[0131] The StyleGAN model is pre-trained using the FFHQ dataset to obtain the generator G ; the conversion network is trained using the CelebA-HQ dataset with a resolution of 1024x1024 T . According to Figure 1 , the training and classification of the StyleGAN-FNN model require the latent space as input, so the pre-trained StyleGAN encoder proposed in document (1) (E. Richardson, Alaluf Y, Patashnik O, et al. Encoding in Style: A StyleGAN encoder for image-to-image translation [C] / / Proceedings of the 2021 IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021: 2287-2296, doi: 10.1109 / CVPR46437.2021.00232.) is used to calculate the corresponding latent code w in the latent space for each image in the CelebA-HQ dataset.
[0132] In training the StyleGAN-FNN model, the "attractive" label provided by the CelebA-HQ dataset is used to perform binary classification on the images: a classification of 0 represents that the person in the image is not attractive; a classification of 1 represents that the person in the image is attractive. The reason for choosing "attractive" as the classification label is that, compared with other classification tasks (such as gender classification), this classification problem is more subjective and complex. By observing and analyzing the classification results and basis of the model on this classification task, some interesting conclusions can be expected. For the "attractive" binary classification task, 8 attributes are manually selected from the 40 attributes provided by the CelebA-HQ dataset as classification features, as shown in Table 1. Then the feature vector of each image in the CelebA-HQ dataset on these 8 features is calculated according to formula (2) , and it is used together with the attractive label to form a classification dataset to train StyleGAN-FNN. Among them, 28,000 are used for training, and 2,000 are used for testing.
[0133] Table 1 Feature information of "attractive" binary classification task
[0134]
[0135] (2) Parameter settings
[0136] In the StyleGAN-FNN model, in order to further improve the classification accuracy, a truncated Gaussian blur number is used, and the mean parameter of the membership function is as shown in formula (16):
[0137] (16)
[0138] wherein and represent the quarter quartile and the three-quarter quartile, respectively; the superscript h indicates the index of the feature, and the second value of the subscript indicates the data used to calculate the quartile: the data is divided into two parts according to the attractive label, and , then ; . The standard deviation of the membership function is set to 0.3, wherein , "L", "M", "H" are the abbreviations of "low", "medium", "high", respectively. For the two membership functions of "L" and "H", the calculation of the membership value is shown in formula (17):
[0139] (17)
[0140] where denotes the membership value of the h th eigenvalue on the membership function MF . Figure 5 The membership function of the first classification feature (bald) is shown. The truncated Gaussian fuzzy number can better avoid the influence of extreme values on the membership function setting, and improve the accuracy of classification.
[0141] In the fuzzy neural network, the number of fuzzy logic layers is set to 1, and the number of fuzzy logic layer nodes is set to 16, including 8 fuzzy intersection nodes and 8 fuzzy union nodes.
[0142] (3) Results analysis
[0143] For the trained model, first, the meaning of the generated features and the decoupling effect of the model are shown through correlation analysis and feature visualization; then the classification results and classification basis of the fuzzy neural network are shown and analyzed.
[0144] 1) Decoupling effect of feature space
[0145] ① Correlation matrix
[0146] Table 2 shows the orthogonality of the 8 feature directions used by the model in the form of a correlation matrix, and the correlation between the feature directions is measured using cosine similarity. Specifically, 5000 images are randomly selected from the training set, and the feature direction of each image on the 8 classification features is calculated , . Then, the value of the i th row and the j th column in the correlation matrix is , where denotes the cosine similarity calculation function. From Table 2, it can be seen that each feature direction is almost orthogonal.
[0147] Table 2 Correlation matrix of eight features
[0148]
[0149] ② Feature visualization
[0150] In order to visually show the decoupling of the features, 2 images are randomly selected from the data set, as shown in Figure 6 , where (a) is image 1 and (b) is image 2.
[0151] The proposed feature visualization method (see equation (10)) is used to visualize the 8 classification features, where the change amount of the h th feature is The feature visualization in Image 1 is as follows: Figure 7 As shown, each column represents the generated image after changing the feature value of a specific feature; each row represents the generated image corresponding to different features after changing a given feature value by a certain amount.
[0152] from Figure 7 It can be seen that for a single feature, changing the feature value will correspondingly change the visual effect of the corresponding feature in the generated image, and the trend of feature change in the image corresponds to the meaning of the feature: the larger the feature value, the stronger the semantics of the feature, and vice versa. For example, for the first feature (baldness), the smaller the feature value, the thicker the hair in the generated image and the less severe the baldness; the larger the feature value, the more obvious the baldness in the generated image. For the eighth feature (pointed nose), the smaller the feature value, the flatter the nose in the generated image; the larger the feature value, the more pointed the nose in the generated image. This demonstrates the accuracy of the model's feature extraction and the effectiveness of the feature visualization method.
[0153] from Figure 7 It can also be seen that the model learns a relatively complete degree of feature decoupling: changes to a single feature in the generated image do not affect the visual effect of other features. For example, when the fourth feature (applying lipstick) is changed, apart from the lipstick color, the person's hairstyle, eyebrows, nose, etc., are all preserved; the same is true when other features are changed. This demonstrates that StyleGAN-FNN has greater superiority in feature decoupling.
[0154] To prevent the selected image from being unique, feature visualization was also performed on image 2, such as... Figure 8 As shown. It can be seen that, with Figure 7 Similarly, changing the feature value of a single feature will affect the visual effect of the corresponding feature in the generated image, but will not affect the other features.
[0155] 2) Fuzzy rules for classification
[0156] The model was trained using a constructed "attractive" binary classification dataset. After training, the model achieved accuracies of 74.7% on the training set and 73.1% on the test set; using a pre-trained multi-classifier... Using this as a baseline, the classification accuracy on the training and test sets is 86.5% and 85.9%, respectively. Below, we demonstrate the fuzzy rules used by the fuzzy neural network and analyze the fuzzy rules used by the fuzzy neural network when classifying a single image.
[0157] ① Fuzzy rule base
[0158] Figure 9 It demonstrates the fuzzy rules extracted from a trained fuzzy neural network.
[0159] Figure 9 In the above example, the antecedent of the rule is represented as a vector of 4 elements, each element is a fuzzy set of the corresponding feature. The consequent of the rule is represented as a vector of 2 elements, each element is a weight of the corresponding class. The weight of the class is represented as a bar chart, which represents the weight of the rule in classifying the image into the corresponding class. The weight of the class is calculated by the following equation: The class 0 (not attractive) is represented as a bar chart with a weight of 0.5, which means that the rule has a 50% chance of classifying the image into the class 0 (not attractive). The class 1 (attractive) is represented as a bar chart with a weight of 0.5, which means that the rule has a 50% chance of classifying the image into the class 1 (attractive). The rule has a 50% chance of classifying the image into the class 0 (not attractive) and a 50% chance of classifying the image into the class 1 (attractive). The class 1 (attractive) is represented as a bar chart with a weight of 0.5, which means that the rule has a 50% chance of classifying the image into the class 1 (attractive). The rule has a 50% chance of classifying the image into the class 0 (not attractive) and a 50% chance of classifying the image into the class 1 (attractive).
[0160] Table 3. Fuzzy rule base data
[0161]
[0162] In addition, as can be seen from Table 3, when the value of the first feature (bald) and the value of the third feature (slightly open mouth) are small, the classifier will tend to classify it into the first class (attractive); when the value of the second feature (young) is small, the classifier will tend to classify it into the 0th class (not attractive); when the value of the third feature (slightly open mouth) is average, the classifier will tend to classify it into the 0th class (not attractive); when the value of the fourth feature (lipstick) is large, the classifier will tend to classify it into the first class (attractive); when the value of the first feature (bald) is large and the value of the fourth feature (lipstick) is small, the classifier will tend to classify it into the 0th class (not attractive). The classification basis provided by the rule base is consistent with human cognition: when people judge whether a person is attractive, they will also classify bald, old, and no lipstick people as not attractive, and classify people with more hair, young, and lipstick as attractive. It should be noted here that for the third feature (slightly open mouth), only the classification preference when the feature value is at the average level (“M”) is reflected in the rule, which is also consistent with human intuition: when the mouth is not open, it means that the person may not be smiling or is smiling with pursed lips; when the mouth is open to a large extent, it means that the person may be laughing, and when the mouth is open to an average extent, it means that the person looks somewhat dull (seeFigure 8 The third column of the fourth row.
[0163] By displaying and analyzing the fuzzy rule base used by the fuzzy neural network when classifying images, the explainable classification ability of StyleGAN-FNN model for high-definition images is verified.
[0164] ②Example explanation
[0165] In order to more intuitively show the image classification ability and explainable ability of the model, the fuzzy rules used by the fuzzy neural network when classifying a single image are analyzed.
[0166] Figure 10 is a randomly selected image of "not attractive" (category label 0) and the fuzzy rules used by the fuzzy neural network when classifying the image. Among them, Figure 10 In (a), the original image and the category label are shown. Figure 10 In (b), the fuzzy rules used by the fuzzy neural network when classifying the image and the "contribution" of these rules to classification are shown. Figure 10 The legend in (b) shows the activation degree of the fuzzy rule, the rule antecedent, and the rule number. Figure 10 The contribution of the fuzzy rule to classification is shown on the right side of (b), where 0 and above represents positive contribution, and 0 and below represents negative contribution. For the two classification categories, the longer the bar above 0 is and the shorter the bar below 0 is, the higher the probability that the classifier classifies the image into the corresponding category. For specific data of fuzzy rules, see Table 4.
[0167] Table 4 Fuzzy rules used when classifying a single image with category 0
[0168]
[0169] From Figure 10 It can be seen that when classifying the image, the fuzzy neural network can easily classify it as category 0 (not attractive), because the 7th and 3rd rules, which contribute more to the classification result among the 5 rules used for classification, both support classifying it as category 0 (the contribution of the remaining three rules is too small to be almost observed on the bar chart). Combined with the semantics of each feature, it can be known that because the first feature value is large (the bald head is more serious) and the second feature value is small (the age is older), it supports classifying the image as category 0 (not attractive). The reasoning process of the above fuzzy rules is consistent with human intuition.
[0170] Similarly, Figure 11 is shown the fuzzy rules used by the classifier when classifying an image of "attractive" (category label 1), where (a) is the original image and the category label, and (b) is the fuzzy rules and their contribution. For specific data, see Table 5.
[0171] It can be seen that in classifying this image, the fuzzy neural network can relatively easily classify it as class 1, because the 5 rules used for classification consider it more likely to be classified as class 1. In addition, according to Figure 11 In (b), the classifier mainly classifies it as class 1 according to the 4th rule (the 3rd feature value is small) and the 6th rule (the 4th feature value is large). In connection with the semantics of each feature, because the 3rd feature value is small (the mouth is not open) and the 4th feature value is large (lipstick is applied), it supports classifying the image as class 1 (attractive). The above reasoning process is also consistent with the reasoning of human beings.
[0172] Table 5 Fuzzy rules used in classifying a single image as class 1
[0173]
[0174] By showing the fuzzy rules used by the fuzzy neural network in classification and analyzing the rules used by the classifier in classifying a single image, the classification ability and explainability of the model in processing image classification tasks are verified.
[0175] The explainable model StyleGAN-FNN for classifying high-definition images proposed in the present application learns from the process of feature extraction, inductive reasoning, and adaptive learning of the human brain on complex information, automatically extracts decoupled and key feature elements from high-definition image information, and completes high-precision and explainable classification through an explainable fuzzy neural network classifier. The model architecture including a conversion network, a pre-trained StyleGAN generator, and a fuzzy neural network is designed, so that the model can directly convert the high-dimensional latent space into a low-dimensional feature space, greatly enhancing the decoupling effect of the features; in terms of model explainability, the structure of the fuzzy neural network is improved, the number of antecedents of the fuzzy rules is reduced, and the explainability of the fuzzy rules is improved, in addition, an accurate and fast feature visualization method is proposed, which intuitively and clearly shows the semantics of the features; in the "attractive or not" binary classification experiment on the CelebA-HQ dataset, it is shown that the proposed model can extract sufficiently decoupled features from the latent space, and accurately and explainably complete the high-definition image classification task using these features.
[0176] In one embodiment, as Figure 12 shown, a high-definition image explainable classification apparatus is provided, comprising: a latent encoding determination module of a pre-trained StyleGAN, a feature extraction module, an explainable classification module, and a visualization module, wherein:
[0177] The latent encoding determination module of the pre-trained StyleGAN is configured to encode the obtained high-definition image using a pre-trained StyleGAN encoder to obtain a latent encoding, and convert the input image space into a latent space.
[0178] The feature extraction module is used to extract low-dimensional, interpretable feature vectors from complex image information using a transformation network; the transformation network is used to obtain the feature vectors corresponding to the latent code by utilizing the feature orientations in the latent space.
[0179] The interpretable classification module is used to reason and classify feature vectors using an interpretable classifier to obtain interpretable classification results. The interpretable classifier uses linguistic variables and IF-THEN rules to simulate the reasoning and classification process of the human brain, while leveraging the effective classification capabilities of a fuzzy neural network classifier to ensure classification accuracy.
[0180] The visualization module is used to map the latent space to the image space using a pre-trained generator to obtain a reconstructed high-resolution image.
[0181] In one embodiment, the implementation process of the transformation network in the feature extraction module includes: first determining the form of the feature orientation, then searching for the feature orientation from the latent space, and finally designing an eigenvalue measurement method to transform the feature orientation into a feature vector.
[0182] In one embodiment, samples in the potential space w In the h The eigenvalues of each feature are samples in the latent space. w With characteristic direction Cosine similarity; samples in the latent space w In the h The eigenvalues of each feature are shown in formula (2); the mathematical expression of the transformation network is shown in formula (3).
[0183] In one embodiment, the apparatus further includes a feature visualization module based on a pre-trained generator, the feature visualization module being used to visualize the latent encoding. w By moving through the latent space, the first image generated is... h The feature changes, resulting in the latent code after the shift as shown in formula (4); based on the initial latent code and the shifted latent code, the change in the latent code is determined; the change in the latent code is shown in formula (5); based on a certain latent code sample in the first... h The formula for calculating the eigenvalue of each feature determines the latent encoding before and after the shift. h The eigenvalues of the features; the latent encoding before and after the shift is at the _ . h The eigenvalues of the features are shown in formula (6); based on the latent encoding before and after the move, the eigenvalues of the features are shown in formula (6); h The eigenvalues of each feature are used to determine the amount of change in the eigenvalues; the amount of change in the eigenvalues is shown in formula (9); based on the change in the latent code and the amount of change in the eigenvalues, the value from... to ; the mapping relationship from to is shown in formula (10); the change of the feature value is reflected on the latent code by using the mapping relationship from to , and then the pre-trained generator is used to reflect in the generated image.
[0184] In one of the embodiments, the interpretable classifier in the interpretable classification module includes a fuzzification layer, a fuzzy logic layer and a classification layer; in the fuzzification layer, one D node is additionally added for each feature; D the node is initialized in a random manner and is continuously adjusted in the training process; when the antecedent of the fuzzy rule contains the D node, it indicates that the feature corresponding to the D node is ignored, and the fuzzy rule is rewritten as a rule with a more concise antecedent.
[0185] In one of the embodiments, the pre-trained generator in the visualization module is a pre-trained StyleGAN generator.
[0186] In one of the embodiments, according to the structural design of the fuzzy neural network model of the interpretable classifier, the fuzzy IF THEN rule is directly extracted from the model after the model is trained.
[0187] The specific limitations of the high-definition image interpretable classification device can be referred to the limitations of the high-definition image interpretable classification method in the foregoing, which will not be repeated here. Each module in the above high-definition image interpretable classification device can be realized by software, hardware and combinations thereof, in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0188] In one embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 13As shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement a high-definition image interpretable classification method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0189] Those skilled in the art can understand that, Figure 13 The skilled in the art can understand that,
[0190] In one embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0191] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps in the above method embodiments.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0193] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0194] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A high-definition image interpretable classification method characterized by, The method comprises: The obtained high-definition image is encoded by using a pre-trained StyleGAN encoder to obtain latent encoding and construct a latent space; The potential coding extracts a low-dimensional and interpretable feature vector from complex image information by using a conversion network; the conversion network is used to obtain a feature vector corresponding to the potential coding by using a feature direction in a potential space; a sample in the potential space w On the first h characteristic, the characteristic value is the cosine similarity between the sample in the potential space w and the feature direction in the potential space; the sample in the potential space w On the first h characteristic, the characteristic value is: wherein, is a feature direction of the sample in the latent space w on the first feature, h is a feature value of the sample in the latent space is a feature direction of the sample in the latent space w on the second feature. The mathematical expression of the conversion network is: wherein, is a latent encoding, is a latent encoding w output obtained after the input conversion network, s is a latent encoding corresponding feature vector, is a set of feature directions over all features, is an L1 norm; The feature vector is inferred and classified by using an interpretable classifier to obtain a class interpretable classification result; the interpretable classifier is used to simulate the reasoning ideas and classification process of the human brain by means of language type variables and IF-THEN rules, and the effective classification ability of the fuzzy neural network classifier is used to ensure the accuracy of the classification; The latent space is mapped to an image space by using a pre-trained generator to obtain a reconstructed high-definition image; The method further comprises a feature visualization method based on the pre-trained generator, and specific steps of the feature visualization method comprise: latent encoding w By moving through the latent space, the first image generated is... h The following features change, resulting in the latent encoding after the shift: wherein, w is the initial latent encoding, is the latent encoding after movement, is the direction of the h th feature, is the movement step size; According to the initial latent encoding and the moved latent encoding, the change of the latent encoding is determined as: According to a feature value calculation formula of a certain potential encoding sample on a first h feature, the feature value of the potential encoding before and after the movement on the first h feature is determined as: Based on the potential coding before and after the movement in the first h The eigenvalues of each feature are determined by the amount of change in those eigenvalues: According to the change of the potential code and the change amount of the characteristic value, a mapping relationship from to is determined as: The mapping relationship from to is used to reflect the change of the feature value on the latent code, and then the pre-trained generator is used to reflect in the generated image.
2. The high definition interpretable classification method of claim 1, wherein, The implementation process of the conversion network comprises: firstly determining the form of the feature direction, then finding the feature direction from the latent space, and finally designing a feature value measurement method to convert the feature direction into a feature vector.
3. The high definition interpretable classification method of claim 1, wherein, The interpretable classifier comprises a fuzzification layer, a fuzzy logic layer, and a classification layer. In the obfuscation layer, an additional feature is added for each feature D Node; D The nodes are initialized in a random manner and are continuously adjusted during the training process. When the antecedent of a fuzzy rule contains D a node, the D feature corresponding to the node is ignored and the fuzzy rule is rewritten as a more concise rule with the antecedent.
4. The high definition image interpretable classification method of claim 1, wherein, The pre-trained generator is a pre-trained StyleGAN generator.
5. The high definition interpretable classification method of claim 1, wherein, According to the structure design of the fuzzy neural network model of the interpretable classifier, the fuzzy IF-THEN rule is directly extracted from the model after the model is trained.
6. A high-definition image interpretable classification apparatus characterized by comprising: The device comprises: The latent encoding determination module of the pre-trained StyleGAN is used to encode the obtained high-definition image by using a pre-trained StyleGAN encoder to obtain latent encoding and convert the input image space into a latent space; The feature extraction module is configured to extract a low-dimensional and interpretable feature vector from complex image information by using a conversion network on the latent code; the conversion network is configured to obtain the feature vector corresponding to the latent code by using a feature direction in a latent space; and the sample in the latent space w The feature value of the sample in the latent space on the first h feature is a cosine similarity between the sample in the latent space and a feature direction w The feature value of the sample in the latent space on the first feature is a cosine similarity between the sample in the latent space and a feature direction w The feature value of the sample in the latent space on the first h feature is: wherein, is a feature direction of the sample in the latent space w is a feature value of the sample in the latent space h on the is a feature direction of the sample in the latent space w on the The mathematical expression of the conversion network is: wherein, is a latent encoding, is a latent encoding w output obtained after the input conversion network, s is a feature vector corresponding to the latent encoding, is a set of feature directions over all features, is an L1 norm; The interpretable classification module is used to infer and classify the feature vector by using an interpretable classifier to obtain a class interpretable classification result; the interpretable classifier is used to simulate the reasoning ideas and classification process of the human brain by means of language type variables and IF-THEN rules, and the effective classification ability of the fuzzy neural network classifier is used to ensure the accuracy of the classification; The visualization module is used to map the latent space to an image space by using a pre-trained generator to obtain a reconstructed high-definition image; The device further includes a feature visualization module based on a pre-trained generator, the feature visualization module being used to visualize the latent encoding. w By moving through the latent space, the first image generated is... h The following features change, resulting in the latent encoding after the shift: wherein, w is the initial latent encoding, is the latent encoding after movement, is the direction of the h th feature, is the movement step size; According to the initial latent encoding and the moved latent encoding, the change of the latent encoding is determined as: According to a feature value calculation formula of a certain potential encoding sample on a first h feature, the feature value of the potential encoding before and after the movement on the first h feature is determined as: Based on the potential coding before and after the movement in the first h The eigenvalues of each feature are determined by the amount of change in those eigenvalues: According to the change of the potential code and the change amount of the characteristic value, a mapping relationship from to is determined as: The mapping relationship from to is used to reflect the change of the feature value on the latent code, and then use the pre-trained generator to reflect in the generated image. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to realize the high-definition image interpretable classification method in any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the high-definition image interpretable classification method in any one of claims 1 to 5.
Citation Information
Patent Citations
Data classification method, system and device based on fuzzy neural network and storage medium
CN115587319A
Low-parameter GAN inversion method and device based on super network, and medium
CN118246488A