Small sample image classification method and device and electronic equipment

Through the small sample image classification method, multimodal fusion encoding is used to use the generative language model and CLIP model to solve the problem of data dependence and long training cycle in traditional image classification technology, and achieve fast and accurate image classification and adapt to individuality Demand.

CN119295814APending Publication Date: 2025-01-10CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411351440.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Traditional image classification technology relies on a large amount of labeled data, and the training cycle is long, making it difficult to quickly adapt to users' personalized needs. Especially in the fields of medical image analysis, there are problems such as dependence on labeled data and long training cycles.

Method used

The small sample image classification method is adopted to expand the category description text through a generative language model, and multimodal fusion encoding is performed in combination with the CLIP model. The dynamic image category is quickly constructed using a small number of sample images and text information, and the cosine similarity algorithm is used to calculate the image category probability. Reduce dependence on large amounts of labeled data.

Benefits of technology

It significantly reduces the dependence on large amounts of labeled data, improves the accuracy and flexibility of image classification, can quickly adapt to dynamic application needs, and reduces system deployment and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295814A_ABST
    Figure CN119295814A_ABST
Patent Text Reader

Abstract

The invention discloses a small sample image classification method and device and electronic equipment, and belongs to the technical field of image processing, and the method comprises the steps: obtaining an original category description text, and determining a target category description text based on a generative language model; obtaining a category code based on the target category description text and a sample image; obtaining a to-be-classified image, and encoding the to-be-classified image to obtain a to-be-classified image code; and based on the category code and the to-be-classified image code, calculating the category probability of the to-be-classified image by adopting a distance measurement algorithm, and determining a classification result. According to the method, dependence on a large amount of annotation data can be remarkably reduced, dynamic application requirements can be met through flexible category definition, and the accuracy of image classification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular relates to a small sample image classification method, device and electronic equipment. Background Art

[0002] Image classification aims to automatically assign input images to one or more predefined categories. This technology is widely used in data asset management, medical image analysis, security target detection, e-commerce product recommendation, etc. In real application scenarios, it is often necessary to quickly build personalized image classification based on user intentions, such as various photos or images with personalized labels collected or stored in users' daily lives.

[0003] Traditional image classification techniques usually rely on deep neural networks, especially convolutional neural networks (CNNs), which are trained with a large amount of labeled data to automatically extract features from images and assign them to fixed categories. However, these methods face some challenges, especially in practical applications, such as reliance on labeled data and long training cycles.

[0004] In order to solve the above problems, the present application proposes a small sample image classification method, device and electronic device. Summary of the invention

[0005] In order to address the deficiencies of the prior art, the present application provides a small sample image classification method, device and electronic device, which are used to solve the problems of the prior art in the dependency on annotated data and long training cycle for personalized images of users.

[0006] The technical effects to be achieved by this application are achieved through the following solutions: In a first aspect, the present application provides a small sample image classification method, comprising: Acquire an original category description text, and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text; Based on the target category description text and the sample image, a category code is obtained; Acquire an image to be classified, encode the image to be classified, and obtain a code of the image to be classified; Based on the category code and the code of the image to be classified, a distance metric algorithm is used to calculate the category probability of the image to be classified, and a classification result is determined.

[0007] In some embodiments, determining the target category description text based on the generative language model includes: Pre-defined prompt word template library; Filling the original category description text into the corresponding prompt word template to obtain the target prompt word; Inputting the target prompt word into the generative language model to obtain a response text; The target category description text is determined based on the reply text.

[0008] In some embodiments, determining the target category description text based on the reply text includes: inputting the reply text into a text encoder of a CLIP model to obtain a d-dimensional vector, wherein the d-dimensional vector represents the target category description text, and the d dimension is an integer.

[0009] In some embodiments, the generative language model is GPT-3.

[0010] In some embodiments, obtaining a category code based on the target category description text and the sample image includes: Encoding N sample images to obtain d-dimensional sample image encoding, where N is a positive integer less than 30; The target category description text and the sample image code are concatenated and feature-fused to obtain the category code.

