Multi-modal language generation method and system guided by multi-granularity visual information
Through the method of multi-granularity visual information guidance, combined with the fusion of low-resolution and high-resolution features and object-level features, the problem of insufficient performance of multi-modal large language models in small object recognition and high-resolution processing is solved, achieving The improvement of computing efficiency and performance is suitable for large language models of different sizes.
Patent Information
- Application Number
- CN202410861083.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Existing multi-modal large language models have poor performance in small object recognition and high-resolution visual input processing, and directly increasing the visual input resolution will lead to excessive computational costs. Although segmenting high-resolution input alleviates computational problems, The lack of fine-grained information causes the model to be unable to effectively perceive some objects in the scene.
Using a multi-granularity visual information guidance method, the visual input is interpolated into low-resolution and high-resolution data through a multi-granularity visual fusion module, features are extracted respectively, and lightweight convolution-gating is used through object-level feature fusion. The network generates high-resolution feature weights and adds fusion features to low-resolution features to reduce the amount of calculation and improve the model's fine-grained perception capabilities.
It has significantly improved the performance of multi-modal large language models, especially in small object recognition and perception tasks. The performance has been significantly improved while maintaining a relatively stable amount of calculation. It is suitable for large language models of different sizes and demonstrates generalization capabilities.
Smart Images

