Chat system and method for conversation according to visual content
Through the combination of the visual feature encoding module and the large language model, combined with the progressive training framework and the multi-head relationship aggregator, the problems of data bias, gaze offset and information fusion of the multi-modal question and answer model are solved, and the universality of the dialogue system is improved. ization capabilities and accuracy, suitable for multi-modal dialogue tasks.
Patent Information
- Application Number
- CN202410654180.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-11
- Filing Date
- 2024-05-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing multi-modal question answering models have flaws in data bias, model gaze bias, and insufficient or overfitting of visual and audio information, resulting in poor performance in the real world.
It uses a combination of visual feature coding module and large language model to generate visual coding content through visual feature coding, and combines user text input to generate dialogue output. It uses a progressive training framework and a spatiotemporal joint attention mechanism, and introduces pre-trained QFormer and global multi-head Relation aggregator performs visual-text alignment and multi-modal instruction fine-tuning to improve the generalization ability and accuracy of the model.
It improves the generalization ability of the chat system and the accuracy of dialogue output, can better understand and generate dialogue related to video content, makes up for the shortcomings of traditional methods in complex temporal reasoning and causal inference, and is suitable for multi-modal dialogue tasks. .
Smart Images

Figure CN118535764A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a chat system and method for dialogue based on visual content. Background Art
[0002] A multimodal question answering model is a model that, given an image or video clip and a question, needs to answer the question based on the visual content. Existing solutions all use generative models to solve this problem, mainly including text-based methods, vision-based methods, audio-based methods, and multimodal methods.
[0003] Specifically, text-based methods mainly rely on analyzing the text in the video to answer questions related to the video. For example, subtitles or text appearing in the scene are detected and recognized through OCR technology. Vision-based methods focus on analyzing the visual content of the video, such as objects, scenes, actions, etc., in order to extract key information from them. Typical visual features include features extracted by CNN (convolutional neural network) or pre-trained models such as ViT or SwAV. Audio-based methods analyze the audio signal in the video to answer questions related to sound. For example, identify specific people, music types or background noise by sound. Multimodal methods integrate multiple information sources such as text, vision and audio to solve video question answering tasks. This usually includes feature extraction and representation learning for each modality, and combining all information through fusion algorithms.
[0004] Video question answering is a method to evaluate a computer's ability to understand video content. After analysis, existing solutions have the following main defects:
[0005] 1) Data bias. Current model training data sets are too focused on certain scenarios or fields, resulting in poor performance of the model in the real world.
[0006] 2) Model gaze shift: The model fails to focus on all important areas related to the question, resulting in inaccurate answers.
[0007] 3) In multimodal methods, effectively fusing visual information in videos with audio information remains challenging and may lead to insufficient fusion or overfitting. The complex question structure may make it difficult for the model to parse the question and produce the correct answer.
[0008] There is a need in the art for a chat system and method for conversation based on visual content that is improved in one or more of the above aspects. Summary of the invention
[0009] In order to overcome at least one of the above-mentioned defects of the prior art, a chat system and method based on visual content dialogue is provided.
[0010] According to a first aspect of the present invention, there is provided a chat system for dialogue based on visual content. The chat system comprises a visual feature encoding module and a large language model, wherein the visual feature encoding module is used to generate a visual feature encoding corresponding to a visual input, wherein the visual feature encoding is used to form a visual encoding content, and the large language model is used to generate a corresponding dialogue output based on the visual encoding content and a user text input.
[0011] According to a second aspect of the present invention, a chat method based on visual content dialogue is provided. The method comprises the following steps: generating a visual feature encoding corresponding to a visual input by a visual feature encoding module, the visual feature encoding being used to form visual encoding content; and generating a corresponding dialogue output based on the visual encoding content and user text input by a large language model.
[0012] The chat system and chat method for conversation based on visual content according to the embodiments of the present invention have strong generalization ability and high accuracy.
[0013] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0015] Figure 1 is a block diagram of a chat system based on visual content according to an embodiment of the present invention.
[0016] Figure 2 is a schematic diagram of a chat system for conversation based on visual content according to an embodiment of the present invention.
[0017] Figure 3 2 is a schematic diagram of a process of a video pre-training model according to an embodiment of the present invention.
[0018] Figure 4 2 is a schematic diagram of a process of a video pre-training model according to an embodiment of the present invention.
[0019] Figure 5 is a flow chart of a chatting method based on visual content according to an embodiment of the present invention.
[0020] Figure 6 is a flowchart of a process for training a large language model according to some embodiments of the present invention.
[0021] Figure 7 It is a schematic diagram of the display effect of a chat system based on visual content dialogue according to an embodiment of the present invention.
[0022] Figure 8 It is a schematic diagram of the display effect of a chat system based on visual content dialogue according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0024] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0025] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0026] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0027] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0028] According to one aspect of the present invention, a chat system based on visual content is provided.
[0029] Figure 1 1 is a block diagram of a chat system 100 based on visual content according to an embodiment of the present invention. The chat system 100 can have a wide range of applications. For example, it can be applied to chat robots, real-time barrage Q&A, tools to help blind people watch videos, security Q&A robots, entertainment Q&A robots, and other scenarios.
[0030] The chat system 100 may include a visual feature encoding module 110 and a large language module 120. The visual feature encoding module 110 may be used to receive a visual input 130 and generate a visual feature encoding corresponding to the visual input 130. The visual feature encoding may be used to form a visual encoding content. As an example, the visual input 130 may include a video, an image, etc. The large language model may be used to generate a corresponding dialogue output based on the visual encoding content and the user text input.
[0031] By forming visual encoding content including visual feature encoding and using it as the input of a large language model, the chat system according to an embodiment of the present invention is more accurate than a text-based implementation, can make up for the shortcomings of visual content description text obtained by traditional perception methods in understanding complex temporal reasoning and causal inference, and is better compatible with visual content embedding in multimodal dialogue tasks.
[0032] In some embodiments, the chat system 100 may further include a perception module 140 . The perception module 140 may be used to convert the visual input 130 into a structured visual content description text, which is also used to form visual encoding content as one of the inputs of the large language model 120 .
[0033] In some embodiments, the visual feature encoding module 110 may include a video encoder 112 and a code mapping module 114. In some embodiments, the visual encoder 112 may include an image encoder (e.g., CLIP ViT-G) and a global multi-head relation aggregator (GMHRA). Such a visual encoder 112 is a powerful temporal modeling module. In this embodiment, all visual tokens of the image encoder are processed and knowledge is fully distilled directly from a pre-trained image model (e.g., CLIP).
[0034] In some embodiments, the visual encoder 112 may include a feature encoder (e.g., UMT ViT-L) containing a spatiotemporal attention mechanism. For this embodiment, the visual tokens of the visual encoder 112 may be masked, and only the non-masked visual tokens are processed, so that knowledge can be partially distilled from a pre-trained image model (e.g., CLIP). Compared with the embodiment using ViT-G, in the upgraded dialogue system, the secondary development method of the image-based model of ViT-G destroys the generalization inherited from the image-based model, and image pre-training easily causes the video model to be too "short-sighted", ignoring the global spatiotemporal relationship, while also limiting the amplification of the model. This implementation introduces a progressive training framework that uses a spatiotemporal joint attention mechanism to process only the non-masked visual tokens in ViT. The features of the teacher and the student are aligned through the MSE loss, so that the student model can distill knowledge from the pre-trained image model (e.g., CLIP).
[0035] In some embodiments, the encoding mapping module 114 may include a QFormer. In some embodiments, the encoding mapping module 114 may include a linear projection module. By adopting a pre-trained QFormer and adding additional linear projections, more query tokens are added for complex video contexts. This approach enables a compact text pre-trained model compatible video embedding to facilitate multimodal question answering using the chat system 100.
[0036] In some embodiments, the large language model may include a low-rank adaptation module that operates in conjunction with the visual feature encoding module 110 during training to be adjusted by a visually guided text generation loss. This is a class of techniques that aims to reduce the complexity of a large model by approximating its high-dimensional structure with a low-dimensional structure. In the context of a language model, this means creating a smaller, more manageable representation of the original model that still performs well for a specific task or domain. It is combined with a visual encoder 112 and an encoding mapping module 114 to be adjusted by a visually guided text generation loss. In addition, the instruction data of the visual question-answer pair can be integrated into the encoding mapping module 114 to extract visual tags related to the instruction as input to the large language model 120. This will be discussed below in conjunction with Figure 4 The low-rank adaptation module is further described.
[0037] In some embodiments, the large language model can be trained by the following steps: fine-tuning using multiple visual-text pairs to obtain fine-tuning results; and fine-tuning instructions based on video multimodal instruction fine-tuning data, the video multimodal instruction fine-tuning data including visual input and question-answering data collected from the large language model. This process will be combined with Figure 3 Further description.
[0038] In some embodiments, the large language model can be trained by the following steps: preliminary fine-tuning based on multiple visual-text pairs to obtain preliminary fine-tuning results; interface fine-tuning based on video multimodal interface fine-tuning data to obtain interface fine-tuning results, the video multimodal interface fine-tuning data includes visual input and question-answering data collected from the large language model; and instruction fine-tuning based on video multimodal instruction fine-tuning data, the video multimodal interface instruction data includes visual input and question-answering data with instructions collected from the large language model. This process will be combined with Figure 4 Further description.
[0039] Figure 2 is a schematic diagram of a chat system for conversation based on visual content according to an embodiment of the present invention.
[0040] Figure 2 The chat system shown in the above may be combined with Figure 1 The chat system 100 described above is one implementation mode, but the scope of the present invention is not limited thereto. Figure 2As shown, the present invention is a chat tool for open domain dialogue based on video content, and the provided solution is mainly divided into two parts. First, a video-centric multimodal instruction fine-tuning data collection method is designed for the first time. The data collection method can be used to collect detailed text description pairs associated with video images and generate dense subtitles arranged in chronological order. During the data collection process, emphasis is placed on spatiotemporal objects, actions, events, and causal relationships, providing valuable resources for training and evaluating video-centric multimodal dialogue systems. Second, a new and effective video-centric multimodal dialogue system is developed, which involves two modules. A perception module converts the video into a structured video description text for direct input into the text dialogue system, and another video pre-training module aligns the visual features with the text features of the pure text dialogue system for belonging to the text dialogue system, together forming a multimodal dialogue system that can support the wide application of multimodal dialogue systems in various fields.
[0041] Some embodiments provide a video-centric instruction fine-tuning data collection method: In this instruction fine-tuning, the generation of corresponding detailed descriptions and question-answering data is generated by a pre-trained natural language model based on a video perception module (described in detail below) and some prompts about spatiotemporal features. As an example, the perception module can be a text-based Figure 1 The perception module 140 of the described chat system 100. Compared with the video detailed description, video question-answer pairs are introduced to further improve the diversity, temporal and causal features in the video guidance data.
[0042] For the video detailed description data collection method, in one embodiment, a pre-trained natural language model is used to modify the provided video description into a video narrative. This highlights the temporal aspect of the video by depicting it evolving over time. The first prompt word transforms the various predicted text tags into a coherent, evolving story as follows:
[0043] Here is a video about {origin_caption}. The video content is in chronological order: {video_description}. Please describe the video in detail using the order adverbs "first", "next", "then" and "finally", but do not mention specific times. Give as many details as possible. Say everything you see. The description should be more than 150 words, but less than 200 words.
[0044] The second improves the narrative to improve clarity and coherence while reducing the amount of fluff, as follows:
[0045] Please fix the errors in the given paragraph. Delete any repeated sentences, meaningless characters, non-English sentences, etc. Remove unnecessary repetitions. Rewrite any incomplete sentences. Return the result without explanation. If the input paragraph is already correct, return it without explanation.
[0046] Video Question-Answer Pairs: With the video description, a pre-trained natural language model is used to generate multi-turn dialogues for three types of prompts with descriptive, temporal, and causal content. For the temporal and causal parts, a prompt table is proposed as shown in the following table, focusing on temporal perception / reasoning and explaining / revealing intent / reason.
[0047] As an AI visual assistant, you are observing a video. A description of the video is presented to you in chronological order, detailing information such as object types, their locations (using coordinates), properties, interactions between objects, behaviors, and the environment. Based on these descriptions, you need to answer all questions as if you were watching the video directly. Create a dialogue that simulates you as the visual assistant observing the video and answering questions about the content of the video. Make sure the answers reflect the tone of a visual AI assistant who is actively engaged in observing the video and answering questions. Include different queries and corresponding responses.
[0048] Cover questions related to the visual content of the video, such as object types, attributes, object counts, behaviors, locations, relative positions of objects, changes in object behaviors or locations over time, and interactions between objects. Include only questions with clear answers: Questions that can be confidently observed and answered based on the video content Questions that can be confidently determined to be irrelevant to the video
[0049] Next, include questions related to time perception and reasoning, such as asking what a person did before and after an event, or asking for specific timestamps for specific events or actions.
[0050] Additionally, complex questions related to the content of the video are included, such as asking for background knowledge about objects or behaviors in the video, discussing events that occur in the video, exploring hypothetical topics in depth (e.g., what might happen if a person lost their phone while playing with it in the video), explaining a character's emotions or behaviors based on their experiences in the video, or predicting how a video's story or scene will develop.
[0051] Since you receive a video description as you watch it, prioritize asking questions about visual changes over time and the reasons or causes behind those changes, rather than inferring from a single frame.
[0052] Be careful not to ask for details you are not sure about. When answering complex questions, provide a thorough answer that incorporates detailed examples or reasoning steps to make the content more convincing and structured. Use multiple paragraphs if necessary. If a question cannot be answered based on the given description, answer "the video provided does not present such information" instead of indicating that the information comes from the text description.
[0053] Some embodiments unify video-related tasks into a multi-round video question-answering format, consisting of an explicit structured text module for generating video descriptions and a video pre-trained encoding and mapping module for projecting visual feature encodings.
[0054] In some embodiments, tasks are defined by text in real-time reasoning, and few or no learning examples are given. In this formulation, the present invention treats the text pre-trained large model as a general video task decoder, converting video-related descriptions or embeddings into human-understandable text. This process is very user-friendly in terms of using the base model to handle a variety of applications.
[0055]
[0056] In one embodiment, concepts are extracted from videos using a visual model as follows: where E represents a text description or embedding according to the context, Denotes the jth image model to predict human-readable annotations or visual features, while I and V denote images and videos, respectively. The decoding task prediction from the text pre-trained large model is then performed based on the user’s question as follows:
[0057]
[0058] in, and They represent the answers of the w text pre-trained large model in round t and all questions given by users before round t. llm Represents a large text pre-trained model.
[0059] From a technical perspective, an ideal end-to-end video multimodal dialogue system should use a video / vision base model (encoder) to convert visual sequences into latent features of a large text pre-trained model to ensure the overall differentiability of the system.
[0060] In one embodiment, for the perception module, multiple visual models are used to convert the visual data in the video into text format. Subsequently, specially designed prompts are created to temporally structure the predicted text. Finally, a pre-trained text pre-trained large model is relied upon to process the user-specified task by inputting questions based on the text description of the video.
[0061] Specifically, for a given video, a video frame extraction tool is used to extract key frames from the video at a specific frame rate to obtain T video frames and related audio. Further, by inputting the extracted frames and audio into various models, action labels, frame summaries, video labels, dense object descriptions, object location coordinates, video subtitles, timestamps, and other details related to the clip are obtained. Then, relevant content is integrated in the subtitles to generate a video text description with a timestamp.
[0062] For example, the prompt words are as follows:
[0063] ****************************
[0064] Among them, our prompt words are as follows:
[0065] You are a chatbot that conducts conversations based on video scenes. You mainly answer questions based on the given context, and can modify the content based on the tag information, and can also answer the knowledge related to the people or objects contained in the video. The time description is a description every K seconds, so that you can convert it into time. When describing, please mainly refer to the time description. Dense subtitles are given every five seconds, and you can eliminate ambiguity between them in time. But please don't create a video plot out of thin air. Let's get started!
[0066] Chronological video context: {video segment classification labels, video subtitles
[0067] Timestamp 1 segment title, segment tag, dense subtitle, video subtitle...
[0068] Timestamp 1 segment title, segment tag, dense subtitle, video subtitle...
[0069] Timestamp 2 segment title, segment label, dense subtitle, video subtitle...
[0070] }
[0071] Question: {Question}
[0072] **********************************
[0073] Prior to this, the effectiveness of a large text pre-trained model as a general video task interpreter was verified through the perceptual coding module proposed in this paper. This method uses various visual models to convert videos into text streams so that the text pre-trained large model can then be used for discrimination / inference tasks.
[0074] Considering that relying solely on the perception module is still insufficient in understanding complex temporal reasoning and causal inference, in one embodiment, a pre-trained model encoding and mapping module is introduced, which is a multimodal system that combines video and language base models. As an example, the pre-trained model encoding and mapping module can be the above combined Figure 1 The visual feature encoding module 110 described above is described in detail. It significantly improves performance on high-order temporal tasks by fine-tuning on video guidance data. In some embodiments, this module integrates the pre-trained ViT-G with the Global Multi-Head Relation Aggregator (GMHRA), a powerful temporal modeling module.
[0075] In addition, considering the use of the above-mentioned ViT-G in some embodiments in the upgraded dialogue system, the secondary development method of the image-based model will destroy the generalization inherited from the image-based model, and the image pre-training will easily cause the video model to be too "short-sighted", ignoring the global spatiotemporal relationship, while also limiting the amplification of the model. Therefore, in some embodiments, a progressive training framework is provided, which uses a spatiotemporal joint attention mechanism to process only non-masked visual tokens in ViT. The features of the teacher and the student are aligned through the MSE loss, so that the student model can distill knowledge from the pre-trained image model CLIP.
[0076] In addition, for the token interface, the pre-trained QFormer is adopted and additional linear projections are added, where more query tokens are added for complex video contexts. This approach can obtain compact text pre-trained model compatible video embedding for subsequent multimodal question answering.
[0077] In some embodiments, training focuses on the newly integrated global multi-head relation aggregator (GMHRA), query tokens, and linear projections, while keeping other components unchanged. In some embodiments, training focuses on the newly integrated feature encoder with spatiotemporal attention mechanism, query tokens, and linear projections, while keeping other components unchanged. First, the modified video encoder is aligned with the text pre-trained model using large-scale video-text fine-tuning. Then, two types of videos are used to train the dialogue system: video detailed descriptions and video question-answer pairs.
[0078] Figure 3 1 is a schematic diagram of the process of video pre-training model according to an embodiment of the present invention. The process can be divided into the following two stages:
[0079] Phase 1: Alignment. In order to strike a balance between training convergence and efficiency, 25 million visual-text pairs are introduced for a round of fine-tuning.
[0080] Phase 2: instruction fine-tuning is to further train the fine-tuning results of the first phase. This phase uses the question-answering data collected by the data collection system for fine-tuning to improve the generalization ability of the model. At the same time, guidance information from human expressions is introduced to help the model better understand and generate human language.
[0081] Figure 3 The visual feature encoding module in can be a combination of the above Figure 1 Describing the visual encoder 112, QFormer can be Figure 1 In the encoding mapping module 114, the text pre-training model can be Figure 1 The large language model 120 in .
[0082] Figure 3 In the figure, snowflake symbols are used to indicate that the corresponding modules are in a "frozen" state, that is, the parameters of these modules / models are not updated, and flame symbols are used to indicate that the corresponding modules are in an "open" state, that is, the parameters of the corresponding modules / models will be updated in the current round of training.
[0083] Figure 4 2 is a schematic diagram of a process of a video pre-training model according to an embodiment of the present invention.
[0084] Figure 4 The process in may include stage 410, stage 420 and stage 450.
[0085] In stage 410, alignment is performed, that is, in order to strike a balance between training convergence and efficiency, a preliminary fine-tuning of the visual-text pair is introduced. The preliminary fine-tuning can be performed by a visual encoder 411 and an encoding mapping module 412. As an example, the visual encoder 411 can be a combination of the above Figure 1 The visual encoder 112 described above, and the encoding mapping module 412 can be combined with the above Figure 1 The encoding mapping module 114 is described.
[0086] Specifically, the visual encoder 411 can receive a visual input 413 and generate an output K / V. As an example, the visual input 413 can include a video and / or an image. The encoding mapping module 412 can receive the output K / V, a query 414, and a text 415 to output a result. Based on the result, various losses 416 can be determined, and the training of this stage 410 can be completed by comparing the losses 416 under various parameters. As an example, the loss 416 can include one or more of a visual text description loss, a visual text matching loss, and a visually guided text generation loss.
[0087] In stage 430, the visual-language interface is fine-tuned. This stage 430 is to further train the fine-tuning results of stage 410. This stage 430 uses the question-answering data collected by the data collection system and combines it with the visual input to perform fine-tuning to improve the generalization ability of the model. At the same time, guidance information of human expressions can also be introduced to help the model better understand and generate human language. The visual-language interface fine-tuning can be performed by the visual encoder 431 and the encoding mapping module 432 in combination with the large language model 433. As an example, the visual encoder 431 can be combined with the above Figure 1 The visual encoder 112 described above, the encoding mapping module 432 can be combined with Figure 1 The encoding mapping module 114 described above and the large language model 433 may be a combination of the above Figure 1 A large language model 120 is described.
[0088] Specifically, visual encoder 431 can receive visual input 434 and generate output K / V. As an example, the visual input 434 can include video and / or image. Coding mapping module 432 can receive the output K / V and query 414 to output visual coding content 436. Text 437b can be output based on the visual coding content 436 and text 437a (user input), and visually guided text generation loss 438 can be determined in this process. The training of this stage 430 can be completed by comparing the visually guided text generation loss 438 under various parameters. In this stage 430, linear projection module 432a is added to coding mapping module 432 so that the generated visual coding content 436 can be used for training subsequent large language model 433.
[0089] In stage 450, visual-language instruction fine-tuning is performed. This stage 450 is a further training of the results of the fine-tuning in stage 430. This stage uses the instruction fine-tuning dataset converted from the original dataset of different capabilities to perform fine-tuning to improve the model's ability to follow instructions and other capabilities. The visual-language instruction fine-tuning can be performed by the visual encoder 451 and the encoding mapping module 452 in combination with the large language model 453. As an example, the visual encoder 451 can be a combination of the above Figure 1 The visual encoder 112 described above, the encoding mapping module 452 can be combined with Figure 1 The encoding mapping module 114 described above and the large language model 453 may be a combination of the above Figure 1 A large language model 120 is described.
[0090] Specifically, the visual encoder 451 can receive a visual input 454 and generate an output K / V. As an example, the visual input 454 can include a video and / or an image. The encoding mapping module 452 can receive the output K / V, the query 435 and the instruction 456 (involved in the question-answering dialogue) to output the visual encoding content 437. Based on the visual encoding content 457 and the question 437a (user input), an answer 458b can be output, and the visually guided text generation loss 459 can be determined in this process. The training of this stage 450 can be completed by comparing the visually guided text generation loss 459 under various parameters. In this stage 450, a linear projection module 452a is added to the encoding mapping module 452 so that the generated visual encoding content 457 can be used to train the subsequent large language model 453. In this stage 450, a low-rank adaptive module 453a is also added to the large language model 453, which is intended to reduce its complexity by approximating the high-dimensional structure of a large model with a low-dimensional structure. In the context of language models, this means creating a smaller, more manageable representation of the original model that still performs well for a specific task or domain. Adding this low-rank adaptive module 453a adds new multimodal model capabilities while retaining the original large language model 453 as much as possible, thereby better improving the chat system's capabilities for video actions, object recognition, positional relationships, scenes, optical character recognition, reasoning, etc.
[0091] According to one aspect of the present invention, a chatting method based on visual content is provided.
[0092] Figure 5 1 is a flow chart of a chat method 500 based on visual content according to an embodiment of the present invention. The chat method 500 can be combined with the above Figure 1 The chat system 100 is described to perform, but the scope of the present invention is not limited in this regard.
[0093] The chatting method 500 may include step 510: generating, by a visual feature encoding module, a visual feature code corresponding to a visual input, wherein the visual feature code is used to form a visual encoding content.
[0094] The chatting method 500 may include step 530: generating corresponding dialogue output based on the visual encoding content and the user text input by the large language model.
[0095] Optionally, in some embodiments, the chatting method 500 may further include step 550: the perception module converts the visual input into a structured visual content description text, wherein the visual content description text is also used to form the visual coding content.
[0096] Figure 6610 and 650 are flowcharts of processes 610 and 650 for training a large language model according to some embodiments of the present invention. Figure 1 The large language model described is 120 or combined Figure 5 The large language model involved in the chat method 500 is described, but the scope of the present invention is not limited to this.
[0097] Process 610 may include step 612 : performing fine-tuning using a plurality of visual-text pairs to obtain a fine-tuning result.
[0098] Process 610 may include step 614: performing instruction fine-tuning based on video multimodal instruction fine-tuning data, the video multimodal instruction fine-tuning data including visual input and question-answering data collected from a large language model.
[0099] Further details of process 610 may be described above in conjunction with Figure 3 described.
[0100] Process 650 may include step 652 : performing preliminary fine-tuning based on a plurality of visual-text pairs to obtain preliminary fine-tuning results.
[0101] Process 650 may include step 654: performing interface fine-tuning based on video multimodal interface fine-tuning data to obtain an interface fine-tuning result, wherein the video multimodal interface fine-tuning data includes visual input and question-answering data collected from a large language model.
[0102] Process 650 may include step 656: performing instruction fine-tuning based on video multimodal instruction fine-tuning data, the video multimodal interface instruction data including visual input and question-answering data with instructions collected from a large language model.
[0103] Further details of process 650 may be described above in conjunction with Figure 4 described.
[0104] In order to further verify the effect of the present invention, a system was launched, which can vchat.opengvlab.com The system is operating normally, see Figure 7 , Figure 8 The present invention can be applied to chat robots, real-time barrage question and answer, tools to help blind people watch videos, security question and answer robots, entertainment question and answer robots and other scenarios.
[0105] In summary, the present invention provides a method for collecting video multimodal instruction fine-tuning data, a method for explicitly textually structuring videos for use in text dialogue systems, and a method for implicitly encoding videos for use in building multimodal dialogue systems. Compared with the prior art, the present invention can perform multimodal question-answering on open domain videos; can capture the timing information of videos and give answers based on the timing information; can implicitly encode videos to interact directly with text dialogue models, and utilize the powerful text generation capabilities of text dialogue models to improve the accuracy of responses. In short, the present invention is the first to use implicit video encoding in the construction of a multimodal dialogue system, in which the text model can also be replaced by other model structures; different image description models can also be used to generate visual text descriptions during the explicit encoding process.
[0106] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0107] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0108] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0109] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, Python, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0110] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0111] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0112] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0113] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0114] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A chat system based on visual content dialogue, include: A visual feature encoding module, used to generate a visual feature code corresponding to the visual input, wherein the visual feature code is used to form a visual encoding content; as well as A large language model is used to generate corresponding dialogue output based on the visual encoding content and user text input.
2. The system according to claim 1, It is characterized in that It also includes a perception module, which is used to convert the visual input into a structured visual content description text, wherein the structured visual content description text is also used to form the visual encoding content.
3. The chat system according to claim 1, It is characterized in that The visual feature encoding module includes a visual encoder and a coding mapping module.
4. The chat system according to claim 3, It is characterized in that The visual encoder includes an image encoder and a global multi-head relationship aggregator, or the visual encoder includes a feature encoder including a spatiotemporal attention mechanism.
5. The chat system according to claim 4, It is characterized in that For the feature encoder with spatiotemporal attention mechanism, only non-masked visual tokens are processed, enabling partial distillation of knowledge from the pre-trained image model.
6. The chat system according to claim 3, It is characterized in that The encoding mapping module includes a linear projection module.
7. The chat system according to claim 1, It is characterized in that The large language model includes a low-rank adaptation module that operates in conjunction with the visual feature encoding module during training to be adjusted by a visually guided text generation loss.
8. The chat system according to claim 1, It is characterized in that The large language model is trained by the following steps: Utilize multiple visual-text pairs for fine-tuning to obtain fine-tuning results; and Instruction fine-tuning is performed based on video multimodal instruction fine-tuning data, wherein the video multimodal instruction fine-tuning data includes the visual input and question-answering data collected from the large language model.
9. The chat system according to claim 1, It is characterized in that The large language model is trained by the following steps: Perform preliminary fine-tuning based on multiple visual-text pairs to obtain preliminary fine-tuning results; Performing interface fine-tuning based on video multimodal interface fine-tuning data to obtain an interface fine-tuning result, wherein the video multimodal interface fine-tuning data includes the visual input and the question-answering data collected from the large language model; as well as Instruction fine-tuning is performed based on video multimodal instruction fine-tuning data, wherein the video multimodal interface instruction data includes the visual input and question-answering data with instructions collected from the large language model.
10. The chat system according to claim 8 or 9, It is characterized in that The question-answering data is constructed through the following steps: With the goal of describing the temporality of the video, the target video description is modified into a video narrative using the pre-trained first natural language model; improving the video narrative with the goal of improving clarity and coherence to obtain a revised video narrative; Based on the modified video narration, a pre-trained second natural language model is used to generate multiple rounds of dialogue for prompts, wherein the prompts have one or more types of descriptive, temporal, and causal content.
11. The chat system according to claim 1, It is characterized in that The prediction output of the large language model is determined in the following way: in, and They represent the answers of the large language model in round t and all questions asked by users before round t, respectively. llm represents the large language model, and E represents the text description.
12. A chat method based on visual content dialogue, The following steps are involved: The visual feature encoding module generates a visual feature code corresponding to the visual input, wherein the visual feature code is used to form a visual encoding content; as well as The large language model generates corresponding dialogue output based on the visual encoding content and user text input.
13. The chatting method according to claim 12, It is characterized in that The large language model is trained by the following steps: Utilize multiple visual-text pairs for fine-tuning to obtain fine-tuning results; Instruction fine-tuning is performed based on video multimodal instruction fine-tuning data, wherein the video multimodal instruction fine-tuning data includes the visual input and question-answering data collected from the large language model.
14. The chatting method according to claim 12, It is characterized in that The large language model is trained by the following steps: Perform preliminary fine-tuning based on multiple visual-text pairs to obtain preliminary fine-tuning results; Performing interface fine-tuning based on video multimodal interface fine-tuning data to obtain an interface fine-tuning result, wherein the video multimodal interface fine-tuning data includes the visual input and the question-answering data collected from the large language model; as well as Instruction fine-tuning is performed based on video multimodal instruction fine-tuning data, wherein the video multimodal interface instruction data includes the visual input and question-answering data with instructions collected from the large language model.
15. A computer-readable storage medium having a computer program stored thereon, in, When the computer program is executed by a processor, the steps of the chatting method according to any one of claims 12 to 14 are implemented.
16. A computer device comprising a memory and a processor, wherein a computer program capable of being executed on the processor is stored in the memory, It is characterized in that When the processor executes the computer program, the steps of the chatting method described in any one of claims 12 to 14 are implemented.
17. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the chatting method according to any one of claims 12 to 14 are implemented.
Citation Information
Patent Citations
Visual question-answering problem solving method based on image vision-to-text conversion
CN110717024A
Natural language model training method and system based on word granularity
CN113326693A
Visual question and answer training method and system and computer readable storage medium
CN114840651A
Data processing method and device, electronic equipment and storage medium
CN115393849A
Spatial-Temporal Reasoning Through Pretrained Language Models for Video-Grounded Dialogues
US20210174162A1
Cited By
Retina image classification method and system based on multi-modal incremental learning
CN120954078A
Task-oriented dialogue system and method based on generative large language model
TWI909868B