[0011] In some embodiments, encoding the image to be classified to obtain the image code to be classified includes: inputting the image to be classified into an image encoder of a CLIP model to obtain the image code to be classified.

[0012] In some embodiments, the distance measurement algorithm includes: a cosine similarity algorithm.

[0013] In a second aspect, the present application provides a small sample image classification device, the device comprising: An intention description text expansion module is used to obtain an original category description text and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text; A multimodal fusion encoding module, used to obtain a category code based on the target category description text and sample image; An image encoding module is used to obtain an image to be classified, encode the image to be classified, and obtain a code of the image to be classified; The image classification module is used to calculate the category probability of the image to be classified based on the category code and the image code to be classified by using a distance measurement algorithm, and determine a classification result.

[0014] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods described above when executing the computer program.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any of the methods described above.

[0016] The small sample image classification method, device and electronic device provided in the embodiments of the present application combine image and text information, utilize a small number of sample images and category descriptions in text form, and quickly construct dynamic image categories that adapt to user intentions. This not only significantly reduces dependence on large amounts of labeled data, but also adapts to dynamic application needs through flexible category definitions, thereby improving the accuracy of image classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is a flowchart of a small sample image classification method in one embodiment of the present application; Figure 2 This is a specific implementation diagram of a small sample image classification method in one embodiment of the present application; Figure 3 It is a schematic block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0020] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in one or more embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0021] Related image classification methods: (1) Fixed classification categories: Traditional image classification models are usually oriented towards fixed categories and are difficult to dynamically adapt to new classification requirements. User needs are often changeable and personalized, while existing models often lack flexibility.

[0022] (2) Dependence on labeled data: The performance of deep learning models is highly dependent on a large amount of labeled data. However, obtaining and labeling this data is usually a time-consuming and costly process, especially in specific fields such as medical image analysis.

[0023] (3) Long training cycle: Training a high-performance image classification model requires a lot of computing resources and time, which is particularly inconvenient in a rapidly changing application environment.

[0024] Zero-shot classification method based on CLIP (Contrastive Language-Image Pre-Training) model: (1) Insufficient understanding of classification intent: Short and abstract category text (e.g. Ultraman) is directly used as input to extract its text semantic vector and match it with the feature vector of the image to be searched. In the process of image-text matching, more detailed text information (e.g. "The face has a pair of bright yellow or blue eyes; the style is full of sci-fi and often wears close-fitting armor") is often required to achieve better results.

[0025] (2) Only using unimodal information: Only using text description to express classification intent, without combining a small number of visual modality image samples to obtain a richer and more accurate classification intent representation.

[0026] Therefore, it is necessary to adopt the small sample image classification method, device and electronic device provided by the present application. The method should mainly target photos or images collected or stored in the user's daily life. These photos or images are closely related to the user and have personalized characteristics. They are not suitable for large-scale model training. Therefore, the small sample image classification method of the present application is adopted, that is, the classification of such personalized images or photos is the main application scenario of the present application.

[0027] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.

[0028] First, refer to Figure 1 and Figure 2 , the small sample image classification method of this application is described in detail: First, as Figure 1 As shown, the present application provides a small sample image classification method, comprising: S1: Acquire an original category description text, and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text.

[0029] In some embodiments, determining the target category description text based on the generative language model includes: Pre-defined prompt word template library; Filling the original category description text into the corresponding prompt word template to obtain the target prompt word; Inputting the target prompt word into the generative language model to obtain a response text; The target category description text is determined based on the reply text.

[0030] In some embodiments, determining the target category description text based on the reply text includes: inputting the reply text into a text encoder of a CLIP model to obtain a d-dimensional vector, wherein the d-dimensional vector represents the target category description text, and the d dimension is an integer.

[0031] In some embodiments, the generative language model is GPT-3.

