A method for generating semantic attribute sets for zero-shot learning
By jointly training teacher and student models to generate semantic attribute sets consistent with visual features, the problem of lack of auxiliary information in zero-shot learning is solved, and high-quality attribute set generation is achieved without expert attribute sets, thus improving the applicability and accuracy of zero-shot learning.
Patent Information
- Application Number
- CN202411378820.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing zero-shot learning methods rely on attribute sets constructed by experts, which makes them unsuitable in situations where fully labeled expert attribute sets are lacking, thus limiting their application scope. Furthermore, existing methods rely on knowledge graphs or are unstable due to adversarial training, affecting the quality of the generated auxiliary information.
By jointly training teacher and student models, a semantic attribute set consistent with image features is generated. The semantic attribute set is optimized using a multi-stage feedback mechanism and feature matching loss to ensure that the generated attribute set is consistent with the attribute set constructed by experts. This includes the training of generators and discriminators, feature matching, and attribute set optimization processes.
In scenarios where no expert attribute set is available, high-quality semantic attribute sets are generated, which improves the generalization and accuracy of semantic attributes, expands the application scope of zero-shot learning, and ensures the consistency between the generated attribute set and visual features and the fidelity of image details.
Smart Images

Figure CN119295763B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and machine learning technology, and more specifically, relates to a method for generating semantic attribute sets for zero-shot learning. Background Technology
[0002] Zero-shot learning aims to identify and classify unseen categories using limited labeled samples and auxiliary information such as semantic attributes or feature descriptions between classes. Its core idea is to generalize knowledge of known categories to new categories through auxiliary information, thereby overcoming the problem of some categories being unclassifiable due to a lack of training data. However, existing zero-shot learning methods typically rely on attribute sets constructed by experts. In practical applications, many datasets lack fully labeled expert attribute sets, limiting the applicability of zero-shot learning methods. Therefore, there is an urgent need for a method that can automatically generate attribute sets to fill the gaps in expert attribute sets for some categories, thus expanding the application scope of zero-shot learning methods.
[0003] Chinese patent CN117150018A proposes a multi-view zero-shot node classification network model and its training method. This method maps sample labels to entities in a knowledge graph, then combines this information with information from neighboring entities through weighted fusion to generate auxiliary information for classification and learning. The entire process relies on external knowledge (the knowledge graph) rather than extracting it solely from visual data. Based on the additional information from the knowledge graph, the auxiliary information generated by this method can cover a wide range of semantics and relationships. However, this method is overly dependent on the knowledge graph. If the knowledge graph is incomplete or contains errors, the quality of the generated auxiliary information will be affected, thus impacting the effectiveness of zero-shot learning.
[0004] Chinese patent CN116109898A proposes a generalized zero-shot learning method based on bidirectional adversarial training and relational metric constraints. This method generates a semantic attribute set through adversarial training and optimizes the generated attribute set using relational metric constraints to ensure its alignment with visual features. However, the instability of adversarial training can cause fluctuations in the generated attribute set, leading to poor alignment between the attribute set and visual features. This affects the model's generalization ability for some categories and limits its application in zero-shot learning tasks. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for generating semantic attribute sets for zero-shot learning, so as to solve the problem of lack of auxiliary information in zero-shot learning.
[0006] To achieve the aforementioned objectives, this invention provides a semantic attribute set generation method for zero-shot learning. This method jointly trains a teacher model and a student model to generate a semantic attribute set consistent with image features, ensuring that the generated attribute set is consistent with the attribute set constructed by experts, thus solving the problem of insufficient auxiliary information in zero-shot learning. Specifically, it includes the following steps:
[0007] S1. Teacher model branch: Generate image I1 based on the input expert construct attribute set A1, and ensure that the image is consistent with the original image I0 in the feature space;
[0008] S2. Student model branch: Extract features from the original image to generate a preliminary semantic attribute set A2. Generate a corresponding image I2 based on A2. Use the image I1 generated by the teacher model as a benchmark. Compare the features of I2 and I1 to obtain the feature differences between the two. Use the feature differences as a guidance signal. The student model optimizes A2 in reverse according to the guidance signal. Through multiple iterations, the feature expression of A2 is made closer to A1. At the same time, I2 is updated.
[0009] S3. Multi-stage training: Iterative collaborative training of the teacher and student models: The teacher model generates image I1 based on the attribute set constructed by the expert, providing guidance to the student model. The student model generates an initial semantic attribute set A2 and compares the features of the generated image I2 with the image I1 generated by the teacher model. It optimizes the semantic attribute set A2 using the guidance signal while simultaneously optimizing I2. Finally, the student model generates a semantic attribute set A that is consistent with the attribute set A1 constructed by the expert. f .
[0010] Furthermore, the teacher model branch in S1 includes:
[0011] S101. Generator: Based on Conditional Generative Adversarial Networks (GANs) c GAN (Generative Image Processing) structures generate images, specifically including:
[0012] (1) The embedding layer maps the input expert attribute set A1 to a high-dimensional space, generating the embedded attribute vector z. attr As shown in equation (1):
[0013] z attr =Embedding(A1) (1)
[0014] (2) The fully connected layer embeds the attribute vector z attr The feature vector z is mapped to serve as the initial feature input for the image generation process, as shown in equation (2):
[0015] z = FC(z) attr (2)
[0016] (3) The convolutional neural network generates the target image I1 step by step through multiple convolutional networks and upsampling layers, as shown in equation (3):
[0017] I1=G(z)=Tanh(Conv(...Conv(RELU(FC(Z attr (3)
[0018] (4) The generator loss calculation formula is shown in equation (4):
[0019] L G = -E[log(D(G(A1), A1))] (4)
[0020] S102. Discriminator: Given the input image I1 and attribute set A1, it determines whether the generated image is real, as shown in equation (5):
[0021]
[0022] Where σ is the Sigmoid activation function, This indicates a splicing operation.
[0023] The discriminator loss calculation formula is shown in equation (6):
[0024] L D =-E[log(D(I0,A1))]-E[log(1-D(G(A1),A1))] (6)
[0025] S103. Feature Matching Loss: To ensure that the generated image I1 is consistent with the original image I0 in the feature space, the feature matching loss L of the teacher model is defined. teacher As shown in equation (7):
[0026]
[0027] in, For the feature representation of image I0, This represents the features of image I1.
[0028] Furthermore, the student model branch in S2 includes:
[0029] S201. Target Region Extraction: Input the original image I0 into the attention mechanism to obtain the attention weight map F containing feature information of important regions of the image. attn Based on the weighted graph F attn The smallest rectangular image I3 containing the target is cropped from the original image I0.
[0030] S202. ViT Block Segmentation and Feature Extraction: Based on the minimum rectangular image I3 obtained in step S201, the image is segmented using the ViT model, and the features of each block are aggregated to obtain the global feature representation F. ViT As shown in equations (8) and (9):
[0031]
[0032] S203. Preliminary Attribute Set Generation: The global feature set F of the ViT model is generated through a fully connected layer. ViT Mapping to the semantic attribute space generates a preliminary semantic attribute set A2, as shown in equation (10):
[0033] A2 = W·F ViT +b (10)
[0034] Where W is the weight matrix of the mapping, and b is the bias term.
[0035] S204. Image I2 Generation: Based on the initially generated semantic attribute set A2, image I2 is generated through the generator module in the student model, as shown in equation (11):
[0036] I2=G(A2)=Tanh(Conv(...Conv(RELU(FC(A2))))) (11)
[0037] S205. Teacher Model Guidance and Attribute Set Optimization: Using the image I1 generated by the teacher model as a benchmark, I2 is compared with I1 to obtain the feature differences between the two, and the feature differences are used as the guidance signal L. S This signal reflects the feature inconsistency between images I2 and I1. Using the guidance signal L... S Optimize the attribute set A2 generated by the student model to generate the final semantic attribute set A f At the same time, it updates image I2 in reverse.
[0038] (1) Feature Comparison: The image I2 generated by the student model is compared with the image I1 generated by the teacher model. That is, I1 and I2 are mapped to the feature space to obtain their respective feature representations. and
[0039] (2) Generate guidance signal: Calculate and The feature differences between them are used as the guiding signal L. S Guidance signal L S The calculation method is shown in equation (12):
[0040]
[0041] (3) Attribute set optimization: based on the guidance signal L S By adjusting the initially generated semantic attribute set A2 through backpropagation, the final optimized semantic attribute set A2 is generated as shown in equation (13):
[0042]
[0043] Where η is the learning rate. gradient of the loss function for the student model
[0044] S206. Semantic Attribute Decoding and Threshold Filtering: Decode the semantic attribute set A2 and map it to the specific attribute label a. i and its corresponding numerical value s i Logarithmic value s i Apply threshold filtering to generate the final semantic attribute set A. f As shown in equation (14):
[0045] A f ={a i |s i >θ} (14)
[0046] Where θ is a preset threshold, a i For semantic attribute tags, s i This corresponds to the numerical value. The decoder maps the feature vector of A2 to the semantic label a. i Sum of values s i , numerical value s i This represents the confidence level of each semantic attribute.
[0047] S207. Loss Function Design:
[0048] (1) Attribute set consistency loss: To ensure that the semantic attribute set A generated by the student model is consistent... f To maintain consistency with the attribute set A1 constructed by experts, define the attribute set consistency loss L. consistency The calculation method is shown in equation (15):
[0049]
[0050] (2) Image reconstruction loss for student model: To ensure that the image I2 generated by the student model is consistent with the original image I0, an image reconstruction loss L is defined. rec As shown in equation (16):
[0051]
[0052] (3) Student model loss function: Combining feature alignment loss, attribute set consistency loss, and difference loss between the original image and the generated image, the final loss function of the student model is defined as shown in equation (17):
[0053] L student =L S +λ1L rec +λ2L consistency (17)
[0054] Furthermore, the multi-stage training in S3 includes:
[0055] S301. Teacher Model Training: Train the teacher model to generate a matching high-quality image I1 based on the attribute set A1 constructed by the expert.
[0056] Following the calculation method of equation (7), the feature matching loss L of I1 and I0 is obtained. teacher Feature matching loss L teacher Backpropagation is used to update the corresponding parameters in the teacher model, reducing the difference in feature space between the generated image I1 and the original image I0. This process is repeated iteratively, updating I1 until the difference in feature space between the generated image I1 and the original image I0 reaches a set threshold. This yields the teacher model-generated image I1.
[0057] S302. Student Model Training: In the initial training phase, the student model generates a preliminary semantic attribute set A2, and then generates a corresponding image I2 from A2. Using the image I1 obtained in S301 as the standard image, the features of image I2 and I1 are compared.
[0058] S303. Multi-stage feedback optimization: The feature contrast loss between images I2 and I1 in S302 is used as the guidance signal L. S The student model uses the guidance signal L S Backpropagation optimizes A2 through multiple iterations, making its feature representation closer to A1, while simultaneously updating image I2. The optimized A2 is then decoded and thresholded to generate a semantic attribute set A that is consistent with the expert-constructed attribute set A1. f .
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] 1. This invention utilizes a multi-stage feedback mechanism between a teacher model and a student model. During the inference stage, given an input image, the student model generates a preliminary semantic attribute set A2 through feature extraction. During the training stage, the feedback mechanism optimizes and adjusts the semantic attribute set A2, ultimately obtaining a semantic attribute set A that is consistent with the expert attribute set A1. fThe model generates high-quality semantic attribute sets in scenarios where no expert attribute set is available, filling the gaps in expert attribute sets for some categories that make zero-shot learning unsuitable and expanding the application scope of zero-shot learning methods.
[0061] 2. This invention enhances the generalization of semantic attributes generated by the model through multiple iterative optimizations and the introduction of feature matching loss. The image I2 generated by the student model is compared with the image I1 generated by the teacher model to obtain feature differences. These feature differences are used as guiding signals to back-optimize the semantic attribute set generated by the student model. This process converges iteratively, improving the generalization of the generated semantic attributes.
[0062] 3. This invention, guided by the teacher model, ensures that the image I2 generated by the student model remains consistent with the image I1 generated by the teacher model and the original image I0 in terms of feature space and visual feature representation. This process improves the image detail reproduction and provides feedback for optimizing the semantic attribute set A2 generated by the student model through feature comparison. Generating high-quality images helps to accurately capture semantic information in the images, improving the accuracy and consistency of the semantic attribute set generated by the student model. Attached Figure Description
[0063] Figure 1 This is an overall flowchart of the present invention;
[0064] Figure 2 This is a branch structure diagram of the teacher model of the present invention;
[0065] Figure 3 This is a branch structure diagram of the student model of the present invention. Detailed Implementation
[0066] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.
[0067] Combined with appendix Figure 1-3 The specific embodiments of the present invention will be described in detail below.
[0068] S1. Teacher model branch: Generate image I1 based on the input expert attribute set A1, and ensure that the image is consistent with the original image I0 in the feature space.
[0069] See Figure 2 Step S1 includes:
[0070] S101. Generator: Generates images based on a Conditional Generative Adversarial Network (cGAN) structure, specifically including:
[0071] (1) The embedding layer maps the input expert attribute set A1 to a high-dimensional space, generating the embedded attribute vector z. attr As shown in equation (1):
[0072] z attr =Embedding(A1) (1)
[0073] (2) The fully connected layer embeds the attribute vector z attr The feature vector z is mapped to serve as the initial feature input for the image generation process, as shown in equation (2):
[0074] z = FC(z) attr (2)
[0075] (3) The convolutional neural network generates the target image I1 step by step through multiple convolutional networks and upsampling layers, as shown in equation (3):
[0076] I1=G(z)=Tanh(Conv(...Conv(RELU(FC(Z attr (3)
[0077] (4) The generator loss is shown in equation (4):
[0078] L G = -E[log(D(G(A1), A1))] (4)
[0079] S102. Discriminator: The discriminator takes the image I1 and attribute set A1 as input and determines whether the generated image is real, as shown in equation (5):
[0080]
[0081] Where σ is the Sigmoid activation function, This indicates a splicing operation.
[0082] The discriminator loss is shown in equation (6):
[0083] L D =-E[log(D(I)] real ,A1))]-E[log(1-D(G(A1),A1))] (6)
[0084] S103. Feature Matching Loss: To ensure that the generated image I1 is consistent with the original image I0 in the feature space, a feature matching loss L is defined. teacher As shown in equation (7):
[0085]
[0086] S2. Student Model Branch: Extract features from the original image to generate a preliminary semantic attribute set A2. Generate a corresponding image I2 based on A2. Using the image I1 generated by the teacher model as a benchmark, compare the features of I2 and I1 to obtain the feature differences between them. Use the feature differences as a guidance signal. The student model optimizes A2 in reverse according to the guidance signal. Through multiple iterations, the feature expression of A2 is made closer to A1, and I2 is updated at the same time.
[0087] See Figure 3 Step S2 includes:
[0088] S201. Target Region Extraction: Input the original image I0 into the attention mechanism to obtain the attention weight map F containing feature information of important regions of the image. attn Based on the weighted graph F attn The smallest rectangular image I3 containing the target is cropped from the original image I0.
[0089] S202. ViT Block Segmentation and Feature Extraction: Based on the minimum rectangular image I3 obtained in step S201, the image is segmented using the ViT model, and the features of each block are aggregated to obtain the global feature representation F. ViT As shown in equations (8) and (9):
[0090]
[0091] S203. Preliminary Attribute Set Generation: The global feature set F of the ViT model is generated through a fully connected layer. ViT Mapping to the semantic attribute space, a preliminary semantic attribute set A2 is generated as shown in equation (10):
[0092] A2 = W·F ViT +b (10)
[0093] Where W is the weight matrix of the mapping, and b is the bias term.
[0094] S204. Image I2 Generation: Based on the initially generated semantic attribute set A2, the image I2 is generated by the generator module in the student model as shown in Equation (11):
[0095] I2=G(A2)=Tanh(Conv(...Conv(RELU(FC(A2))))) (11)
[0096] S205. Teacher Model Guidance and Attribute Set Optimization: Using the image I1 generated by the teacher model as a benchmark, I2 is compared with I1 to obtain the feature differences between the two, and the feature differences are used as the guidance signal L. S This signal reflects the feature inconsistency between images I2 and I1. Using the guidance signal L... SOptimize the attribute set A2 generated by the student model to generate the final semantic attribute set A f At the same time, it updates image I2 in reverse.
[0097] (1) Feature Comparison: The image I2 generated by the student model is compared with the image I1 generated by the teacher model. That is, I1 and I2 are mapped to the feature space to obtain their respective feature representations. and
[0098] Generate guidance signal: Calculate and The feature differences between them are used as the guiding signal L. S Guidance signal L S The calculation method is shown in equation (12):
[0099]
[0100] (3) Attribute set optimization: based on the guidance signal L S By adjusting the initially generated semantic attribute set A2 through backpropagation, the final optimized semantic attribute set A2 is generated as shown in equation (13):
[0101]
[0102] Where η is the learning rate. gradient of the loss function for the student model
[0103] S206. Semantic Attribute Decoding and Threshold Filtering: Decode the semantic attribute set A2 and map it to the specific attribute label a. i and its corresponding numerical value s i Logarithmic value s i Apply threshold filtering to generate the final semantic attribute set A. f As shown in equation (14):
[0104] A f ={a i |s i >θ} (14)
[0105] Where θ is a preset threshold, a i For semantic attribute tags, s i This corresponds to the numerical value. The decoder maps the feature vector of A2 to the semantic label a. i Sum of values s i , numerical value s i This represents the confidence level of each semantic attribute.
[0106] S207. Loss Function Design:
[0107] (1) Attribute set consistency loss: To ensure that the semantic attribute set A generated by the student model is consistent... f To maintain consistency with the attribute set A1 constructed by experts, define the attribute set consistency loss L. consistency The calculation method is shown in equation (15):
[0108]
[0109] (2) Image reconstruction loss for student model: To ensure that the image I2 generated by the student model is consistent with the original image I0, an image reconstruction loss L is defined. rec As shown in equation (16):
[0110]
[0111] (3) Student model loss function: Combining feature alignment loss, attribute set consistency loss, and difference loss between the original image and the generated image, the final loss function of the student model is defined as shown in equation (17):
[0112] L student =L S +λ1L rec +λ2L consistency (17)
[0113] S3. Multi-stage training: Iterative collaborative training of the teacher and student models. The teacher model generates image I1 based on the attribute set constructed by the expert, providing guidance to the student model. The student model generates an initial semantic attribute set A2 and compares the features of the generated image I2 with the image I1 generated by the teacher model, using the guidance signal to optimize the semantic attribute set while simultaneously optimizing I2. Finally, the student model generates a semantic attribute set A that is consistent with the attribute set A1 constructed by the expert. f .
[0114] See Figure 1 Step S3 includes:
[0115] S301. Teacher Model Training: Train the teacher model to generate a matching high-quality image I1 based on the attribute set A1 constructed by the expert.
[0116] Following the calculation method of equation (7), the feature matching loss L of I1 and I0 is obtained. teach Feature matching loss L teacher Backpropagation is used to update the corresponding parameters in the teacher model, reducing the difference in feature space between the generated image I1 and the original image I0. This process is repeated iteratively, updating I1 until the difference in feature space between the generated image I1 and the original image I0 reaches a set threshold. This yields the teacher model-generated image I1.
[0117] S302. Student Model Training: In the initial training phase, the student model generates a preliminary semantic attribute set A2, and then generates a corresponding image I2 from A2. Using the image I1 obtained in S301 as the standard image, the features of image I2 and I1 are compared.
[0118] S303. Multi-stage feedback optimization: The feature contrast loss between images I2 and I1 in S302 is used as the guidance signal L. S The student model uses the guidance signal L S Backpropagation optimizes A2 through multiple iterations, making its feature representation closer to A1, while simultaneously updating image I2. The optimized A2 is then decoded and thresholded to generate a semantic attribute set A that is consistent with the expert-constructed attribute set A1. f .
[0119] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A method for generating semantic attribute sets for zero-shot learning, characterized in that, Includes the following steps: S1. Teacher model branch: Generate image I1 based on the input expert construct attribute set A1, and ensure that the image is consistent with the original image I0 in the feature space; S2. Student model branch: Extract features from the original image to generate a preliminary semantic attribute set A2; Generate a corresponding image I2 based on A2, and use the image I1 generated by the teacher model as a benchmark to compare the features of I2 and I1 to obtain the feature differences between the two. Use the feature differences as a guidance signal, and the student model optimizes A2 in reverse according to the guidance signal. Through multiple iterations, the feature expression of A2 is made closer to A1, and I2 is updated at the same time. S3. Multi-stage training: Iterative collaborative training of the teacher model and the student model; the teacher model generates image I1 based on the attribute set constructed by the expert, providing guidance to the student model. The student model generates an initial semantic attribute set A2, and compares the features of the generated image I2 with the image I1 generated by the teacher model. It optimizes the semantic attribute set using the guidance signal while simultaneously optimizing I2. Finally, the student model generates a semantic attribute set A that is highly consistent with the expert-constructed attribute set A1. f ; S4. Inference Phase: After training is complete, using only the image to be tested I0 as input, the student model outputs the corresponding semantic attribute set A. f No need to input expert semantic attributes.
2. The semantic attribute set generation method for zero-shot learning according to claim 1, characterized in that, The teacher model branch in step S1 includes: S101. Generator: Image generation is designed based on a Conditional Generative Adversarial Network (cGAN) structure, specifically including: (1) The embedding layer maps the input expert attribute set A1 to a high-dimensional space, generating the embedded attribute vector z. attr As shown in equation (1): z attr =Embedding(A1) (1) (2) The fully connected layer embeds the attribute vector z attr The feature vector z is mapped to serve as the initial feature input for the image generation process, as shown in equation (2): z=FC(z attr ) (2) (3) The convolutional neural network generates the target image I1 step by step through multiple convolutional networks and upsampling layers, as shown in equation (3): I1=G(z)=Tanh(Conv(…Conv(RELU(FC(z attr ))))) (3) (4) The generator loss calculation formula is shown in equation (4): L G =-E[log (D(G(A1),A1))] (4) S102. Discriminator: Given the input image I1 and attribute set A1, it determines whether the generated image is real, as shown in equation (5): Where σ is the Sigmoid activation function, Indicates a splicing operation; The discriminator loss calculation formula is shown in equation (6): L D =-E[log(D(I0,A1))]-E[log (1-D(G(A1),A1))] (6) S103. Feature Matching Loss: To ensure that the generated image I1 is consistent with the original image I0 in the feature space, the feature matching loss L of the teacher model is defined. teacher As shown in equation (7):
3. The semantic attribute set generation method for zero-shot learning according to claim 1, characterized in that, The student model branch in step S2 includes: S201. Target Region Extraction: Input the original image I0 into the attention mechanism to obtain the attention weight map F containing feature information of important regions of the image. attn Based on the weighted graph F attn Cropping the smallest rectangular image I3 containing the target from the original image I0; S202. ViT Block Segmentation and Feature Extraction: Based on the minimum rectangular image I3 obtained in step S201, the image is segmented using the ViT model, and the features of each block are aggregated to obtain the global feature representation F. ViT As shown in equations (8) and (9): S203. Preliminary Attribute Set Generation: The global feature set F of the ViT model is generated through a fully connected layer. ViT Mapping to the semantic attribute space generates a preliminary semantic attribute set A2, as shown in equation (10): A2=W·F ViT +b (10) Where W is the weight matrix of the mapping, and b is the bias term; S204. Image I2 Generation: Based on the initially generated semantic attribute set A2, image I2 is generated through the generator module in the student model, as shown in equation (11): I2=G(A2)=Tanh(Conv(…Conv(RELU(FC(A2))))) (11) S205. Teacher Model Guidance and Attribute Set Optimization: Using the image I1 generated by the teacher model as a benchmark, I2 is compared with I1 to obtain the feature differences between the two, and the feature differences are used as the guidance signal L. S This signal reflects the feature inconsistency between images I2 and I1; using the guidance signal L S Optimize the attribute set A2 generated by the student model to generate the final semantic attribute set A f At the same time, it updates image I2 in reverse; (1) Feature comparison: The image I2 generated by the student model is compared with the image I1 generated by the teacher model. That is, I1 and I2 are mapped to the feature space to obtain their respective feature representations. and (2) Generate guidance signal: Calculate and The feature differences between them are used as the guiding signal L. S Guidance signal L S The calculation method is shown in equation (12): (3) According to the guidance signal L S By adjusting the initially generated semantic attribute set A2 through backpropagation, the final optimized semantic attribute set A2 is generated as shown in equation (13): Where η is the learning rate. gradient of the loss function for the student model S206. Semantic Attribute Decoding and Threshold Filtering: Decode the semantic attribute set A2 and map it to the specific attribute label a. i and its corresponding numerical value s i Logarithmic value s i Apply threshold filtering to generate the final semantic attribute set A. f As shown in equation (14): A f ={a i |s i >θ} (14) Where θ is a preset threshold, a i For semantic attribute tags, s i For the corresponding numerical value, the decoder maps the feature vector of A2 to the semantic label a. i Sum of values s i , numerical value s i This indicates the confidence level of each semantic attribute; S207. Loss Function Design: (1) Attribute set consistency loss: To ensure that the semantic attribute set A generated by the student model is consistent... f To maintain consistency with the attribute set A1 constructed by experts, define the attribute set consistency loss L. consistency The calculation method is shown in equation (15): (2) Image reconstruction loss for student model: To ensure that the image I2 generated by the student model is consistent with the original image I0, an image reconstruction loss L is defined. rec As shown in equation (16): (3) Student model loss function: Combining feature alignment loss, attribute set consistency loss, and difference loss between the original image and the generated image, the final loss function of the student model is defined as shown in equation (17): L student =L S +λ1L rec +λ2L consistency (17)。 4. The semantic attribute set generation method for zero-shot learning according to claim 2 or 3, characterized in that, The multi-stage training in step S3 includes: S301. Teacher Model Training: Train the teacher model to generate a matching high-quality image I1 based on the attribute set A1 constructed by the expert. Following the calculation method of equation (7), the feature matching loss L of I1 and I0 is obtained. teacher Feature matching loss L teacher Backpropagation is performed to update the corresponding parameters in the teacher model, reducing the difference between the generated image I1 and the original image I0 in the feature space; multiple iterations of optimization are performed, updating I1 until the difference between the generated image I1 and the original image I0 in the feature space reaches a set threshold; thus, the teacher model-generated image I1 is obtained. S302. Student Model Training: In the initial training phase, the student model generates a preliminary semantic attribute set A2, and then A2 generates the corresponding image I2. Using the image I1 obtained in S301 as the standard image, the features of image I2 and I1 are compared. S303. Multi-stage feedback optimization: The feature contrast loss between images I2 and I1 in S302 is used as the guidance signal L. S The student model uses the guidance signal L S Backpropagation optimizes A2 through multiple iterations, making its feature representation closer to A1, while simultaneously updating image I2. The optimized A2 is then decoded and thresholded to generate a semantic attribute set A that is highly consistent with the expert-constructed attribute set A1. f .
Citation Information
Patent Citations
Multi-view zero sample node classification network model, training method and device thereof and storage medium
CN117150018A
Generalized zero sample learning method based on bidirectional adversarial training and relation measurement constraint
CN116109898A