Figure CN118708071A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a multi-modal language generation method and system guided by multi-granularity visual information. Background Art
[0002] Traditional multimodal large language models, such as LLaVA, Figure 1 As shown in the figure, the paradigm of visual encoder-projection layer-large language model is adopted. The visual input is encoded by the visual encoder, and then the features are aligned with the input of the large language model through the projection layer. Finally, it is concatenated with the text input and sent to the large language model for decoding. However, due to the significant increase in the amount of computation caused by the change in the input length of the large language model, LLaVA only uses low-resolution (336×336) visual input. Later work, such as Figure 2 As shown in the figure, LLaVA-UHD improves the resolution of the visual input and the performance of the multimodal large language model by dividing the high-resolution input into multiple parts, inputting them into the visual encoder separately and then splicing them together.
[0003] Most existing multimodal large language models only use low-resolution inputs, which results in poor performance in recognizing small objects and also difficulties in recognizing text. If the resolution of the visual input is directly increased, the input length will increase significantly, resulting in unbearable computational costs. In addition, although splitting the high-resolution input into multiple inputs can alleviate this problem, the model still lacks more fine-grained information about the visual input, which makes it impossible for the model to perceive some objects in the scene. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art that directly improving the resolution of visual input will significantly increase the input length and bring unbearable computing costs; dividing the high-resolution input into multiple inputs still lacks more fine-grained information of the visual input, thus causing the model to be unable to perceive some objects in the scene, and to provide a multimodal language generation method and system guided by multi-granularity visual information.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A multimodal language generation method guided by multi-granularity visual information comprises the following steps:
[0007] Obtain visual input and text input, extract text input features based on the text input, process the visual input through a multi-granularity visual fusion module, concatenate it with the text input features, and input it into a large language model for decoding to obtain an output response;
[0008] The multi-granularity visual fusion module interpolates the visual input into low-resolution data and high-resolution data, and performs feature extraction respectively to obtain low-resolution features and high-resolution features, and extracts object-level features; after fusing the low-resolution features with the high-resolution features, a fused feature is obtained, which is then spliced with the object-level features to obtain an output feature result.
[0009] Furthermore, the multi-granularity visual fusion module uses a low-resolution visual encoder to extract features from low-resolution data, and uses a high-resolution visual encoder to extract features from high-resolution data.
[0010] Furthermore, the object-level feature extraction process is specifically as follows:
[0011] A labeling model is used to label the visual input by category, and the bounding box of the visual input is obtained based on the visual input and the labeled category. Based on the bounding box of the visual input and the high-resolution features, the object-level features corresponding to the bounding box are obtained by aligning the feature regions, and the obtained object-level features are spliced.
[0012] Furthermore, in the process of splicing each object-level feature, each object-level feature is globally average pooled and then spliced.
[0013] Furthermore, the process of fusing low-resolution features with high-resolution features is as follows:
[0014] The low-resolution feature and the high-resolution feature are respectively subjected to channel transformation by a one-dimensional convolution module; the two transformed features are concatenated together and sent to the access control network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature.
[0015] Furthermore, the visual input is a picture or a video.
[0016] Furthermore, the fusion features and object-level features are respectively transformed into features suitable for a large language model through a projection layer and then concatenated.
[0017] The present invention also provides a multi-modal language generation system guided by multi-granularity visual information, comprising:
[0018] Data input module, used to obtain visual input and text input;
[0019] A text embedding module is used to extract text input features based on text input;
[0020] The multi-granularity visual fusion module is used to interpolate the visual input into low-resolution data and high-resolution data, and perform feature extraction respectively to obtain low-resolution features and high-resolution features, and extract object-level features; after fusing the low-resolution features with the high-resolution features, the fused features are obtained, and then spliced with the object-level features to obtain the output feature results;
[0021] The visual text splicing module is used to splice the features output by the multi-granularity visual fusion module with the text input features;
[0022] The large language model is used to decode the splicing result output by the visual text splicing module to obtain an output response.
[0023] Furthermore, the multi-granularity visual fusion module includes:
[0024] An interpolation module, used to interpolate visual input into low-resolution data and high-resolution data;
[0025] A low-resolution visual encoder is used to extract features from low-resolution data to obtain low-resolution features;
[0026] A high-resolution visual encoder is used to extract features from high-resolution data to obtain high-resolution features;
[0027] The object-level feature extraction module is used to use the annotation model to classify the visual input, obtain the bounding box of the visual input according to the visual input and the annotated category; obtain the object-level features corresponding to the bounding box by aligning the feature regions according to the bounding box of the visual input and the high-resolution features, and splice the obtained object-level features;
[0028] The convolution gated fusion module is used to perform channel transformation on the low-resolution features and the high-resolution features respectively through the one-dimensional convolution module; the two transformed features are spliced together and sent to the gated network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature;
[0029] The multi-granularity splicing module is used to splice the fusion features with the object-level features to obtain the output feature results.
[0030] Furthermore, the multi-granularity visual fusion module also includes a first projection layer and a second projection layer, which are respectively used to convert the fusion features and the object-level features into features suitable for a large language model and then connect them.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] (1) In addition to traditional low-resolution visual input and high-resolution input, the present invention introduces object-level input into the multimodal large language model for the first time. By efficiently fusing low-resolution features, high-resolution features, and object-level features, the fine-grained perception and understanding capabilities of the multimodal large language model are improved, and the performance of the multimodal large language model is improved, especially in perception tasks.
[0033] (2) The present invention uses a lightweight convolution-gated fusion module. First, a gated network is used to generate a weight for a high-resolution feature based on low-resolution features and high-resolution features. The weight is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain a fused feature. In this process, the high-resolution feature and the low-resolution feature are fused with each other, and the input length remains unchanged, which hardly brings about an increase in the amount of computation. As a result, the overall solution significantly improves the performance of the model with a slight increase in the amount of computation.
[0034] (3) The present invention has been experimentally compared with a number of large language models of different sizes, ranging from 3.8B (Billion) parameters to 34B parameters, and all have achieved performance that exceeds other current advanced methods, demonstrating the generalization ability of the present invention's method. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the structure of an existing low-resolution input large language model provided in the background technology of the present invention;
[0036] Figure 2 A schematic diagram of the structure of an existing high-resolution input large language model provided in the background technology of the present invention;
[0037] Figure 3 A schematic diagram of a structure of a multi-granularity visual information input method for generating a multi-modal language guided by multi-granularity visual information provided in an embodiment of the present invention;
[0038] Figure 4 A schematic diagram of the overall framework of a multimodal language generation method guided by multi-granularity visual information provided in an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of the structure of a multi-granularity visual fusion module provided in an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of the structure of a convolution-gated fusion module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0044] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0045] Example 1
[0046] like Figure 3 As shown, this embodiment provides a multi-modal language generation method guided by multi-granularity visual information, comprising the following steps:
[0047] Obtain visual input and text input, extract text input features based on the text input, process the visual input through a multi-granularity visual fusion module, concatenate it with the text input features, and input it into a large language model for decoding to obtain an output response;
[0048] The multi-granularity visual fusion module interpolates the visual input into low-resolution data and high-resolution data, and performs feature extraction respectively to obtain low-resolution features and high-resolution features, and extracts object-level features; after fusing the low-resolution features with the high-resolution features, the fused features are obtained, which are then spliced with the object-level features to obtain the output feature results.
[0049] Specifically, the overall framework of this method is as follows Figure 4 As shown, the visual input (pictures, videos, etc.) is processed by the multi-granularity visual fusion module, concatenated with the features of the text input, and then input into the large language model for decoding to obtain the output response.
[0050] The multi-granularity visual fusion module efficiently fuses three types of visual information at different granularities, including low-resolution features, high-resolution features, and object-level features, enhancing the perception and understanding capabilities of the large language model.
[0051] Specifically, the multi-granularity visual fusion module uses a low-resolution visual encoder to extract features from low-resolution data, and uses a high-resolution visual encoder to extract features from high-resolution data.
[0052] The object-level feature extraction process is as follows:
[0053] A labeling model is used to label the visual input by category, and the bounding box of the visual input is obtained based on the visual input and the labeled category. Based on the bounding box of the visual input and the high-resolution features, the object-level features corresponding to the bounding box are obtained by aligning the feature regions, and the obtained object-level features are spliced.
[0054] Preferably, in order to reduce the amount of calculation, in the process of splicing each object-level feature, each object-level feature is subjected to global average pooling and then spliced.
[0055] The specific process of fusing low-resolution features with high-resolution features is:
[0056] The low-resolution features and high-resolution features are respectively transformed through the one-dimensional convolution module; the two transformed features are concatenated together and sent to the access control network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature.
[0057] Optionally, the fusion features and object-level features are respectively transformed into features suitable for a large language model through a projection layer and then concatenated.
[0058] In this embodiment, the multi-granularity visual fusion module is as follows: Figure 5 As shown, for the visual input, it is first interpolated into low resolution (336×336) and high resolution (768×768). For the low-resolution features, the CLIP-ViT visual encoder is used to extract features, and for the high-resolution, the CLIP-ConvNext visual encoder is used to extract features. At the same time, the annotation model RAM is used to annotate the image by category, and then the image and category are input into the open vocabulary detection model OWL-ViT2 to obtain a bounding box. According to the bounding box of the current image and the high-resolution features, the object-level features corresponding to the bounding box are obtained by aligning the feature regions. In order to reduce the amount of calculation, this embodiment performs global average pooling on the features corresponding to each object, and then concatenates the features of all objects.
[0059] This embodiment uses a lightweight convolution-gated fusion module to fuse low-resolution features with high-resolution features, such as Figure 6 As shown in the figure, the low-resolution features and high-resolution features are respectively transformed through two one-dimensional convolution modules, and then the two transformed features are concatenated and sent to the gate control network to generate the weight of the high-resolution feature. The weight is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature. In this process, the high-resolution feature and the low-resolution feature are fused with each other, and the input length remains unchanged, which brings almost no increase in computational complexity. The fused feature is then concatenated with the object-level feature and sent to the large language model for decoding.
[0060] This embodiment evaluates the above solution on multiple evaluation benchmarks and conducts multiple ablation experiments to verify the effectiveness of this method. The specific results are shown in Table 1.
[0061]
[0062] It should be noted that this method involves fusing and enhancing multiple features, so replacing other low-resolution features and high-resolution fusion modules, as well as changing the method of adding object-level features are all variants of this algorithm and fall within the protection scope of this method.
[0063] The above is an introduction to the method embodiment. The following is a further explanation of the solution of the present invention through a system embodiment.
[0064] This embodiment also provides a multi-modal language generation system guided by multi-granularity visual information, including:
[0065] Data input module, used to obtain visual input and text input;
[0066] A text embedding module is used to extract text input features based on text input;
[0067] The multi-granularity visual fusion module is used to interpolate the visual input into low-resolution data and high-resolution data, and perform feature extraction respectively to obtain low-resolution features and high-resolution features, and extract object-level features; after fusing the low-resolution features with the high-resolution features, the fused features are obtained, and then spliced with the object-level features to obtain the output feature results;
[0068] The visual text splicing module is used to splice the features output by the multi-granularity visual fusion module with the text input features;
[0069] The large language model is used to decode the splicing result output by the visual text splicing module to obtain an output response.
[0070] Optional, multi-granularity visual fusion module includes:
[0071] An interpolation module, used to interpolate visual input into low-resolution data and high-resolution data;
[0072] A low-resolution visual encoder is used to extract features from low-resolution data to obtain low-resolution features;
[0073] A high-resolution visual encoder is used to extract features from high-resolution data to obtain high-resolution features;
[0074] The object-level feature extraction module is used to use the annotation model to classify the visual input, obtain the bounding box of the visual input according to the visual input and the annotated category; obtain the object-level features corresponding to the bounding box by aligning the feature regions according to the bounding box of the visual input and the high-resolution features, and splice the obtained object-level features;
[0075] The convolution gated fusion module is used to transform the channels of low-resolution features and high-resolution features through a one-dimensional convolution module respectively; the two transformed features are concatenated and sent to the gated network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature;
[0076] The multi-granularity splicing module is used to splice the fusion features with the object-level features to obtain the output feature results.
[0077] Optionally, the multi-granularity visual fusion module also includes a first projection layer and a second projection layer, which are respectively used to convert the fusion features and the object-level features into features suitable for a large language model and then concatenate them.
[0078] It should be noted that the specific content and beneficial effects of the system of the present application can be found in the above-mentioned method embodiment, which will not be repeated here.
[0079] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A multimodal language generation method guided by multi-granularity visual information, characterized in that: The following steps are involved: Obtain visual input and text input, extract text input features based on the text input, process the visual input through a multi-granularity visual fusion module, concatenate it with the text input features, and input it into a large language model for decoding to obtain an output response; The multi-granularity visual fusion module interpolates the visual input into low-resolution data and high-resolution data, and performs feature extraction respectively to obtain low-resolution features and high-resolution features, and extracts object-level features; after fusing the low-resolution features with the high-resolution features, a fused feature is obtained, which is then spliced with the object-level features to obtain an output feature result.
2. The multimodal language generation method guided by multi-granularity visual information according to claim 1, characterized in that: The multi-granularity visual fusion module uses a low-resolution visual encoder to extract features from low-resolution data, and uses a high-resolution visual encoder to extract features from high-resolution data.
3. The multimodal language generation method guided by multi-granularity visual information according to claim 1, characterized in that: The object-level feature extraction process is specifically as follows: A labeling model is used to label the visual input by category, and the bounding box of the visual input is obtained based on the visual input and the labeled category. Based on the bounding box of the visual input and the high-resolution features, the object-level features corresponding to the bounding box are obtained by aligning the feature regions, and the obtained object-level features are spliced.
4. The multimodal language generation method guided by multi-granularity visual information according to claim 3, characterized in that: In the process of splicing each object-level feature, each object-level feature is globally averaged and then spliced.
5. The multimodal language generation method guided by multi-granularity visual information according to claim 3, characterized in that: The specific process of fusing low-resolution features with high-resolution features is: The low-resolution feature and the high-resolution feature are respectively subjected to channel transformation by a one-dimensional convolution module; the two transformed features are concatenated together and sent to the access control network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature.
6. The multi-modal language generation method guided by multi-granularity visual information according to claim 1, characterized in that: The visual input is a picture or a video.
7. The multimodal language generation method guided by multi-granularity visual information according to claim 1, characterized in that: The fusion features and object-level features are respectively transformed into features suitable for a large language model through a projection layer and then concatenated.
8. A multimodal language generation system guided by multi-granularity visual information, characterized in that: include: Data input module, used to obtain visual input and text input; A text embedding module is used to extract text input features based on text input; The multi-granularity visual fusion module is used to interpolate the visual input into low-resolution data and high-resolution data, and perform feature extraction respectively to obtain low-resolution features and high-resolution features, and extract object-level features; after fusing the low-resolution features with the high-resolution features, the fused features are obtained, and then spliced with the object-level features to obtain the output feature results; The visual text splicing module is used to splice the features output by the multi-granularity visual fusion module with the text input features; The large language model is used to decode the splicing result output by the visual text splicing module to obtain an output response.
9. The multi-modal language generation system guided by multi-granularity visual information according to claim 8, characterized in that: The multi-granularity visual fusion module includes: An interpolation module, used to interpolate visual input into low-resolution data and high-resolution data; A low-resolution visual encoder is used to extract features from low-resolution data to obtain low-resolution features; A high-resolution visual encoder is used to extract features from high-resolution data to obtain high-resolution features; The object-level feature extraction module is used to use the annotation model to classify the visual input, obtain the bounding box of the visual input according to the visual input and the annotated category; obtain the object-level features corresponding to the bounding box by aligning the feature regions according to the bounding box of the visual input and the high-resolution features, and splice the obtained object-level features; The convolution gated fusion module is used to perform channel transformation on the low-resolution features and the high-resolution features respectively through the one-dimensional convolution module; the two transformed features are spliced together and sent to the gated network to generate the weight of the high-resolution feature; the weight of the high-resolution feature is multiplied by the high-resolution feature and then added to the low-resolution feature to obtain the fused feature; The multi-granularity splicing module is used to splice the fusion features with the object-level features to obtain the output feature results.
10. The multi-modal language generation system guided by multi-granularity visual information according to claim 9, characterized in that: The multi-granularity visual fusion module also includes a first projection layer and a second projection layer, which are respectively used to convert the fusion features and the object-level features into features suitable for a large language model and then concatenate them.
Citation Information
Patent Citations
Detection method for visual language large model with fusion module
CN117809008A
Multi-modal large language model training method and system based on multi-scale visual features
CN117852607A
Image segmentation method and apparatus, and device, and storage medium
US20230394671A1
Cited By
Multi-modal model visual perception ability enhancement method and device, and medium
CN119809925A
Visual question and answer method and device based on multi-modal large model and medium
CN119938872A
A Visual Question Answering Method, Device and Medium Based on Multimodal Large Model
CN119938872B