[0032] Exemplarily, step S1 is performed by the intention description text expansion module, the core function of which is to expand the original category description text (Tc) provided by the user into a more fine-grained description text (i.e., the target category description text). The specific steps are as follows: 1.1 Prompt word template construction Assume that the user's classification intent text is "Ultraman", set to Tc. In order to generate a richer description, a prompt word (Prompt) template Tp is predefined as follows: Tp = "Please use 5 short sentences to describe {Tc}, each sentence does not exceed 20 words".

[0033] 1.2 Generate extended text Fill Tc into the template to generate a complete prompt word P: P = "Please use 5 short sentences to describe Ultraman, each sentence does not exceed 20 words", input the prompt word P into the generative language model, that is, the large language model (such as GPT-3), and set the generated reply text to Td: Td = GPT-3 (P). At this time, the reply text Td can be as follows (such as Figure 2 As shown in the figure, the expanded description text for "Ultraman" is obtained by inputting from Ultraman): Ultraman is tall and wears a silver helmet.

[0034] He has a tight red and silver combat suit.

[0035] The eyes are bright and oval in shape, with a mysterious look.

[0036] There is a glowing energy indicator on the chest.

[0037] His posture is majestic and full of power.

[0038] 1.3 Text Encoding Input the generated reply text Td into the text encoder of the CLIP model to obtain the text representation vector VT: VT=CLIP_text_encoder(Td), where VT is a d-dimensional vector representing the expanded classification intent, that is, the target category description text.

[0039] S2: Obtain a category code based on the target category description text and the sample image.

[0040] In some embodiments, obtaining a category code based on the target category description text and the sample image includes: Encode the N sample images to obtain d-dimensional sample image encoding, where N is a positive integer less than 30; the N sample images are small sample images, that is, by using a small number of sample images to assist in obtaining category encoding, the accuracy of image classification can be improved.

[0041] The target category description text and the sample image code are concatenated and feature-fused to obtain the category code.

[0042] Exemplarily, the above step S2 may be implemented using a multimodal fusion coding module; the function of this module is to fuse and encode the expanded target category description text with the reference sample image to generate a comprehensive category feature representation.

[0043] 2.1 Sample Image Coding For the sample images IR1, IR2, and IR3 provided by the user (here is an example, and other numbers of sample images can also be used), they are respectively input into the image encoder of the CLIP model for encoding to obtain the corresponding representation vectors: VI1=CLIP_image_encoder(IR1); VI2=CLIP_image_encoder(IR2); VI3=CLIP_image_encoder(IR3).

[0044] The dimension of each vector is d, where d is an integer and represents the visual features of each image, that is, a d-dimensional sample image encoding is obtained.

[0045] 2.2 Image Representation Fusion The three sample image coding representation vectors are fused using element-wise average operation to obtain the unified representation VI of the fused sample image coding: VI=(VI1+VI2+VI3) / 3.

[0046] 2.3 Concatenation and feature fusion The target category description text VT is concatenated with the sample image encoding representation vector VI (concat operation), and then the concatenated vector is input into a fully connected layer neural network (MLP) for further feature fusion to obtain the final fusion vector encoding Vfusion (d dimension): Vfusion=MLP([VT,VI]).

[0047] That is, the category code is obtained. This step obtains more accurate category code information, which facilitates the subsequent classification of images and improves the accuracy.

[0048] S3: Acquire the image to be classified, encode the image to be classified, and obtain the image code to be classified.

[0049] Exemplarily, the images to be classified are a number of images that need to be classified. The images to be classified may be images obtained from multiple channels, such as captured from the Internet, provided by users, etc.

[0050] In some embodiments, encoding the image to be classified to obtain the image code to be classified includes: inputting the image to be classified into an image encoder of a CLIP model to obtain the image code to be classified.

