Multi-modal abstract method and system based on visual information fusion
By using visual encoders based on the FLAN-T5 and CLIP models to perform multi-dimensional visual feature transformation and cross-modal attention fusion, the problem of weak correlation between visual features and text features in multimodal summarization is solved, thus improving the quality and accuracy of the generated summaries.
Patent Information
- Application Number
- CN202410991657.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing multimodal summarization methods fail to fully understand the internal semantics of text in terms of visual feature extraction and modality fusion, resulting in a weak relationship between visual features and text features, which affects the quality and accuracy of the generated summaries.
Using the pre-trained language model FLAN-T5 as the core architecture, combined with the pre-trained CLIP model visual encoder, deep modality fusion is achieved by capturing the correlation between visual and textual information through multi-dimensional visual feature transformation and cross-modal attention mechanism.
It improves the quality and accuracy of multimodal summarization, ensures the complete integration of visual and textual information, and enhances the fluency and accuracy of the generated summaries.
Smart Images

Figure CN118964603A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing and artificial intelligence technology, and in particular to a multimodal summarization method and system based on visual information fusion. Background Art
[0002] With the rapid development of information technology, the explosive growth of information has brought unprecedented challenges to people. On social media and online platforms, users are faced with a huge amount of information. How to efficiently and accurately obtain the required content has become an urgent problem to be solved, which puts higher requirements on the technology of automatic text processing. In the field of artificial intelligence, the application of machine learning, deep learning and other technologies in natural language processing has been continuously deepened, significantly improving the ability to process large amounts of data. Against this background, text summarization technology came into being. The development of text summarization technology is not only of great significance to solving the problem of user information overload caused by information explosion, but also plays a key role in enabling users to efficiently capture key information and improve the efficiency of obtaining information. It has shown great potential in the fields of news media industry, education and academic research industry, social media industry and intelligent assistant industry, and has broad application prospects.
[0003] The task of text summarization aims to simplify and compress the text content into a shorter text while maintaining the core information and semantics of the original text. This task has an important position and application value in natural language processing. It not only requires the model to be able to identify and extract important information, but also requires a certain language generation ability to ensure that the generated summary is smooth, coherent and can accurately convey the main meaning of the original text. Text summarization is considered a major challenge in natural language processing, because the quality of text summarization requires the distinction between the main and secondary information in the text content, and the generated summary also needs to be coherent and consistent. In the news media industry, text summarization technology can automatically generate a brief summary of news reports, allowing readers to understand the main content of the news in a short time; in the academic research industry, automatic summarization technology can help researchers obtain key information; in the social media industry, text summarization technology can be used to generate a brief summary of posts to help users quickly browse and understand information. Text summarization is not only a key technology for information retrieval and information extraction, but also provides important support for other natural language processing tasks. It is one of the most important tasks in natural language processing.
[0004] The text summarization task is to extract features from the text data to be processed, and use a designed algorithm or a trained model to enable the computer to automatically summarize the data. Traditionally, there are two methods for text summarization: extractive summarization and generative summarization. The former selects important sentences or paragraphs directly from the original text to form a summary, while the latter understands and reconstructs the text content to generate a new short text to summarize the original text. However, traditional methods may cause information loss, the result quality is not high, and it is limited by the rules of specific fields.
[0005] With the development of multimedia technology and the popularity of social media platforms, the information received by users has gradually become multimodal. For example, the news received by users on news platforms often describes events by combining pictures and text. In such a scenario, only by combining multimodal information can the key information in the text be captured more efficiently. However, most of the existing text summarization methods are based on pure text methods, which cannot take into account the contribution of visual information, resulting in some one-sided and incomplete text summarization results in multimodal scenarios. To this end, in recent years, some researchers have proposed multimodal summarization methods, aiming to more comprehensively and accurately reflect the core content of information by comprehensively utilizing information from multiple modalities such as text, images, audio and video. Multimodal summarization is different from traditional text summarization. Multimodal summarization needs to combine text and other modal data, obtain its features, fuse the features of text and other modalities to obtain multimodal text features, and then decode the text to generate a more comprehensive and accurate text summary. Different from plain text summarization, multimodal summarization faces two challenges: first, how to effectively integrate features between different modalities to avoid feature complexity caused by differences between multimodal information; second, how to effectively extract semantically rich features from other modalities to ensure contribution to text summary generation.
[0006] like Figure 1 As shown in the article "Multimodal Sentence Summarization Based on Modal Attention and Image Filtering", one of the existing technologies, mentions the use of visual information combined with text information for text summarization, the use of bidirectional gated recurrent units to encode data, and the combination of image attention filters and image context filters for image denoising and modal fusion, achieving excellent text summarization effects:
[0007] First, the input text is embedded using a pre-trained or randomly initialized word embedding matrix, and bidirectional gated recurrent unit encoding is performed to obtain the feature representation of the sentence. Second, the image features are extracted using the pre-trained VGG19 model to obtain the feature representation of the image. Third, the attention weights of the text and image are calculated separately using the modal attention mechanism. The context vector of the text is calculated by weighted summing up the annotation vectors of the source text, and the context vector of the image is calculated by weighted summing up the representation of the image block. Fourth, the image filter is used to selectively use visual information to enhance the semantics of the sentence and avoid introducing image noise. In the image attention filter, the attention weight is first calculated based on the decoder state of the previous time step and the global features of the image, and then the image attention weight is adjusted according to the weight during modal fusion. In the image context filter, the weight is calculated based on the decoder state and the global features of the image, and the image features are adjusted with this weight. Finally, the fused features enter the unidirectional gated recurrent unit sentence decoder, and the decoder generates a summary based on different visual feature initializations.
[0008] like Figure 2 As shown in the article "Generative Pre-trained Language Model Guided by Visual Information for Multimodal Abstractive Summarization", one of the existing technologies, mentions the method of using a pre-trained language model to obtain high-quality text summaries by fusing visual information using an attention mechanism without compromising the model's generation capability:
[0009] First, the text data and video data are preprocessed, including word segmentation and serialization of the text data, and the pre-trained 3D ResNeXt-101 model is used to extract feature representations from video clips and serialize the video data. Secondly, the pre-processed text sequence is input into the generated pre-trained language model to extract text features, and the extracted visual features are input into VTF to enhance the temporal information of the visual features. Thirdly, the text features and video features are input into the multimodal fusion layer of the model, and the modal fusion is performed using cross-modal dot product attention and cross-modal multi-head attention to obtain text features guided by visual information. Finally, the decoder decodes and outputs the text features, and the output features are converted into probability distributions through linear layers and Softmax layers to generate the final text summary.
[0010] In the prior art, "Multimodal sentence summarization based on modal attention and image filtering" and "Generative pre-trained language model guided by visual information for multimodal abstract summarization" have the following technical problems:
[0011] 1. In the multimodal summarization task, the visual feature extraction method used plays a key role in the quality of the generated summary, but the extraction method used does not fully understand the internal semantics related to the text.
[0012] 2. Previous work mainly focused on feature filtering and modal fusion on the encoder side, but ignored the fusion on the decoder side.
[0013] Due to the above technical problems, the prior art has the following disadvantages:
[0014] 1. Using visual feature extraction methods without understanding internal semantics makes the extracted visual features have little to do with text features. Adding visual features is not necessarily conducive to the generation of text summaries, which affects the effect of the final generated results.
[0015] 2. The depth of modal fusion is shallow, which makes it impossible to fully utilize the correlation between modalities, so that the fused text features cannot contain all semantic information, affecting the quality of the final generated summary. Summary of the invention
[0016] The embodiment of the present application provides a multimodal summarization method and system based on visual information fusion, which takes the pre-trained language model FLAN-T5 as the core architecture, and uses the visual encoder of the pre-trained CLIP model to add multi-dimensional visual feature transformation to obtain visual feature mapping at different angles, and finally fully captures the correlation between visual information and text information, thereby improving the quality and accuracy of the generated summary.
[0017] The present application embodiment provides a multimodal summarization method based on visual information fusion, including:
[0018] Extracting visual features of an image in an input text-image pair, and extracting text features of text in the input text-image pair;
[0019] The extracted visual features are concatenated with the text features, and the concatenated visual-text features are input into the multi-head attention module and the feedforward network module of the encoder;
[0020] Using the extracted visual features and the output of the feedforward network module as inputs to the modal fusion layer of the encoder to obtain text features combined with visual information;
[0021] Inputting the obtained text features combined with visual information and summary text features into a decoder, wherein the summary text features are obtained by extracting the start element number without actual content added to the text header of the input text-image pair;
[0022] Using the extracted visual features and the output of the decoder feedforward network module as inputs to the decoder modality fusion layer to obtain text features output by the decoder;
[0023] The text features output by the decoder are converted into a vector of specified dimension through a linear layer, and the output vector is input into the Softmax layer to be converted into a probability distribution.
[0024] Optionally, extracting visual features of the image in the input text-image pair includes:
[0025] The image in the input text-image pair is input into the visual encoder of the CLIP model to extract visual features, where the image embedding representation obtained using the image encoder of CLIP is:
[0026] Emb v (i) = CLIP vis (v i )
[0027] Among them, v i is the i-th image input, CLIP vis is the visual encoder of the CLIP model, Emb v (i) is the image input v i The embedding vector of
[0028] The extracted visual features are nonlinearly changed using different functions, and the features after the linear change are spliced to obtain the visual features.
[0029] Optionally, performing nonlinear changes on the extracted visual features using different functions and splicing the features after the linear changes to obtain the visual features includes:
[0030] Use hyperbolic tangent function, cosine function and sigmoid function to perform nonlinear changes respectively, and concatenate the obtained visual features to meet the following requirements:
[0031] V1=tanh(Emb v (i))
[0032] V2=cos(Emb v (i))
[0033] V3=σ(Emb v (i))
[0034] V=Concat(V1,V2,V3)
[0035] Among them, V1, V2, and V3 are visual features that are changed using the hyperbolic tangent function, cosine function, and sigmoid function, respectively. Concat is a concatenation operation, and V is the final visual feature obtained.
[0036] Optionally, extracting text features of the text in the input text-image pair includes:
[0037] Based on the text in the input text-image pair, an index of text and visual features is constructed in the text;
[0038] The text in the input text-image pair, the index, and the summary text features are input into the FLAN-T5 model so that the text in the input text-image pair enters the encoder to segment the text and convert it into a vector form.
[0039] Optionally, concatenating the extracted visual features with the text features includes:
[0040] Initialize a set of learnable vectors, input the set of vectors and the visual features into a visual feature mapping module, and use an attention mechanism to obtain the visual features to be spliced, wherein the visual feature attention mechanism of the visual feature mapping module satisfies:
[0041] Q=[q1,q2,q3,...,q M ]
[0042] K=V·W v
[0043]
[0044] v=A·V
[0045] Among them, Q is the initialized learnable vector, Q∈R M×d , W v is the weight matrix of K, and V is the extracted visual feature;
[0046] Splicing the visual features to be spliced with the text features input by the encoder; and,
[0047] The positional encoding is added to the concatenated feature vector to capture the relative position information of the words in the sequence.
[0048] Optionally, using the extracted visual features and the output of the feedforward network module as inputs to a modality fusion layer of an encoder to obtain text features combined with visual information includes:
[0049] The visual features and input text features are input into the modal fusion layer of the encoder. Through the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism, the text features combined with visual information obtained by the two mechanisms are weighted and summed to obtain the text features combined with visual information. The cross-modal multi-head attention fusion mechanism satisfies:
[0050] Q=T0W q
[0051] K=VW k
[0052] V=VW v
[0053] O=CMA(Q,K,V)
[0054] T1=Concat(T0,O)W
[0055] Among them, T0 is the processed input text feature, CMA is cross-modal multi-head attention, and W is the weight matrix;
[0056] The cross-modal bilinear attention fusion mechanism satisfies:
[0057] A=VBT0
[0058] A'=Softmax(A)
[0059] T2=A'T0
[0060] Where B is the bilinear weight matrix;
[0061] The text features combined with visual information obtained by the two mechanisms are weighted and satisfied:
[0062] T=αT1+(1-α)T2
[0063] Among them, α is a trainable weight.
[0064] Optionally, inputting the obtained text features combined with visual information and the summary text features into a decoder comprises:
[0065] The summary text features are input into the encoder-decoder multi-head attention module together with the text features combined with visual information through the multi-head attention module, and then passed through the feedforward network module to obtain the text features containing the previous text information and visual information;
[0066] The obtained text features containing previous text information and visual information and the extracted visual features are input into the modality fusion layer of the decoder to obtain the final text features.
[0067] Optionally, it also includes calculating the cross entropy loss between the probability distribution predicted by the model and the target summary text, and averaging the cross entropy losses of all time steps as the overall average loss. The calculated average loss is back-propagated, and the model parameters are updated using the gradient descent method to minimize the loss. The cross entropy loss between the probability distribution predicted by the model and the target summary text satisfies:
[0068]
[0069] Among them, y i is the true distribution of the target text, p i is the probability distribution predicted by the model.
[0070] The embodiment of the present application further proposes a multimodal summarization system based on visual information fusion, including a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the steps of the multimodal summarization method based on visual information fusion as described above are implemented.
[0071] The method of the embodiment of the present application uses the pre-trained language model FLAN-T5 as the core architecture, and uses the visual encoder of the pre-trained CLIP model to add multi-dimensional visual feature transformation to capture visual features rich in deep semantics and obtain visual feature mappings at different angles; a visual feature mapping module is added to the text input so that the text input initially carries visual information; modal fusion layers are designed in the encoder and decoder respectively, and the fusion layer uses a cross-modal bilinear attention mechanism and a cross-modal multi-head attention mechanism in parallel, and performs deep modal fusion through residual connections to fully capture the correlation between visual information and text information, thereby improving the quality and accuracy of the generated summary.
[0072] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0074] Figure 1 The technical architecture of the existing technology "Multimodal sentence summarization based on modal attention and image filtering" is shown;
[0075] Figure 2 The technical architecture of the existing technology "Visually guided generative pre-trained language model for multimodal abstract summarization" is shown;
[0076] Figure 3 The following is a schematic diagram of the basic process of the multimodal summarization method according to an embodiment of the present application;
[0077] Figure 4 The following is a flowchart of an implementation example of the multimodal summarization method of the present application;
[0078] Figure 5 The figure is a schematic diagram of the overall process of the multimodal summarization method according to an embodiment of the present application. DETAILED DESCRIPTION
[0079] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0080] The abbreviations and key terms that appear in this embodiment are defined as follows:
[0081] BP: Back Propagation;
[0082] CLIP: Contrastive Language-Image Pre-training;
[0083] GPLM:Generative Pre-training Language Model Generative Language Model;
[0084] CMA: Cross-modal Multi-head Attention;
[0085] FLAN: Finetuned Language Models are Zero-Shot Learners Zero-shot fine-tuning large model learners;
[0086] ViT:Vision Transformer;
[0087] NLP: Natural Language Processing;
[0088] MLP: Multilayer Perceptron.
[0089] The present application embodiment provides a multimodal summarization method based on visual information fusion, such as Figure 3 As shown, the following steps are included:
[0090] In step S301, the visual features of the image in the input text-image pair are extracted, and the text features of the text in the input text-image pair are extracted. In a specific example, extracting the visual features of the image in the input text-image pair includes: inputting the image in the input text-image pair into the visual encoder of the CLIP model to extract the visual features. The extracted visual features are respectively subjected to nonlinear changes using a hyperbolic tangent function, a cosine function, and a sigmoid function, and finally the three obtained visual features are spliced to obtain the final visual features.
[0091] For the text in the input text-image pair, data cleaning is first performed, and an index of text and visual features is built in the text, and then input into the FLAN-T5 model together with the text.
[0092] In step S302, the extracted visual features are concatenated with the text features, and the text features are input into the multi-head attention module and feedforward network module of the encoder. The multi-head attention module is used to capture the relationship between different positions in the text sequence and generate rich context representations. The feedforward network module can independently perform nonlinear transformations on the input at each position to enhance the representation ability of the model, and finally obtain the feature vector input into the modal fusion layer of the encoder.
[0093] In step S303, the extracted visual features and the output of the feedforward network module are used as inputs of the modal fusion layer of the encoder to obtain text features combined with visual information. The final text features combined with visual information are obtained through the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism and input into the decoder.
[0094] In step S304, the obtained text features combined with visual information and summary text features are input into a decoder, wherein the summary text features are extracted by adding additional start elements without actual content to the text header of the input text-image pair.
[0095] In step S305, the extracted visual features and the output of the decoder feedforward network module are used as inputs of the decoder modal fusion layer to obtain text features output by the decoder. Specifically, the summary text features are input into the encoder-decoder multi-head attention module through the multi-head attention module and the text features combined with the visual information, and then pass through the feedforward network module to obtain the text features containing the previous text information and the visual information, and enter the modal fusion layer of the decoder with the visual features to obtain the final text features.
[0096] In step S306, the text features output by the decoder are converted into vectors of specified dimensions through a linear layer. That is, the text features obtained by the decoder are converted into vector dimensions that can be mapped by the vocabulary through a linear layer, and the output vector is input into the Softmax layer to be converted into a probability distribution. According to the probability distribution and the vocabulary, the required summary text is obtained.
[0097] The method of the embodiment of the present application uses the pre-trained language model FLAN-T5 as the core architecture, and uses the visual encoder of the pre-trained CLIP model to add multi-dimensional visual feature transformation to capture visual features rich in deep semantics and obtain visual feature mappings at different angles; a visual feature mapping module is added to the text input so that the text input initially carries visual information; modal fusion layers are designed in the encoder and decoder respectively, and the fusion layer uses a cross-modal bilinear attention mechanism and a cross-modal multi-head attention mechanism in parallel, and performs deep modal fusion through residual connections to fully capture the correlation between visual information and text information, thereby improving the quality and accuracy of the generated summary.
[0098] In some embodiments, extracting visual features of an image in an input text-image pair includes: using an image encoder of CLIP to obtain an embedded representation of the image as:
[0099] Emb v (i) = CLIP vis (v i )
[0100] Among them, v i is the i-th image input, CLIP vis is the visual encoder of the CLIP model, Emb v (i) is the image input v i The embedding vector of
[0101] The extracted visual features are nonlinearly changed using different functions, and the features after the linear change are spliced to obtain the visual features.
[0102] In some embodiments, performing nonlinear changes on the extracted visual features using different functions, and splicing the features after the linear changes to obtain the visual features includes:
[0103] Use hyperbolic tangent function, cosine function and sigmoid function to perform nonlinear changes respectively, and concatenate the obtained visual features to meet the following requirements:
[0104] V1=tanh(Emb v (i))
[0105] V2=cos(Emb v(i))
[0106] V3=σ(Emb v (i))
[0107] V=Concat(V1,V2,V3)
[0108] Among them, V1, V2, and V3 are visual features that are changed using the hyperbolic tangent function, cosine function, and sigmoid function, respectively. Concat is a concatenation operation, and V is the final visual feature obtained.
[0109] In some embodiments, extracting text features of text in an input text-image pair includes:
[0110] Based on the text in the input text-image pair, an index of text and visual features is constructed in the text;
[0111] Based on the text, index and summary text features in the input text-image pair, it is input to the FLAN-T5 model so that the text in the input text-image pair enters the encoder to segment the text and convert it into a vector form.
[0112] Specifically, the text in the input text-image pair and the summary text sequence with an additional start element without actual content added to the head are input into the FLAN-T5 model. The former enters the encoder and the latter enters the decoder, so that the model can use the previous accurate summary text as input to speed up the training. First, the index part of the encoder input text is saved so that the corresponding visual features can be input into the subsequent fusion layer. Then, the text input by the encoder and decoder is segmented, and the insufficient length is padded and a mask is constructed. Then, the input text is converted into an index according to the vocabulary, and finally the text is converted into a vector form through word embedding.
[0113] In some embodiments, concatenating the extracted visual features with the text features includes:
[0114] Initialize a set of learnable vectors, input the set of vectors and the visual features into a visual feature mapping module, and use an attention mechanism to obtain the visual features to be spliced, wherein the visual feature attention mechanism of the visual feature mapping module satisfies:
[0115] Q=[q1,q2,q3,...,q M ]
[0116] K=V·W v
[0117]
[0118] v=A·V
[0119] Among them, Q is the initialized learnable vector, Q∈R M×d , W v is the weight matrix of K, and V is the extracted visual feature;
[0120] Splicing the visual features to be spliced with the text features input by the encoder; and,
[0121] The positional encoding is added to the concatenated feature vector to capture the relative position information of the words in the sequence.
[0122] In some embodiments, using the extracted visual features and the output of the feedforward network module as inputs to a modality fusion layer of an encoder to obtain text features combined with visual information includes:
[0123] The visual features and input text features are input into the modal fusion layer of the encoder. Through the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism, the text features combined with visual information obtained by the two mechanisms are weighted and summed to obtain the text features combined with visual information. The cross-modal multi-head attention fusion mechanism satisfies:
[0124] Q=T0W q
[0125] K=VW k
[0126] V=VW v
[0127] O=CMA(Q,K,V)
[0128] T1=Concat(T0,O)W
[0129] Among them, T0 is the processed input text feature, CMA is cross-modal multi-head attention, and W is the weight matrix;
[0130] The cross-modal bilinear attention fusion mechanism satisfies:
[0131] A=VBT0
[0132] A'=Softmax(A)
[0133] T2=A'T0
[0134] Where B is the bilinear weight matrix;
[0135] The text features combined with visual information obtained by the two mechanisms are weighted and satisfied:
[0136] T=αT1+(1-α)T2
[0137] Among them, α is a trainable weight.
[0138] In some embodiments, inputting the obtained text features combined with visual information and the summary text features into a decoder comprises:
[0139] The summary text features are input into the encoder-decoder multi-head attention module together with the text features combined with visual information through the multi-head attention module, and then passed through the feedforward network module to obtain the text features containing the previous text information and visual information;
[0140] The obtained text features containing previous text information and visual information and the visual features are input into the modality fusion layer of the decoder to obtain the final text features.
[0141] In some embodiments, the method further includes calculating the cross entropy loss between the probability distribution predicted by the model and the target summary text, averaging the cross entropy losses of all time steps as the overall average loss, performing back propagation on the calculated average loss, and updating the model parameters using the gradient descent method to minimize the loss, wherein the cross entropy loss between the probability distribution predicted by the model and the target summary text satisfies:
[0142]
[0143] Among them, y i is the true distribution of the target text, p i is the probability distribution predicted by the model.
[0144] In the non-training case, the input text and the summary text generated in the previous time step are input into the FLAN-T5 model. The former enters the encoder and the latter enters the decoder. First, the index part of the former is saved so that the corresponding visual features can be input into the subsequent fusion layer. Then, they are all segmented, and the ones with insufficient length are padded and masks are constructed. Then, the input text is converted into an index according to the vocabulary, and finally the text is converted into a vector form through word embedding operation.
[0145] Furthermore, a set of learnable vectors is initialized and fed into the visual feature mapping module together with the visual features. The visual features are obtained using the attention mechanism and concatenated with the text features input by the encoder. The positional encoding is added to the concatenated text feature vector to capture the relative position information of the words in the sequence.
[0146] In the decoder, the text features combined with the visual information and the summary text features generated in the previous time step enter the decoder. The summary text features pass through the multi-head attention module and the text features combined with the visual information and enter the encoder-decoder multi-head attention module. Then, they pass through the feedforward network module to obtain the text features containing the previous text information and visual information, and the visual features enter the modal fusion layer of the decoder to obtain the final text features.
[0147] According to the probability distribution and vocabulary, the final summary text is obtained.
[0148] The method of the embodiment of the present application uses the pre-trained model FLAN-T5 as the core architecture, improves the ability to generate text summaries, uses the visual encoder of the CLIP model to extract visual features, and enriches the visual features through the connection of multiple nonlinear transformations and the visual feature mapping module, and contains more deep semantics, thereby improving the correlation between visual features and text features, ensuring the completeness and effectiveness of information, improving the fluency of text summaries, and broadening the application of multimodal summaries in the field of natural language processing; in the FLAN-T5 encoder, cross-modal multi-head attention and cross-modal bilinear attention are used in parallel for modal fusion, and in the decoder, cross-modal multi-head attention is used for modal fusion, and finally a beam search strategy is adopted to improve the effect of modal fusion, improve the quality of text summaries, and provide a new method for multimodal technology.
[0149] The present application also proposes an implementation case of a multimodal summarization method based on visual information fusion, such as Figure 4 , Figure 5 As shown, this example provides a multimodal summarization method based on visual information on GPLM. During model training, the method includes:
[0150] Step 1: Input the image of the input text-image pair into the visual encoder of the CLIP model to extract visual features, and perform nonlinear changes on the extracted visual features using the hyperbolic tangent function, cosine function and sigmoid function respectively. Finally, the three visual features are concatenated to obtain the final visual features.
[0151] In this embodiment, the pre-trained multimodal language model CLIP is pre-trained on a dataset of 400 million image-text pairs constructed by crawling public images and their corresponding description texts on the Internet, and can capture the deep semantic information of the data. The output of the visual encoder is set to 7×7, and the selected architecture is the ViT model.
[0152] Furthermore, in step 1, the image encoder of CLIP is used to obtain the embedded representation of the image and the calculation is as follows:
[0153] Embv (i) = CLIP vis (v i )
[0154] Among them, v i is the i-th image input, CLIP vis is the visual encoder of the CLIP model, Emb v (i) is the image input v i The embedding vector of .
[0155] Furthermore, in the step 1, the extracted visual features are subjected to nonlinear changes using the hyperbolic tangent function, the cosine function and the sigmoid function respectively, and the three obtained visual features are concatenated to obtain the final visual features, which are calculated as follows:
[0156] V1=tanh(Emb v (i))
[0157] V2=cos(Emb v (i))
[0158] V3=σ(Emb v (i))
[0159] V=Concat(V1,V2,V3)
[0160] Among them, V1, V2, and V3 are visual features that are changed using the hyperbolic tangent function, cosine function, and sigmoid function, respectively. Concat is a concatenation operation, and V is the final visual feature obtained.
[0161] Step 2: Clean the text of the input text-image pair, build an index of text and visual features in the text, and input the text into the FLAN-T5 model;
[0162] Step 3: Input text and a summary text sequence with an additional start element without actual content added to the head enter the FLAN-T5 model. The former enters the encoder and the latter enters the decoder, so that the model can use the previous accurate summary text as input to speed up training. First, save the index part of the encoder input text so that the corresponding visual features can be input into the subsequent fusion layer. Then, they both segment the text, fill in the insufficient length and construct a mask, and then convert the input text into an index according to the vocabulary. Finally, perform word embedding on the text and convert it into a vector form. Initialize a set of learnable vectors, enter this set of vectors together with the visual features into the visual feature mapping module, use the attention mechanism to obtain the visual features, and splice them with the text features input by the encoder. Add the position code to the spliced text feature vector to capture the relative position information of the words in the sequence.
[0163] Furthermore, in step 3, the visual feature attention mechanism of the visual feature mapping module is calculated as follows:
[0164] Q=[q1,q2,q3,...,q M ]
[0165] K=V·W v
[0166]
[0167] v=A·V
[0168] Among them, Q is the initialized learnable vector, Q∈R M×d , W v is the weight matrix of K, and V is the extracted visual feature.
[0169] In this embodiment, the input text length is set to 256, the summary text length is set to 64, and the initialization vector dimension is set to 64.
[0170] Step 4: In the encoder, the input text feature vector enters the multi-head attention module and feedforward network module of the model. The multi-head attention module can capture the relationship between different positions in the text sequence and generate rich context representation. The feedforward network module can independently perform nonlinear transformation on the input at each position to enhance the representation ability of the model. Finally, the feature vector is obtained to enter the modal fusion layer of the encoder. In this embodiment, the number of multi-head attention heads is set to 8.
[0171] Step 5: The visual features and input text features enter the modal fusion layer of the encoder, and through the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism, the text features combined with visual information obtained by the two mechanisms are weighted and summed to obtain the final text features combined with visual information and enter the decoder.
[0172] Furthermore, in step 5, the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism are used, and the text features combined with visual information obtained by the two mechanisms are weighted and summed. The cross-modal multi-head attention fusion mechanism is calculated as follows:
[0173] Q=T0W q
[0174] K=VW k
[0175] V=VW v
[0176] O=CMA(Q,K,V)
[0177] T1=Concat(T0,O)W
[0178] Among them, T0 is the processed input text feature and W is the weight matrix.
[0179] Furthermore, in step 5, the cross-modal bilinear attention fusion mechanism is calculated as follows:
[0180] A=VBT0
[0181] A'=Softmax(A)
[0182] T2=A'T0
[0183] Where B is the bilinear weight matrix.
[0184] Furthermore, in step 5, the text features combined with visual information obtained by the two mechanisms are weighted and calculated as follows:
[0185] T=αT1+(1-α)T2
[0186] Among them, α is a trainable weight.
[0187] Step 6. In the decoder, the text features combined with the visual information and the summary text features enter the decoder. The summary text features pass through the multi-head attention module and the text features combined with the visual information and enter the encoder-decoder multi-head attention module. Then, they pass through the feedforward network module to obtain the text features containing the previous text information and visual information, and the visual features enter the modal fusion layer of the decoder to obtain the final text features.
[0188] Step 7: The text features obtained by the decoder are converted into vector dimensions that can be mapped by the vocabulary through an MLP. The obtained vector is input into the Softmax layer to convert it into a probability distribution, and the beam search is used to obtain the final output probability distribution.
[0189] Step 8: Calculate the cross entropy loss between the probability distribution predicted by the model and the target summary text, and average the cross entropy losses of all time steps as the overall average loss. Perform BP on the average loss and use the gradient descent method to update the model parameters to minimize the loss. In this embodiment, the learning rate is set to 4e -3 , the batch size is set to 256.
[0190] In step eight, the cross entropy loss between the probability distribution predicted by the model and the target summary text is calculated as follows:
[0191]
[0192] Among them, y i is the true distribution of the target text, pi is the probability distribution predicted by the model.
[0193] In the non-training case, multimodal summarization is performed to adjust steps 3, 6, and 8, including:
[0194] Step 3: The input text and the summary text generated in the previous time step enter the FLAN-T5 model. The former enters the encoder and the latter enters the decoder. The former enters the encoder and the latter enters the decoder. First, the index part of the former is saved so that the corresponding visual features can be input into the subsequent fusion layer. Then, they are all segmented, and the insufficient length is filled and a mask is constructed. Then, the input text is converted into an index according to the vocabulary, and finally the text is converted into a vector form by word embedding operation; a set of learnable vectors is initialized, and this set of vectors and visual features are entered into the visual feature mapping module together, and the visual features are obtained by using the attention mechanism, and are spliced with the text features input by the encoder; the position code is added to the text feature vector to capture the relative position information of the words in the sequence;
[0195] Step 6: In the decoder, the text features combined with the visual information and the summary text features generated in the previous time step enter the decoder. The summary text features pass through the multi-head attention module and the text features combined with the visual information and enter the encoder-decoder multi-head attention module. Then, they pass through the feedforward network module to obtain the text features containing the previous text information and visual information, and the visual features enter the modal fusion layer of the decoder to obtain the final text features.
[0196] Step 8. Obtain the final summary text based on the probability distribution and vocabulary.
[0197] A preferred embodiment, as Figure 4As shown in the figure, the input image data is first passed through the image encoder of the pre-trained model CLIP, and then through multi-dimensional activation to obtain visual features; the input text data is connected with the visual features after visual mapping through embedding and position encoding to obtain text features and enter the encoder of the FLAN-T5 model; the text features pass through the multi-head attention module and the feedforward network module, enter the modal fusion layer of the encoder, and are fused with the visual features; the text features and visual features are fused through the cross-modal multi-head attention mechanism and the cross-modal bilinear attention mechanism, and finally the results of the two fusion methods are merged to obtain text features combined with visual information and input into the encoder. The encoder receives the text summary of the previous time step The input is passed through the multi-head attention module and enters the encoder-decoder multi-head attention module to perform multi-head attention operation with the output of the encoder; the encoder-decoder text features output by the module are fused with the visual features in the modal fusion layer of the decoder through cross-modal multi-head attention, and are output from the decoder through the feedforward network module; finally, the probability distribution of the summary text is obtained through the linear layer and the Softmax layer. In the case of training, the cross-entropy loss function is used to calculate the difference between the generated text summary and the target text, and back-propagation is performed, and the gradient descent algorithm is used to optimize the parameters; in the case of non-training, the beam search method is used to select the text summary with the highest probability as the result output based on the vocabulary.
[0198] The method of the embodiment of the present application enriches the visual features and includes more deep semantics through the connection of multiple nonlinear transformations and the visual feature mapping module, improves the correlation between visual features and text features, ensures the completeness and effectiveness of information, improves the fluency of text summaries, and broadens the application of multimodal summaries in the field of natural language processing; in the FLAN-T5 encoder, cross-modal multi-head attention and cross-modal bilinear attention are used in parallel for modal fusion, and in the decoder, cross-modal multi-head attention is used for modal fusion, and finally a beam search strategy is adopted to improve the effect of modal fusion, improve the quality of text summaries, and provide a new method for multimodal technology.
[0199] The embodiment of the present application further proposes a multimodal summarization system based on visual information fusion, including a processor and a memory, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, the steps of the multimodal summarization method based on visual information fusion as described above are implemented.
[0200] It should be noted that in the various embodiments of the present application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0201] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0203] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A multimodal summarization method based on visual information fusion, characterized in that: include: Extracting visual features of an image in an input text-image pair, and extracting text features of text in the input text-image pair; The extracted visual features are concatenated with the text features, and the concatenated visual-text features are input into the multi-head attention module and the feedforward network module of the encoder; Using the extracted visual features and the output of the feedforward network module as inputs to the modal fusion layer of the encoder to obtain text features combined with visual information; Inputting the obtained text features combined with visual information and summary text features into a decoder, wherein the summary text features are obtained by extracting the start element number without actual content added to the text header of the input text-image pair; Using the extracted visual features and the output of the decoder feedforward network module as inputs to the decoder modality fusion layer to obtain text features output by the decoder; The text features output by the decoder are converted into a vector of specified dimension through a linear layer, and the output vector is input into the Softmax layer to be converted into a probability distribution.
2. The multimodal summarization method based on visual information fusion according to claim 1, characterized in that: Extracting visual features of the image in the input text-image pair includes: The image in the input text-image pair is input into the visual encoder of the CLIP model to extract visual features, where the image embedding representation obtained using the image encoder of CLIP is: Emb v (i)=CLIP vis (v i ) Among them, v i is the i-th image input, CLIP vis is the visual encoder of the CLIP model, Emb v (i) is the image input v i The embedding vector of The extracted visual features are nonlinearly changed using different functions, and the features after the linear change are spliced to obtain the visual features.
3. The multimodal summarization method based on visual information fusion as claimed in claim 2, characterized in that: The extracted visual features are subjected to nonlinear changes using different functions, and the features after the linear changes are spliced to obtain the visual features, including: Use hyperbolic tangent function, cosine function and sigmoid function to perform nonlinear changes respectively, and concatenate the obtained visual features to meet the following requirements: V1=tanh(Emb v (i)) V2=cos(Emb v (i)) V3=σ(Emb v (i)) V=Concat(V1,V2,V3) Among them, V1, V2, and V3 are visual features that are changed using the hyperbolic tangent function, cosine function, and sigmoid function, respectively. Concat is a concatenation operation, and V is the final visual feature obtained.
4. The multimodal summarization method based on visual information fusion as claimed in claim 2, characterized in that: The text features of the text in the input text-image pair are extracted including: Based on the text in the input text-image pair, an index of text and visual features is constructed in the text; The text and corresponding visual features in the input text-image pair, the index and the summary text features are input into the FLAN-T5 model so that the text in the input text-image pair enters the encoder to segment the text and convert it into a vector form.
5. The multimodal summarization method based on visual information fusion as claimed in claim 4, characterized in that: The extracted visual features are concatenated with the text features including: Initialize a set of learnable vectors, input the set of vectors and the visual features into a visual feature mapping module, and use an attention mechanism to obtain the visual features to be spliced, wherein the visual feature attention mechanism of the visual feature mapping module satisfies: Q=[q1,q2,q3,...,q M ] K=V·W v v=A·V Among them, Q is the initialized learnable vector, Q∈R M×d , W v is the weight matrix of K, and V is the extracted visual feature; Splicing the visual features to be spliced with the text features input by the encoder; and, The positional encoding is added to the concatenated feature vector to capture the relative position information of the words in the sequence.
6. The multimodal summarization method based on visual information fusion as claimed in claim 5, characterized in that: The extracted visual features and the output of the feedforward network module are used as inputs of the modal fusion layer of the encoder to obtain text features combined with visual information, including: The visual features and the output of the feedforward network module are input into the modal fusion layer of the encoder, and the text features combined with visual information obtained by the two mechanisms are weighted and summed through the cross-modal multi-head attention fusion mechanism and the cross-modal bilinear attention fusion mechanism to obtain the text features combined with visual information, wherein the cross-modal multi-head attention fusion mechanism satisfies: Q=T0W q K=VW k V=VW v O=CMA(Q,K,V) T1=Concat(T0,O)W Among them, T0 is the processed input text feature, CMA is cross-modal multi-head attention, and W is the weight matrix; The cross-modal bilinear attention fusion mechanism satisfies: A=VBT0 A'=Softmax(A) T2=A'T0 Where B is the bilinear weight matrix; The text features combined with visual information obtained by the two mechanisms are weighted and satisfied: T=αT1+(1-α)T2 Here, α is a trainable weight.
7. The multimodal summarization method based on visual information fusion as claimed in claim 3, characterized in that: Inputting the obtained text features combined with visual information and summary text features into the decoder includes: The summary text features are input into the encoder-decoder multi-head attention module together with the text features combined with visual information through the multi-head attention module, and then passed through the feedforward network module to obtain the text features containing the previous text information and visual information; The obtained text features containing previous text information and visual information and the visual features are input into the modality fusion layer of the decoder to obtain the final text features.
8. The multimodal summarization method based on visual information fusion as claimed in claim 6, characterized in that: It also includes calculating the cross entropy loss between the probability distribution predicted by the model and the target summary text, and averaging the cross entropy losses of all time steps as the overall average loss. The calculated average loss is back-propagated, and the model parameters are updated using the gradient descent method to minimize the loss. The cross entropy loss between the probability distribution predicted by the model and the target summary text satisfies: Among them, y i is the true distribution of the target text, p i is the probability distribution predicted by the model.
9. A multimodal summarization system based on visual information fusion, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the multimodal summarization method based on visual information fusion as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Multi-modal text abstract system based on dependence gating fusion mechanism
CN113609285A
Multi-modal sentiment analysis method fusing multiple features and attention mechanism
CN116028846A
Image information fused Chinese cross-language news text abstract method
CN117218503A
Multi-modal video abstract generation model based on global space-time
CN117876936A
Systems and methods for multi-modal conversation summarization on a conversation platform
US20240160837A1
Cited By
Multi-modal dialogue abstract method based on multi-level visual guidance
CN119918545A
Inference acceleration device and method for cross-modal information processing
CN120197713A
