Multi-modal multi-granularity feature fusion expression package emotion recognition method based on large model
Through the multi-modal multi-granularity feature fusion method based on large models, combined with CLIP and LLM models, the problem of single-modality dependence and subtle emotional difference recognition in emoticon emotion recognition is solved, and the accurate identification and classification of emoticon emotion is achieved. , improving the accuracy of emotion recognition and the ability to understand complex emotional expressions.
Patent Information
- Application Number
- CN202410762978.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-13
AI Technical Summary
Existing technologies have problems with single-modality dependence and difficulty in capturing subtle emotional differences in emoticon emotion recognition. Especially when the emotional expression of emoticons is complex or subtle, the accuracy is insufficient.
Using a multi-modal and multi-granularity feature fusion method based on a large model, the global image features and image block features are obtained through the CLIP model, and a fine-grained image-text consistency similarity map is constructed based on the text features. The image features are fused and the cross-entropy loss function is used. Fine-tuning, and then embedding features into the LLM model for emotion category prediction, improves emotion recognition accuracy through two-stage fine-tuning.
It achieves accurate recognition and classification of emoticon emotions, improves the accuracy of emotion recognition and the ability to understand complex emotional expressions, and overcomes the limitations of single-modal dependence and the capture of subtle emotional differences.
Smart Images