[0051] Specifically, step S3 can be implemented by an image encoding module, which encodes all images to be classified. Assume that there are n images to be classified (n is a positive integer), which are input into the image encoder of the CLIP model respectively to obtain the corresponding encoding representation of each image to be classified: IT1 = CLIP_image_encoder(I1); IT2 = CLIP_image_encoder(I2); … ITn = CLIP_image_encoder(In).

[0052] That is, the image codes to be classified corresponding to each image to be classified are obtained.

[0053] S4: Based on the category code and the code of the image to be classified, a distance measurement algorithm is used to calculate the category probability of the image to be classified, and a classification result is determined.

[0054] In some embodiments, the distance measurement algorithm includes: a cosine similarity algorithm.

[0055] Exemplarily, the image classification module may be used to implement step S4, as follows: 4.1 Distance Metrics Taking the category code Vfusion and the image code ITi as input (i represents any image among 1-n images to be classified), the cosine similarity is used to calculate the probability that each image to be classified belongs to the current category: simi = (Vfusion⋅ITi) / (||Vfusion||⋅||ITi||) Among them, simi represents the similarity between the category code and the image code to be classified.

[0056] 4.2 Classification Decision After calculating the similarity between the image to be classified and the category intent in the above manner, the final classification result is obtained based on a budgeted similarity threshold t. That is, images with a similarity value higher than t are judged to belong to the current category (in this case, "Ultraman"), and images with a similarity value less than or equal to t are judged not to belong to the current category. The similarity threshold t can be determined based on actual conditions and is not specifically limited here.

[0057] The small sample image classification method, device and electronic device provided in the embodiments of the present application combine image and text information, utilize a small number of sample images and category descriptions in text form, and quickly construct dynamic image categories that adapt to user intentions. This not only significantly reduces dependence on large amounts of labeled data, but also adapts to dynamic application needs through flexible category definitions, thereby improving the accuracy of image classification.

[0058] In a second aspect, the present application provides a small sample image classification device, the device comprising: An intention description text expansion module is used to obtain an original category description text and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text; A multimodal fusion encoding module, used to obtain a category code based on the target category description text and sample image; An image encoding module is used to obtain an image to be classified, encode the image to be classified, and obtain a code of the image to be classified; The image classification module is used to calculate the category probability of the image to be classified based on the category code and the image code to be classified by using a distance measurement algorithm, and determine a classification result.

[0059] The above-mentioned small sample image classification device can achieve all the technical effects of a small sample image classification method of the present application, which will not be repeated here.

[0060] About the application scenarios and advantages of this application 1) Personalized classification in dynamic scenarios The method of the present invention is particularly applicable in scenarios such as cloud disks and smart photo albums where classification needs to be dynamically constructed according to user intentions. Through text expansion and image encoding of a small number of samples, the method can quickly adapt to users' new classification needs. For example, users may temporarily want to classify all pictures of "Ultraman", which is difficult to achieve in traditional models.

[0061] 2) Reduce annotation costs In many practical scenarios, labeling a large amount of data is costly and time-consuming. The method of the present invention significantly reduces the reliance on a large amount of labeled data by combining a large language model with a small number of samples, thereby reducing the cost of system deployment and maintenance.

[0062] 3) Flexibility to respond to new categories Traditional image classification models usually need to be retrained when dealing with new categories. However, the method of the present invention generates fine-grained text descriptions through a large language model, combined with a fusion representation of a small number of sample images, which can flexibly respond to the emergence of new categories without retraining the entire model.

[0063] 4) Summary and future prospects This paper proposes a small sample image classification method for image-text fusion. By combining the generative language model with the CLIP model, the accuracy and flexibility of image classification are significantly improved under the condition of a small amount of sample data. The above method is conducive to further optimizing the multimodal fusion strategy, improving the performance of the model in more complex scenarios, and exploring how to efficiently deploy this technology in an end-to-end system to better serve dynamic and diverse user needs.

[0064] It should be noted that the method of one or more embodiments of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of one or more embodiments of the present application, and the multiple devices will interact with each other to complete the described method.