Figure CN118537908A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a multi-modal and multi-granularity feature fusion expression package emotion recognition method based on a large model. Background Art
[0002] With the continuous advancement of artificial intelligence technology, the application of this field has become increasingly extensive and in-depth on the Internet. Especially in terms of emotional expression and online communication, artificial intelligence has shown unprecedented potential. Developers can optimize the Internet community to a certain extent by judging the emotional information of the user's emoticon package. The present invention relates to an emoticon package emotion recognition method based on artificial intelligence, which aims to automatically analyze emoticons and accurately identify the specific emotions expressed by them. The method analyzes and emotionally annotates image content through deep learning and pattern recognition technology, thereby realizing intelligent recognition of emoticon package emotions. The emoticon package emotion recognition technology of the present invention provides new tools and perspectives for research and development in the fields of emotion analysis, user behavior research, personalized recommendation systems, etc. The advancement of this technology helps to have a deeper understanding of users' emotional reactions and behavior patterns, thereby playing a key role in improving user experience and interaction quality.
[0003] Emotion recognition, as an important direction of natural language processing (NLP), has expanded from single text analysis to the interpretation of multimodal data, including images, videos, and audio. Among the numerous multimodal data, emoticons, as a widely popular online communication element, provide new research objects and challenges for sentiment analysis due to their rich and intuitive emotional expressions. Emoticons usually contain visual elements and potential text information, which requires emotion recognition technology to not only understand the image content, but also combine it with the related text description to achieve a deeper level of emotional understanding.
[0004] In addition, the development of multimodal emotion recognition technology reflects the evolutionary trend from a single modality to multimodal interaction. For example, the emergence of multimodal pre-trained models such as the CLIP model provides powerful tools for the joint understanding and sentiment analysis of images and texts. These models are able to learn the associations between images and texts, providing new solutions for the emotion recognition of emoticons. However, multimodal emotion recognition also faces a series of challenges. Semantic alignment between different modalities, information redundancy or complementarity between modalities, and differences in emotional expression in different cultural backgrounds are all issues that need to be addressed in this field. In addition, the high cost of labeling and difficulty in obtaining multimodal data also limit the training and optimization of the model. To overcome these challenges, researchers are exploring more advanced model architectures, such as attention mechanisms and graph neural networks, to better integrate and learn interactive information between different modalities. At the same time, interdisciplinary collaborations, such as the participation of psychology, sociology, and cognitive science, can also help to gain a deeper understanding of the nature of emotions and promote the development of emotion recognition technology.
[0005] In current social networks, users express their emotions and attitudes through text, images, and emoticons. Among them, emoticons are widely used on social media because of their simplicity and intuitiveness, and they can often quickly convey the sender's emotional state. However, traditional text sentiment analysis techniques are difficult to apply directly to emoticons, because the visual elements and potential text information in emoticons need to be combined and analyzed to accurately identify the emotional tendencies therein. Secondly, the same series of emoticons usually use fixed characters (such as virtual cartoon characters) as the main body to express emotions, and these emoticons are highly similar in character and style. Therefore, it is necessary to distinguish the emotions they convey through subtle differences in details. In addition, due to the diversity and complex composition elements of emoticons, this task is even more difficult. In response to this challenge, the present invention proposes a multimodal feature fusion emoticon emotion recognition system based on a large model. This method can not only analyze the complex visual elements in emoticons and capture the detailed differences therein, but also combine the text information related to it, and realize the accurate recognition of emoticon emotions through deep learning and pattern recognition technology. Through this method, we can more comprehensively understand the emotional expressions of users in social interactions and provide more accurate sentiment analysis tools for fields such as social media analysis, user behavior research, and personalized recommendation systems.
[0006] However, there are some limitations in the existing technologies of “Multimodal Local Re-Attention Network” and “Sticker CLIP”:
[0007] 1. Single modality dependency: Existing techniques such as “Multimodal Local Re-Attention Network” mainly focus on integrating the global and local features of emojis through local attention mechanisms. However, this approach may be too dependent on the information of a single modality (image) and does not fully utilize the potential of multimodal data.
[0008] 2. Depth of emotion recognition: Although StickerCLIP improves emotion recognition performance through large-scale image-text alignment, it may have limitations in capturing and understanding subtle emotional differences in emoticons, especially when the emotional expressions are complex or subtle. Summary of the invention
[0009] The technical problem to be solved by the present invention is how to make full use of the consistency of multimodal data, accurately capture and understand the subtle emotional differences in emoticons, and improve the accuracy of emotion recognition; in view of this, the present invention provides an emoticon emotion recognition method based on a large model and multi-modal and multi-granularity feature fusion.
[0010] The technical solution adopted by the present invention is a multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model, comprising:
[0011] Step 1, obtain the image and text data pairs extracted from the emoticon package and input them into the CLIP model to obtain the image global features, image block features and text features;
[0012] Step 2, constructing a similarity graph representing fine-grained image-text consistency based on the cosine similarity between the text feature and each of the image block features;
[0013] Step 3: According to the similarity graph, use the configured threshold to filter the image block features with the highest similarity to the text features, and obtain the sequence index of the image block;
[0014] Step 4, fusing the global image features with the image block features corresponding to the sequence index to obtain multi-granularity fused image features;
[0015] Step 5, based on the multi-granularity fusion image features, using the fully connected layer as the sentiment prediction head, using the cross entropy loss function as the sentiment classification loss, adjusting and freezing the CLIP model;
[0016] Step 6, obtaining the expression package to be recognized and passing it through the currently frozen CLIP model image encoder, repeating steps 1 to 4 to obtain the fused image features to be recognized;
[0017] Step 7, embedding the fused image features to be identified into a preset prompt template to form an input structure;
[0018] Step 8, inputting the input structure into the LLM model for fine-tuning and predicting the emotion category;
[0019] Step 9: According to the emotion category prediction result, adjust the LLM model and iterate until the LLM model meets the preset requirements in emotion recognition.
[0020] In one embodiment, the method further comprises:
[0021] The emoticon images in the acquired emoticon dataset that are not accompanied by text annotations are used to generate descriptive text for these images using the pre-trained BLIP-2 model to expand the image-text data pairs in the dataset.
[0022] In one embodiment, in step 1,
[0023] The image-text data pair outputs text features F through multiple ViT modules of the encoder text , image feature F img , the hidden layer image feature is expressed as:
[0024]
[0025] in, represents the global feature vector, L represents the number of ViT modules;
[0026] The image block features are:
[0027]
[0028] In one embodiment, step 2 comprises:
[0029]
[0030] Wherein, sim is the fine-grained similarity graph, · represents the vector inner product operation, and ||·||2 represents the Euclidean norm of the vector.
[0031] In one embodiment, in step 4, the multi-granularity fusion image feature is determined by the following formula:
[0032]
[0033] in, represents the global feature vector output by the L-1 layer, and k represents the selection of the k image block vectors with the highest cosine similarity.
[0034] In one embodiment, step 5 comprises:
[0035] Determine the probability distribution of each emotion category as shown below:
[0036]
[0037] Among them, W is the weight matrix of the linear layer, C represents the total number of emotion categories, and P i Represents the probability of the model predicting the i-th emotion category;
[0038] The cross entropy loss function is used to calculate the difference between the model output probability distribution P and the true label distribution Y, and the sentiment classification loss is minimized to fine-tune CLIP;
[0039] Among them, the cross entropy loss function L is shown as follows:
[0040]
[0041] By minimizing the cross entropy loss function, adjusting the CLIP model so that the CLIP model maps the image-text pair features to the correct emotion category;
[0042] Freeze the adjusted CLIP model.
[0043] In one embodiment, in step 7, the preset prompt template includes: fused image features to be identified, corresponding text, and specific emotion prediction prompts.
[0044] In one embodiment, in step 9, according to the predicted emotion category, the loss function weights and hyperparameters of the LLM model are adjusted to perform iterative improvements until the model achieves optimal performance in the emotion recognition task.
[0045] Another aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the multi-modal and multi-granularity feature fusion emoticon emotion recognition method based on a large model as described in any one of the above items.
[0046] Another aspect of the present invention further provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the multi-modal and multi-granular feature fusion emoticon emotion recognition method based on a large model as described in any of the above items are implemented.
[0047] Compared with the prior art, the present invention has at least the following advantages:
[0048] The embodiment of the present application provides a multimodal feature fusion emoticon emotion recognition system based on a large model, which achieves accurate recognition and classification of emoticon emotions through two stages of fine-tuning. In the first stage, a pre-trained BLIP-2 model is used to generate descriptive text for emoticons without labeled text, and the CLIP model is used for fine-tuning to learn image feature representations and enhance the ability to select key local features. These feature representations can maintain consistency with text features at the content level and emphasize the detailed differences between emoticon elements. In the second stage, the parameters of the CLIP model are frozen, and the multi-granular image representation and text are embedded in a structured preset template, and the large pre-trained language model is fine-tuned to predict emotion categories, further improving the model's emotion recognition ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of the flow of a method for emotion recognition of emoticons based on a large model of multi-modal and multi-granular features fusion according to an embodiment of the present invention;
[0050] Figure 2 is a logical schematic diagram of a method for fusion of multi-modal and multi-granular features based on a large model according to an embodiment of the present invention;
[0051] Figure 3 Another flowchart of the method for emotion recognition of emoticons based on multi-modal and multi-granularity feature fusion based on a large model according to an embodiment of the present invention;
[0052] Figure 4 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the present invention is described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0054] Unless otherwise defined, all terms (including technical terms and scientific terms) used in this article have the same meaning as commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that terms (such as terms defined in commonly used dictionaries) should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and will not be interpreted in an idealized or overly formal sense unless explicitly defined in this article.
[0055] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0056] The abbreviations and key terms used in this article are defined below:
[0057] OCR: Optical Character Recognition, optical character recognition;
[0058] BLIP-2: Bootstrapping Language-Image Pretraining, a multimodal pre-training model for images and text proposed by Salesforce in 2023;
[0059] CLIP: Contrastive Language-Image Pre-Training, language-image pre-training large model using contrastive learning;
[0060] ViT: Vision Transformer, a model proposed by the Google team in 2020 that applies Transformer to image classification;
[0061] LLM: Large Language Model, large language model;
[0062] ReLU: Rectified LinearUnit, linear rectification function, an activation function;
[0063] BP: Back Propagation, back propagation;
[0064] Adam: A method for Stochastic Optimizaiton, a stochastic gradient descent method.
[0065] In an embodiment of the present invention, a method for emotion recognition of emoticons based on multi-modal and multi-granular feature fusion based on a large model is provided. Figure 1 As shown, including:
[0066] Step 1, obtain the image and text data pairs extracted from the emoticon package and input them into the CLIP model to obtain the image global features, image block features and text features;
[0067] Step 2, constructing a similarity graph representing fine-grained image-text consistency based on the cosine similarity between the text feature and each of the image block features;
[0068] Step 3: According to the similarity graph, use the configured threshold to filter the image block features with the highest similarity to the text features, and obtain the sequence index of the image block;
[0069] Step 4, fusing the global image features with the image block features corresponding to the sequence index to obtain multi-granularity fused image features;
[0070] Step 5, based on the multi-granularity fusion image features, using the fully connected layer as the sentiment prediction head, using the cross entropy loss function as the sentiment classification loss, adjusting and freezing the CLIP model;
[0071] Step 6, obtaining the expression package to be recognized and passing it through the currently frozen CLIP model image encoder, repeating steps 1 to 4 to obtain the fused image features to be recognized;
[0072] Step 7, embedding the fused image features to be identified into a preset prompt template to form an input structure;
[0073] Step 8, inputting the input structure into the LLM model for fine-tuning and predicting the emotion category;
[0074] Step 9: According to the emotion category prediction result, adjust the LLM model and iterate until the LLM model meets the preset requirements in emotion recognition.
[0075] The method provided in this embodiment will be described in detail step by step below.
[0076] As attached Figure 2 , 3 As shown, the present application provides a multi-modal feature fusion expression package emotion recognition system based on a large model. The specific implementation scheme is divided into two stages. The first stage includes:
[0077] Filter out emoji images without text annotations from the dataset, and use the pre-trained BLIP-2 model to generate descriptive text for these images to expand the text information in the dataset, which is convenient for subsequent fine-grained image-text alignment.
[0078] Step 1: Input the image-text pair data into the CLIP model to obtain image block encoding and text encoding. The model input can be expressed as:
[0079] Input={V,T,Y}
[0080] Among them, V represents the emoticon image, T represents the text extracted by OCR in the dataset or the descriptive text generated by the BLIP-2 model in step 1, and Y represents the emotional category label of the emoticon.
[0081] It should be noted that the image encoder of the CLIP model consists of multiple Transformer modules, each of which contains a multi-head attention layer (MSA), an MLP layer and two residual connections. LN represents layer normalization, and the calculation process is expressed as:
[0082]
[0083] The data is passed through multiple ViT modules of the encoder to output text features F text , image feature F img , the hidden layer image feature is expressed as:
[0084]
[0085] in represents the global feature vector, and L represents the number of ViT modules.
[0086] The image block vector can be expressed as:
[0087]
[0088] In some embodiments, before input, emoticon images without text annotations can be screened out from the dataset, and a pre-trained BLIP-2 model can be used to generate descriptive text for these images to expand the text information in the dataset and facilitate subsequent fine-grained image-text alignment work.
[0089] Step 2: Calculate the cosine similarity between the text feature and each image block vector to construct a similarity graph that reflects the fine-grained consistency between text and image. Specifically, it is expressed as:
[0090]
[0091] Among them, F text and F i_t Obtained from the previous step, “·” represents the vector inner product operation, and ||·||2 represents the Euclidean norm (L2 norm) of the vector;
[0092] Step 3: According to the cosine similarity graph obtained in step 2, select some image blocks with the highest similarity to the text features and obtain their sequence indexes;
[0093] Step 4: Based on the selected index, fuse the global image features with the image block features selected in step 4;
[0094] The image block is selected according to the index, the global feature vector is concatenated with the image block vector, and input into the last Transformer layer. The fused image feature is expressed as:
[0095]
[0096] in represents the global feature vector output by the L-1 layer, and k represents the selection of the k image block vectors with the highest cosine similarity.
[0097] By fusing the global feature vector with the image block vector, not only the global information is retained and a multi-granular image feature representation is obtained, but also the last layer is forced to focus the Transformer on the key area, reducing the interference of background information.
[0098] Step 5: Using the fully connected layer as the emotion prediction head, the fused feature representation after the Transformer layer will pass through a linear layer (also called a fully connected layer), and then normalized through the softmax layer to generate the probability distribution of each emotion category. The calculation is expressed as:
[0099]
[0100] Among them, W is the weight matrix of the linear layer, C represents the total number of emotion categories, and P i Represents the probability of the model predicting the i-th sentiment category.
[0101] Optionally, the cross entropy loss function is used to calculate the difference between the model output probability distribution P and the true label distribution Y, and the sentiment classification loss is minimized to fine-tune CLIP. During the fine-tuning process, the model learns to map the image and text features to the correct sentiment category. The loss function L is expressed as:
[0102]
[0103] By minimizing the cross entropy loss function L, the model learns to map image and text features to the correct sentiment categories, thereby optimizing the sentiment classification task.
[0104] The main purpose of the training strategy in the first stage is to make full use of the information consistency between multimodal data and optimize the image feature representation. The multi-granular image fusion feature integrates the global information and subtle differences in the expression package as an important input component of the second stage.
[0105] The second phase uses LLM for sentiment reasoning, using its powerful language processing capabilities and prior knowledge to fine-tune the model and improve its ability to recognize sentiment-related information. The specific implementation includes:
[0106] Step 6: Pass the emoticon image through the frozen CLIP model image encoder and repeat steps 1 to 4 in the previous stage to obtain image fusion features.
[0107] Step 7: Embed the fused image features into the designed prompt template to form the final input structure.
[0108] Furthermore, the embodiment of the present application designs a structured input template, which can be specifically expressed as: "image fusion features + text + specific emotion prediction prompts".
[0109] The various components are described as follows:
[0110] Image fusion features: Contains the multi-granular fusion representation of the global features and key local features of the image obtained through step 6. They are vector representations extracted by the CLIP model and processed by the Transformer layer.
[0111] Text: The text data can be the original text of the emoticon package or the descriptive text generated by the BLIP-2 model.
[0112] Emotion prediction prompt: This is a specially designed prompt template that explicitly tells the model that the next task is emotion prediction. For example, using "ithas[Mask]emotion" is a feasible template, where [Mask] is a placeholder representing the emotion category to be predicted, which has a certain degree of flexibility and interpretability. This allows the model to learn representations of different emotion categories during training, which helps the model generalize to new or unseen emotion categories;
[0113] Step 8: Input the input structure obtained in the previous step into LLM for fine-tuning. During the fine-tuning process, the [Mask] part in the prompt template is used to guide the model to learn and predict the emotion category, and the cross entropy loss function is still used in the process;
[0114] Step 9: According to the emotion prediction results, adjust the loss function weights and hyperparameters of LLM and make iterative improvements until the model achieves optimal performance in the emotion recognition task.
[0115] Furthermore, in the two-stage fine-tuning process of the embodiment of the present application, the back propagation algorithm (BP) is used to calculate the gradient of the model parameters, and the Adam optimizer is used to update the weights of the model. Through the iterative fine-tuning of these two stages, the weights of the model are gradually updated to minimize the loss function of the sentiment classification task.
[0116] like Figure 3As shown, a multimodal feature fusion emoticon emotion recognition system based on a large model provided by an embodiment of the present application realizes accurate recognition and classification of emoticon emotions through two stages of fine-tuning. In the first stage, a pre-trained BLIP-2 model is used to generate descriptive text for emoticons without labeled text, and the CLIP model is used for fine-tuning to learn image feature representations and enhance the ability to select key local features. These multi-granular feature representations can maintain consistency with text features at the content level and emphasize the detailed differences between emoticon elements. In the second stage, the parameters of the CLIP model are frozen, and the multi-granular image representation and text are embedded in a structured preset template, and a large pre-trained language model is fine-tuned to predict emotion categories, further improving the model's emotion recognition ability. The embodiment of the present application has achieved certain performance improvements in the accuracy of emotion recognition, the adaptability of the model in different contextual environments, and the ability to understand complex emotional expressions.
[0117] In summary, compared with the prior art, the present invention has at least the following advantages:
[0118] The embodiment of the present application provides a multimodal feature fusion emoticon emotion recognition system based on a large model, which achieves accurate recognition and classification of emoticon emotions through two stages of fine-tuning. In the first stage, a pre-trained BLIP-2 model is used to generate descriptive text for emoticons without labeled text, and the CLIP model is used for fine-tuning to learn image feature representations and enhance the ability to select key local features. These feature representations can maintain consistency with text features at the content level and emphasize the detailed differences between emoticon elements. In the second stage, the parameters of the CLIP model are frozen, and a large pre-trained language model is fine-tuned to predict emotion categories to further improve the model's emotion recognition capabilities. The key innovations of the embodiment of the present application include:
[0119] Fine-grained image-text consistency: By calculating the cosine similarity between text features and image block vectors, a similarity graph is constructed, which reveals the consistency relationship between the text and each local feature block in the image. This fine-grained consistency analysis provides a basis for accurately selecting local features that are highly matched with the emotional content of the text, ensuring the deep integration and precise correspondence of image and text information, and effectively addressing the similarity problem of the main body of the emoticon package;
[0120] Multimodal feature fusion: The multimodal feature fusion strategy in the embodiment of the present application not only involves combining the global image features with the key local image block features to form a complete multi-granularity feature representation, but also includes inputting a large language model by designing a unified template to further improve the utilization efficiency of multimodal information. This design allows the model to process image and text features simultaneously, ensuring the integrity and complementarity of the information;
[0121] Fine-tuning of large language models: In the second stage, the frozen CLIP model is used to generate a fused image feature representation, taking into account the global information and nuances in the emoji package, and fine-tuning the LLM. Through the [Mask] part in the prompt template, the model is guided to learn and predict the emotion category, further optimizing the performance of emotion recognition.
[0122] The embodiments of the present application have achieved certain performance improvements in the accuracy of emotion recognition, the adaptability of the model in different contextual environments, and the ability to understand complex emotional expressions.
[0123] A second embodiment of the present invention is an electronic device, such as Figure 4 As shown, it can be understood as a physical device, including a processor and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the following operations are performed:
[0124] Step 1, obtain the image and text data pairs extracted from the emoticon package and input them into the CLIP model to obtain the image global features, image block features and text features;
[0125] Step 2, constructing a similarity graph representing fine-grained image-text consistency based on the cosine similarity between the text feature and each of the image block features;
[0126] Step 3: According to the similarity graph, use the configured threshold to filter the image block features with the highest similarity to the text features, and obtain the sequence index of the image block;
[0127] Step 4, fusing the global image features with the image block features corresponding to the sequence index to obtain multi-granularity fused image features;
[0128] Step 5, based on the multi-granularity fusion image features, using the fully connected layer as the sentiment prediction head, using the cross entropy loss function as the sentiment classification loss, adjusting and freezing the CLIP model;
[0129] Step 6, obtaining the expression package to be recognized and passing it through the currently frozen CLIP model image encoder, repeating steps 1 to 4 to obtain the fused image features to be recognized;
[0130] Step 7, embedding the fused image features to be identified into a preset prompt template to form an input structure;
[0131] Step 8, inputting the input structure into the LLM model for fine-tuning and predicting the emotion category;
[0132] Step 9: According to the emotion category prediction result, adjust the LLM model and iterate until the LLM model meets the preset requirements in emotion recognition.
[0133] The third embodiment of the present invention, the process of the multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model in this embodiment is the same as that of the first and second embodiments, the difference is that, in terms of engineering implementation, this embodiment can be implemented by means of software plus a necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the method of the present invention can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for a device to execute the method described in the embodiment of the present invention.
[0134] Through the description of the specific implementation methods, a deeper and more specific understanding of the technical means and effects adopted by the present invention to achieve the predetermined purpose should be obtained. However, the accompanying drawings are only for reference and illustration purposes and are not intended to limit the present invention.
Claims
1. A multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model, characterized in that: include: Step 1, obtain the image and text data pairs extracted from the emoticon package and input them into the CLIP model to obtain the image global features, image block features and text features; Step 2, constructing a similarity graph representing fine-grained image-text consistency based on the cosine similarity between the text feature and each of the image block features; Step 3: According to the similarity graph, use the configured threshold to filter the image block features with the highest similarity to the text features, and obtain the sequence index of the image block; Step 4, fusing the global image features with the image block features corresponding to the sequence index to obtain multi-granularity fused image features; Step 5, based on the multi-granularity fusion image features, using the fully connected layer as the sentiment prediction head, using the cross entropy loss function as the sentiment classification loss, adjusting and freezing the CLIP model; Step 6, obtaining the expression package to be recognized and passing it through the currently frozen CLIP model image encoder, repeating steps 1 to 4 to obtain the fused image features to be recognized; Step 7, embedding the fused image features to be identified into a preset prompt template to form an input structure; Step 8, inputting the input structure into the LLM model for fine-tuning and predicting the emotion category; Step 9: According to the emotion category prediction result, adjust the LLM model and iterate until the LLM model meets the preset requirements in emotion recognition.
2. According to the multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model according to claim 1, it is characterized in that: The method further comprises: The emoticon images in the acquired emoticon dataset that are not accompanied by text annotations are used to generate descriptive text for these images using the pre-trained BLIP-2 model to expand the image-text data pairs in the dataset.
3. According to the multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model as described in claim 2, it is characterized in that: In the step 1, The image-text data pair outputs text features F through multiple ViT modules of the encoder text , image feature F img , the hidden layer image feature is expressed as: in, represents the global feature vector, L represents the number of ViT modules; The image block features are:
4. The method for emotion recognition of emoticons based on multi-modal and multi-granular features of large models according to claim 3 is characterized in that: The step 2 comprises: Wherein, Sim is the fine-grained similarity graph, · represents the vector inner product operation, and ||·||2 represents the Euclidean norm of the vector.
5. The method for emotion recognition of expression packages based on multi-modal and multi-granular features fusion based on a large model according to claim 4 is characterized in that: In step 4, the multi-granularity fusion image feature is determined by the following formula: in, represents the global feature vector output by the L-1 layer, and k represents the selection of the k image block vectors with the highest cosine similarity.
6. The method for emotion recognition of expression packages based on multi-modal and multi-granular features fusion based on a large model according to claim 5 is characterized in that: The step 5 comprises: Determine the probability distribution of each emotion category as shown below: Among them, W is the weight matrix of the linear layer, C represents the total number of emotion categories, and P i Represents the probability of the model predicting the i-th emotion category; The cross entropy loss function is used to calculate the difference between the model output probability distribution P and the true label distribution Y, and the sentiment classification loss is minimized to fine-tune CLIP; Among them, the cross entropy loss function L is shown as follows: By minimizing the cross entropy loss function, adjusting the CLIP model so that the CLIP model maps the image-text pair features to the correct emotion category; Freeze the adjusted CLIP model.
7. The method for emotion recognition of expression packages based on multi-modal and multi-granular features fusion based on a large model according to claim 6 is characterized in that: In step 7, the preset prompt template includes: the fused image features to be identified, the corresponding text, and the specific emotion prediction prompt.
8. The method for emotion recognition of expression packages based on multi-modal and multi-granular features fusion based on a large model according to claim 7 is characterized in that: In step 9, according to the predicted emotion category, the loss function weights and hyperparameters of the LLM model are adjusted to perform iterative improvements until the model achieves optimal performance in the emotion recognition task.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model as described in any one of claims 1 to 8 are implemented.
10. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the multi-modal and multi-granular feature fusion expression package emotion recognition method based on a large model as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Multi-modal social media sentiment analysis method based on feature fusion
CN114020871A
Image-text sentiment classification method and system based on cross-modal generative adversarial network
CN116758558A
Methods and Systems for Applications for Z-numbers
US20140201126A1
Virtual character drive method, apparatus, and device based on expression recognition
WO2023226913A1
Cited By
Emotion recognition method and system based on multi-modal feature and hierarchical feature fusion
CN118709094A
Multi-modal fashion trend prediction and evaluation method
CN119337841A
Social media user abnormal psychological state identification method and system based on psychological scale
CN119446378A
Multi-modal sentiment analysis and interactive adjustment method and system based on large model
CN119475099A
Fine tuning optimization method for improving fine granularity discrimination capability of multi-modal model
CN119692411A