[0065] It should be noted that the above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0066] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also discloses an electronic device; Specifically, Figure 3 The hardware structure diagram of an electronic device for a small sample image classification method provided in this embodiment is shown, and the device may include: a processor 410, a memory 420, an input / output interface 430, a communication interface 440, and a bus 450. The processor 410, the memory 420, the input / output interface 430, and the communication interface 440 are connected to each other in communication within the device through the bus 450.

[0067] The processor 410 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0068] The memory 420 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 may store an operating system and other application programs. When the technical solution provided in the embodiment of the present application is implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.

[0069] The input / output interface 430 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0070] The communication interface 440 is used to connect a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (for example, USB, network cable, etc.) or a wireless mode (for example, mobile network, WIFI, Bluetooth, etc.).

[0071] The bus 450 includes a path that transmits information between the various components of the device (eg, the processor 410 , the memory 420 , the input / output interface 430 , and the communication interface 440 ).

[0072] It should be noted that, although the above device only shows the processor 410, the memory 420, the input / output interface 430, the communication interface 440 and the bus 450, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.

[0073] The electronic device of the above embodiment is used to implement the corresponding small sample image classification method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0074] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, one or more embodiments of the present application also provide a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the small sample image classification method described in any of the above embodiments.

[0075] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0076] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the small sample image classification method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0077] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0078] In addition, to simplify the description and discussion, and in order not to make one or more embodiments of the present application difficult to understand, the well-known power / ground connections to the integrated circuit (IC) chip and other components may or may not be shown in the provided figures. In addition, the device may be shown in the form of a block diagram to avoid making one or more embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which one or more embodiments of the present application will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that one or more embodiments of the present application can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0079] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.

[0080] One or more embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A small sample image classification method, characterized in that: The method comprises: Acquire an original category description text, and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text; Based on the target category description text and the sample image, a category code is obtained; Acquire an image to be classified, encode the image to be classified, and obtain a code of the image to be classified; Based on the category code and the image code to be classified, a distance metric algorithm is used to calculate the category probability of the image to be classified, and a classification result is determined.

2. The small sample image classification method according to claim 1, characterized in that: The determining of the target category description text based on the generative language model includes: Pre-defined prompt word template library; Filling the original category description text into the corresponding prompt word template to obtain the target prompt word; Inputting the target prompt word into the generative language model to obtain a response text; The target category description text is determined based on the reply text.

3. The small sample image classification method according to claim 2, characterized in that: The determining the target category description text based on the reply text includes: inputting the reply text into a text encoder of a CLIP model to obtain a d-dimensional vector, wherein the d-dimensional vector represents the target category description text, and the d dimension is an integer.

4. The small sample image classification method according to claim 2 or 3, characterized in that: The generative language model is GPT-3.

5. The small sample image classification method according to claim 1, characterized in that: Based on the target category description text and the sample image, a category code is obtained, including: Encoding N sample images to obtain d-dimensional sample image encoding, where N is a positive integer less than 30; The target category description text and the sample image code are concatenated and feature-fused to obtain the category code.

6. The small sample image classification method according to claim 1 or 5, characterized in that: The encoding of the image to be classified to obtain the image code to be classified includes: inputting the image to be classified into an image encoder of a CLIP model to obtain the image code to be classified.

7. The small sample image classification method according to claim 6, characterized in that: The distance measurement algorithm includes: a cosine similarity algorithm.

8. A small sample image classification device, characterized in that: The device comprises: An intention description text expansion module is used to obtain an original category description text and determine a target category description text based on a generative language model, wherein the category target description text is an expanded category description text for the original category description text; A multimodal fusion encoding module, used to obtain a category code based on the target category description text and sample image; An image encoding module is used to obtain an image to be classified, encode the image to be classified, and obtain a code of the image to be classified; The image classification module is used to calculate the category probability of the image to be classified based on the category code and the image code to be classified by using a distance measurement algorithm, and determine a classification result.

9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method according to any one of claims 1 to 7.