Full-modal fusion method and device based on encoder-decoder architecture
Through the full-modal fusion method based on the encoder-decoder architecture, the problems of parallel processing of multi-modal data and intra-time correlation not considered in the existing technology are solved, and efficient fusion and processing of multi-modal data are achieved.
Patent Information
- Application Number
- CN202410764996.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-17
AI Technical Summary
Existing modal fusion technology cannot achieve parallel processing of multiple modal data and does not consider the correlation between different modal data at the same time.
An all-modal fusion method based on the encoder-decoder architecture is adopted. By constructing the encoder-decoder model, the full-modal feature vector is obtained, and the model is optimized through the loss function to achieve parallel processing of multi-modal data and intra-moment features. Fusion.
It realizes parallel processing of multi-modal data and intra-moment feature fusion, improves the processing efficiency and effect of the model, and solves the problem of inability to fuse all-modal data at the same time in the existing technology.
Smart Images

Figure CN118656781A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a full-modal fusion method and device based on an encoder-decoder architecture. Background Art
[0002] Modal fusion in deep learning refers to the technology of machines acquiring information from multiple fields such as text, images, voice, video, etc., realizing information conversion and fusion, and thus improving model performance. It is a typical multidisciplinary cross-field. People live in an environment where multiple fields are intertwined. The sounds they hear, the objects they see, the smells they smell, etc. are all modal forms of various fields. In order for deep learning algorithms to understand the world around them more comprehensively and efficiently, it is necessary to give machines the ability to learn and fuse these multi-field signals. Therefore, researchers have begun to focus on how to fuse data from multiple fields to achieve the complementarity of multiple heterogeneous information. For example, research on speech recognition has shown that the visual modality provides information on lip movements and pronunciation of the mouth, including opening and closing, which helps to improve speech recognition performance.
[0003] In machine learning, the more features the model learns, the better the effect. Therefore, integrating multimodal features can make the features learned by the model more complete, which is also in line with human evolution. Humans will integrate multiple modal information in various actions and decisions, such as vision, hearing, smell, etc.
[0004] With the rapid development of information technology, we live in an era of multi-sensory information explosion. Data is no longer limited to a single type, but covers multiple modalities such as images, sounds, texts, and videos. However, existing technologies have problems such as slow processing of modal data and insufficient data mining. In order to solve the above problems, people have proposed full-modal fusion technology, which is a cutting-edge breakthrough in the field of artificial intelligence and is ushering in an unprecedented new era of intelligence. Summary of the invention
[0005] The present invention provides a full modal fusion method and device based on an encoder-decoder architecture to solve the problems in existing modal fusion technical solutions that multiple modal data cannot be processed in parallel at the same time and the correlation between different modal data at the same time is not considered.
[0006] In a first aspect, the present invention provides a full-modal fusion method based on an encoder-decoder architecture, which specifically comprises the following steps:
[0007] Step S1, constructing an encoder-decoder architecture model;
[0008] Step S2: Obtain the full-modal feature vector X, input it into the encoder-decoder architecture model, and form a reconstructed full-modal feature vector
[0009] Step S3: construct a loss function and optimize the encoder-decoder architecture model through the loss function.
[0010] Preferably, in step S1, the encoder-decoder architecture model includes an omnimodal encoder and an omnimodal decoder.
[0011] Preferably, the full-modal encoder comprises a plurality of attention layers. ("plurality" in this application means greater than or equal to 2).
[0012] More preferably, the multiple attention layers are stacked on top of each other.
[0013] Preferably, the omnimodal encoder comprises three learnable linear layers.
[0014] Preferably, the omnimodal decoder comprises one or more linear layers.
[0015] More preferably, the omnimodal decoder can also be constructed through other deep learning models (such as a Transformer model) to increase decoding capabilities.
[0016] Preferably, in step S2, obtaining the full modal feature vector X specifically includes the following steps:
[0017] Step S211, collect full modal data DATA = {DATA1, DATA2, ..., DATA k}, obtain the low-dimensional feature vector Data of the full modal data = {Data1,Data2,...,Data k};
[0018] Step S212: Based on the low-dimensional feature vector Data of the full-modal data, concatenate to form a full-modal feature vector X={X1, X2, ..., X k}.
[0019] Wherein, k is a positive integer.
[0020] Preferably, in step S211, the full modal data DATA includes DATA1, DATA2, ..., DATA k There are k different modal data in total.
[0021] Preferably, in step S211, by using k types of modal data and each type of modal data DATA i The corresponding feature encoder Get dataDATA i The feature vector Data i , specifically expressed as follows:
[0022]
[0023] The "corresponding" specifically means that for DATA i Data, the corresponding modal feature encoder is i∈[1,k], i is a positive integer.
[0024] Preferably, in step S211, Data1, Data2, ..., Data k Represents the eigenvectors of k different modes, Data1,Data2,...,Data k They are all N×D dimensional feature vectors.
[0025] Among them, N represents the time dimension and D represents the data dimension.
[0026] Preferably, in step S212, a full-modal feature vector X is formed based on the full-modal low-dimensional feature vector Data, specifically including forming an N×kD-dimensional full-modal feature vector X by concatenating k N×D-dimensional feature vectors according to the feature dimension.
[0027] Preferably, in step S2, the full-modal feature vector X is input into the encoder-decoder architecture model to form a reconstructed full-modal feature vector The specific steps include:
[0028] Step S221, inputting the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X';
[0029] Step S222: Input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector
[0030] Preferably, in step S221, the full modal feature vector X is input into the full modal encoder to form a full modal feature fusion vector X', which specifically includes the following steps:
[0031] Step S221a: Input the full modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n ;
[0032] Step S221b, through the matrix Q n , matrix K n and the matrix V n , forming a full-modal fusion vector X'.
[0033] Where n∈[1,k], n is a positive integer.
[0034] Wherein, the learnable linear layer and Both are N×kD dimensional matrices.
[0035] Preferably, in step S221a, the matrix Q n , matrix K n and the matrix V n The calculation formula is as follows:
[0036]
[0037] Preferably, in step S221b, the matrix Q n , matrix K n and the matrix V n , the calculation formula for forming the full-modal feature fusion vector X' is as follows:
[0038]
[0039] in, Represents the attention score, which is an N×N dimensional vector, and each row (size is 1×N dimensions) represents the degree of attention of the current moment to all moments.
[0040] Among them, the matrix With the matrix V n Multiplication means that the feature at each moment is obtained by weighted summing the attention score at each moment over the features at all moments.
[0041] Among them, the calculation formula of Softmax is as follows:
[0042]
[0043] Among them, j represents the jth vector, j∈[1,J], j, J are both positive integers.
[0044] Preferably, in step S3, the constructed loss function includes a mean square error loss function, and the calculation formula is as follows:
[0045]
[0046] Preferably, in step S3, optimizing the encoder-decoder architecture model is achieved by minimizing a loss function value.
[0047] In a second aspect, the present invention further provides a full-modal fusion device based on an encoder-decoder architecture, which specifically includes the following modules:
[0048] Model building module, used to build encoder-decoder architecture model;
[0049] The full-modal feature vector processing module is used to obtain the full-modal feature vector X, input the encoder-decoder architecture model, and form a reconstructed full-modal feature vector
[0050] The model optimization module is used to construct a loss function and optimize the encoder-decoder architecture model through the loss function.
[0051] Preferably, in the model construction module, the encoder-decoder architecture model includes a full-modal encoder and a full-modal decoder.
[0052] Preferably, the full-modal encoder comprises a plurality of attention layers. ("plurality" in this application means greater than or equal to 2).
[0053] More preferably, the multiple attention layers are stacked on top of each other.
[0054] Preferably, the omnimodal encoder comprises three learnable linear layers.
[0055] Preferably, the omnimodal decoder comprises one or more linear layers.
[0056] More preferably, the omnimodal decoder can also be constructed through other deep learning models (such as a Transformer model) to increase decoding capabilities.
[0057] Preferably, the full-modal feature vector processing module specifically includes the following submodules:
[0058] A full-modal feature vector acquisition submodule is used to obtain a full-modal feature vector X;
[0059] The full-modal feature vector reconstruction submodule is used to input the full-modal feature vector X into the encoder-decoder architecture model to form a reconstructed full-modal feature vector
[0060] Preferably, the full-modal feature vector acquisition submodule specifically includes the following submodules:
[0061] Full modal data acquisition module, used to collect full modal data DATA = {DATA1, DATA2, ..., DATA k}, obtain the low-dimensional feature vector Data of the full modal data = {Data1,Data2,...,Data k};
[0062] The full-modal feature vector concatenation module is used to concatenate the low-dimensional feature vector Data of the full-modal data to form a full-modal feature vector X = {X1, X2, ..., X k}.
[0063] Preferably, the full modal feature vector reconstruction submodule specifically includes the following submodules:
[0064] A first full-modal feature vector reconstruction module is used to input the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X';
[0065] The second full-modal feature vector reconstruction module is used to input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector
[0066] Preferably, the first submodule of reconstructing the full modal feature vector specifically includes the following units:
[0067] The first unit of the full-modal feature fusion is used to input the full-modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n ;
[0068] The second unit of full-modal feature fusion is used to pass the matrix Q n , matrix K n and the matrix V n , forming the full-modal feature fusion vector X'.
[0069] Where n∈[1,k], n is a positive integer.
[0070] Wherein, the learnable linear layer and Both are N×kD dimensional matrices.
[0071] Preferably, in the first unit of full-modal feature fusion, the matrix Q n , matrix K n and the matrix V n The calculation formula is as follows:
[0072]
[0073] Preferably, in the second unit of the full modality feature fusion, the matrix Q n , matrix K n and the matrix V n , the calculation formula for forming the full-modal fusion vector X' is as follows:
[0074]
[0075] in, Represents the attention score, which is an N×N dimensional vector, and each row (size is 1×N dimensions) represents the degree of attention of the current moment to all moments.
[0076] Among them, the matrix With the matrix V n Multiplication means that the feature at each moment is obtained by weighted summing the attention score at each moment over the features at all moments.
[0077] Among them, the calculation formula of Softmax is as follows:
[0078]
[0079] Among them, j represents the jth vector, j∈[1,J], j, J are both positive integers.
[0080] Preferably, in the model optimization module, the constructed loss function includes a mean square error loss function, and the calculation formula is as follows:
[0081]
[0082] Preferably, in the model optimization module, optimizing the encoder-decoder architecture model is achieved by minimizing the loss function value.
[0083] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a full-modal fusion method based on an encoder-decoder architecture as described in any one of the first aspects of the present application.
[0084] In a fourth aspect, the present invention further provides an electronic device, comprising: a memory storing a computer program; and a processor communicatively connected to the memory, for executing a full-modal fusion method based on an encoder-decoder architecture as described in any one of the first aspects of the present application when the computer program is called.
[0085] Compared with the prior art, the present invention has the following obvious outstanding substantive features and significant advantages:
[0086] The present invention proposes a full-modal fusion method and device based on an encoder-decoder architecture, which solves the problem that the existing modal fusion technology scheme cannot realize parallel processing of multiple modal data and does not consider the correlation between different modal data at the same time. (1) The low-dimensional coding features of the full-modal data are obtained through the feature encoder, which reduces the subsequent calculation amount; (2) The feature coding vectors of the full-modal data are spliced according to the time dimension to obtain the full-modal feature vector at the same time, which solves the problem that the existing scheme cannot handle multi-modal parallelism; (3) The encoder and decoder are trained with the reconstruction of the full-modal input vector as the training goal, and the feature fusion within the same time and between different times is realized during the training process, and the trained full-modal encoder and full-modal decoder are obtained, which solves the problem that the existing technology cannot simultaneously perform full-modal data fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] The accompanying drawings, which constitute part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention. In the accompanying drawings:
[0088] Figure 1 is a flow chart of a full-modal fusion method based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0089] Figure 2 It is a flowchart of obtaining a full-modal feature vector X in a full-modal fusion method based on an encoder-decoder architecture in a preferred embodiment of the present invention;
[0090] Figure 3 It is a flow chart of reconstructing a full-modal vector in a full-modal fusion method based on an encoder-decoder architecture in a preferred embodiment of the present invention;
[0091] Figure 4 Schematic diagram of a full-modal fusion method based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0092] Figure 5 It is a schematic diagram of a process of constructing a full-modal vector in a full-modal fusion method based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0093] Figure 6 It is a schematic diagram of a flow chart of fusion and reconstruction of all-modal vectors in an all-modal fusion method based on an encoder-decoder architecture in a preferred embodiment of the present invention;
[0094] Figure 7 It is a structural schematic diagram of a full-modal fusion device based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0095] Figure 8It is a structural schematic diagram of a full-modal feature vector processing module in a full-modal fusion device based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0096] Fig. 9 It is a structural schematic diagram of a full-modal feature vector acquisition submodule in a full-modal fusion device based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0097] Fig.10 It is a structural schematic diagram of a full-modal feature vector reconstruction submodule in a full-modal fusion device based on an encoder-decoder architecture according to a preferred embodiment of the present invention;
[0098] Fig.11 It is a schematic diagram of the structure of the first submodule for reconstructing an all-modal feature vector in an all-modal fusion device based on an encoder-decoder architecture in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0099] The present invention provides a full-modal fusion method based on an encoder-decoder architecture. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0100] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0101] Embodiment 1:
[0102] like Figure 1-Figure 6 As shown, the full modality fusion method based on the encoder-decoder architecture described in this embodiment specifically includes the following steps:
[0103] Step S1: construct an encoder-decoder architecture model.
[0104] Optionally, in step S1, the encoder-decoder architecture model includes an omnimodal encoder and an omnimodal decoder.
[0105] Optionally, the full-modal encoder includes multiple attention layers. ("Multiple" in this application means greater than or equal to 2).
[0106] Wherein, the multiple attention layers are stacked on each other.
[0107] Wherein, the omnimodal encoder includes three learnable linear layers.
[0108] Wherein, the omnimodal decoder comprises one or more linear layers.
[0109] Optionally, the omnimodal decoder can also be constructed through other deep learning models (such as a Transformer model) to increase decoding capabilities.
[0110] Step S2: Obtain the full-modal feature vector X, input it into the encoder-decoder architecture model, and form a reconstructed full-modal feature vector
[0111] Optionally, in step S2, obtaining the full modal feature vector X specifically includes the following steps S211-S212.
[0112] Step S211, collect full modal data DATA = {DATA1, DATA2, ..., DATA k}, obtain the low-dimensional feature vector Data of the full modal data = {Data1,Data2,...,Data k}.
[0113] Optionally, in step S211, the full modal data DATA includes DATA1, DATA2, ..., DATA k There are k different modal data in total.
[0114] Optionally, in step S211, by using k types of modal data and each type of modal data DATA i The corresponding feature encoder Get dataDATA i The feature vector Data i , specifically expressed as follows:
[0115]
[0116] The "corresponding" specifically means that for DATA i Data, the corresponding modal feature encoder is i∈[1,k], i is a positive integer.
[0117] Among them, in step S211, Data1, Data2, ..., Data kRepresents the eigenvectors of k different modes, Data1,Data2,...,Data k They are all N×D dimensional feature vectors.
[0118] Among them, N represents the time dimension and D represents the data dimension.
[0119] Step S212: Based on the low-dimensional feature vector Data of the full-modal data, concatenate to form a full-modal feature vector X={X1, X2, ..., X k}.
[0120] Wherein, k is a positive integer.
[0121] Optionally, in step S212, a full-modal feature vector X is formed based on the full-modal low-dimensional feature vector Data, specifically including forming an N×kD-dimensional full-modal feature vector X by concatenating k N×D-dimensional feature vectors according to the feature dimension.
[0122] Optionally, in step S2, the full-modal feature vector X is input into the encoder-decoder architecture model to form a reconstructed full-modal feature vector Specifically including step S221-step S222.
[0123] Step S221: input the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X'.
[0124] Optionally, in step S221, the full modal feature vector X is input into the full modal encoder to form a full modal feature fusion vector X', which specifically includes steps S221a-S221b.
[0125] Step S221a: Input the full modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n ;
[0126] Optionally, in step S221a, the matrix Q n , matrix K n and the matrix V n The calculation formula is as follows:
[0127]
[0128] Step S221b, through the matrix Q n , matrix K n and the matrix V n , forming a full-modal fusion vector X'.
[0129] Where n∈[1,k], n is a positive integer.
[0130] Wherein, the learnable linear layer and Both are N×kD dimensional matrices.
[0131] Optionally, in step S221b, the matrix Q n , matrix K n and the matrix V n , the calculation formula for forming the full-modal feature fusion vector X' is as follows:
[0132]
[0133] in, Represents the attention score, which is an N×N dimensional vector, and each row (size is 1×N dimensions) represents the degree of attention of the current moment to all moments.
[0134] Among them, the matrix With the matrix V n Multiplication means that the feature at each moment is obtained by weighted summing the attention score at each moment over the features at all moments.
[0135] Among them, the calculation formula of Softmax is as follows:
[0136]
[0137] Among them, j represents the jth vector, j∈[1,J], j, J are both positive integers.
[0138] Step S222: Input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector
[0139] Step S3: construct a loss function and optimize the encoder-decoder architecture model through the loss function.
[0140] Optionally, in step S3, the constructed loss function includes a mean square error loss function, and the calculation formula is as follows:
[0141]
[0142] Optionally, in step S3, optimizing the encoder-decoder architecture model is achieved by minimizing a loss function value.
[0143] like Figure 5 As shown, a schematic diagram of the process of constructing a full-modal vector in a full-modal fusion method based on an encoder-decoder architecture in a preferred embodiment of the present invention.
[0144] Take data in three modalities: text data, image data, and audio data as examples.
[0145] The text data, image data and audio data are connected to the text encoder, image encoder and audio encoder respectively, and output the text feature vector 1, image feature vector 2 and audio feature vector 3 respectively.
[0146] Among them, the text feature vector 1, the image feature vector 2 and the audio feature vector 3 are all matrices of size N×D.
[0147] The text feature vector 1, the image feature vector 2 and the audio feature vector 3 are concatenated according to the feature dimensions to form a full-modal vector X4.
[0148] like Figure 6 As shown, it is a schematic diagram of the process of fusion and reconstruction of full-modal vectors in a full-modal fusion method based on an encoder-decoder architecture according to a preferred embodiment of the present invention.
[0149] The full-modal vector X4 is input into the full-modal encoder, and the full-modal vector X4 is fused to obtain the full-modal fusion vector X'5.
[0150] Then the full-modal fusion vector X'5 is input into the full-modal decoder, and the full-modal fusion vector X'5 is reconstructed to obtain the reconstructed full-modal vector Embodiment 2:
[0151] like Figure 7-Figure 11 As shown, the full-modal fusion device based on the encoder-decoder architecture described in this embodiment specifically includes the following modules.
[0152] Model building module for building encoder-decoder architecture models.
[0153] Optionally, in the model building module, the encoder-decoder architecture model includes an omnimodal encoder and an omnimodal decoder.
[0154] The full-modal encoder includes multiple attention layers. (The "multiple" in this application means greater than or equal to 2).
[0155] Wherein, the multiple attention layers are stacked on each other.
[0156] Wherein, the omnimodal encoder includes three learnable linear layers.
[0157] Wherein, the omnimodal decoder comprises one or more linear layers.
[0158] Optionally, the omnimodal decoder can also be constructed through other deep learning models (such as a Transformer model) to increase decoding capabilities.
[0159] The full-modal feature vector processing module is used to obtain the full-modal feature vector X, input the encoder-decoder architecture model, and form a reconstructed full-modal feature vector
[0160] Optionally, the full-modal feature vector processing module specifically includes a full-modal feature vector acquisition submodule and a full-modal feature vector reconstruction submodule.
[0161] Among them, the full-modal feature vector acquisition submodule is used to obtain the full-modal feature vector X.
[0162] Optionally, the full-modal feature vector acquisition submodule specifically includes a full-modal data acquisition submodule and a full-modal feature vector splicing submodule.
[0163] Full modal data acquisition module, used to collect full modal data DATA = {DATA1, DATA2, ..., DATA k}, obtain the low-dimensional feature vector Data of the full modal data = {Data1,Data2,...,Data k}.
[0164] The full-modal feature vector concatenation module is used to concatenate the low-dimensional feature vector Data of the full-modal data to form a full-modal feature vector X = {X1, X2, ..., X k}.
[0165] The full-modal feature vector reconstruction submodule is used to input the full-modal feature vector X into the encoder-decoder architecture model to form a reconstructed full-modal feature vector
[0166] Optionally, the full-modal feature vector reconstruction submodule specifically includes a full-modal feature vector reconstruction first submodule and a full-modal feature vector reconstruction second submodule.
[0167] The full-modal feature vector reconstruction first submodule is used to input the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X'.
[0168] Optionally, the first submodule of the full-modal feature vector reconstruction specifically includes a first full-modal feature fusion unit and a second full-modal feature fusion unit.
[0169] Among them, the first unit of full-modal feature fusion is used to input the full-modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n.
[0170] Among them, the second unit of full-modal feature fusion is used to pass the matrix Q n , matrix K n and the matrix V n , forming the full-modal feature fusion vector X'.
[0171] Where n∈[1,k], n is a positive integer.
[0172] Wherein, the learnable linear layer and Both are N×kD dimensional matrices.
[0173] Optionally, in the first unit of full-modal feature fusion, the matrix Q n , matrix K n and the matrix V n The calculation formula is as follows.
[0174]
[0175] Optionally, the full modality feature fusion is performed in the second unit by the matrix Q n , matrix K n and the matrix V n , the calculation formula for forming the full modal fusion vector X' is as follows.
[0176]
[0177] in, Represents the attention score, which is an N×N dimensional vector, and each row (size is 1×N dimensions) represents the degree of attention of the current moment to all moments.
[0178] Among them, the matrix With the matrix V n Multiplication means that the feature at each moment is obtained by weighted summing the attention score at each moment over the features at all moments.
[0179] Among them, the calculation formula of Softmax is as follows.
[0180]
[0181] Among them, j represents the jth vector, j∈[1,J], j, J are both positive integers.
[0182] The full-modal feature vector reconstruction second submodule is used to input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector
[0183] The model optimization module is used to construct a loss function and optimize the encoder-decoder architecture model through the loss function.
[0184] Optionally, in the model optimization module, the constructed loss function includes a mean square error loss function, and the calculation formula is as follows.
[0185]
[0186] Optionally, in the model optimization module, optimizing the encoder-decoder architecture model is achieved by minimizing the loss function value.
[0187] Embodiment 3:
[0188] The present invention can select some steps to be applied to the field of intelligent driving.
[0189] The partial technical solutions of the present invention are applied to the intelligent driving system, which specifically includes the following steps:
[0190] Step 1 (data collection phase): The sensor system installed on the vehicle will continuously collect data about the surrounding environment, such as images taken by the camera, obstacle positions detected by the radar, terrain scanned by the lidar, etc.
[0191] Step 2 (data preprocessing): the collected data is transferred to the full modal model for preprocessing. In this stage, the feature encoder is used to encode the data collected by each sensor to obtain a low-dimensional feature vector to reduce the complexity of subsequent calculations.
[0192] Step 3 (feature fusion and omnimodal encoding) combines the coded features of each sensor in the time dimension to form a omnimodal feature vector at the same time. At the same time, these omnimodal feature vectors are encoded using a omnimodal encoder to obtain a higher level of abstract representation.
[0193] Step 4 (decision making and control) inputs the encoded full-modal feature vector into the decision module of the intelligent driving system to perform tasks such as environment understanding, path planning, and behavior prediction. The system will make corresponding driving decisions based on this information, such as acceleration, deceleration, steering, etc.
[0194] Step 5 (Real-time Monitoring and Feedback): The intelligent driving system continuously monitors the environment around the vehicle and updates its decisions based on real-time conditions. Throughout the driving process, the system continuously collects new data, re-encodes and integrates features to ensure the accuracy and safety of driving decisions.
[0195] Through this practical application process, the invention can effectively process multimodal data and perform modal fusion at the same time, thereby improving the performance and safety of the intelligent driving system.
[0196] The specific embodiments of the present invention are described in detail above, but they are only examples, and the present invention is not limited to the specific embodiments described above.
[0197] For those skilled in the art, any equivalent modification and substitution of the present invention also falls within the scope of the present invention. Therefore, any equivalent transformation and modification made without departing from the spirit and scope of the present invention should be included in the scope of the present invention.
Claims
1. A full-modal fusion method based on encoder-decoder architecture, It is characterized in that The specific steps include: Step S1, constructing an encoder-decoder architecture model; Step S2: Obtain the full-modal feature vector X, input it into the encoder-decoder architecture model, and form a reconstructed full-modal feature vector Step S3: construct a loss function and optimize the encoder-decoder architecture model through the loss function.
2. The omnimodal fusion method based on encoder-decoder architecture according to claim 1, It is characterized in that In step S1, the encoder-decoder architecture model includes a full-modal encoder and a full-modal decoder.
3. The omnimodal fusion method based on encoder-decoder architecture according to claim 1, It is characterized in that In step S2, the full modal eigenvector X is obtained, which specifically includes the following steps: Step S211, collect full modal data DATA = {DATA 1 ,DATA 2 ,...,DATA k }, obtain the low-dimensional feature vector Data of the full modal data = {Data 1 ,Data 2 ,...,Data k }; Step S212: Based on the low-dimensional feature vector Data of the full-modal data, concatenate to form a full-modal feature vector X={X 1 ,X 2 ,...,X k }; Wherein, k is a positive integer.
4. The omnimodal fusion method based on encoder-decoder architecture according to claim 3, It is characterized in that In step S211, the full modal data DATA includes DATA 1 ,DATA 2 ,...,DATA k There are k different modal data in total.
5. The omnimodal fusion method based on encoder-decoder architecture according to claim 3, It is characterized in that In step S211, the k types of modal data are combined with each modal data DATA i The corresponding feature encoder E DATAi , get data DATA i The feature vector Data i , specifically expressed as follows: Among them, i∈[1,k], i is a positive integer.
6. The omnimodal fusion method based on encoder-decoder architecture according to claim 3, It is characterized in that In step S211, Data 1 ,Data 2 ,...,Data k Represents the feature vectors of k different modes, Data 1 ,Data 2 ,...,Data k They are all N×D-dimensional feature vectors; Among them, N represents the time dimension and D represents the data dimension.
7. The omnimodal fusion method based on encoder-decoder architecture according to claim 3, It is characterized in that In step S212, a full-modal feature vector X is formed based on the full-modal low-dimensional feature vector Data, specifically including forming an N×kD-dimensional full-modal feature vector X by concatenating k N×D-dimensional feature vectors according to the feature dimension.
8. A full-modal fusion method based on an encoder-decoder architecture according to claim 1, It is characterized in that In step S2, the full-modal feature vector X is input into the encoder-decoder architecture model to form a reconstructed full-modal feature vector The specific steps include: Step S221, inputting the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X'; Step S222: Input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector 9. A full-modal fusion method based on an encoder-decoder architecture according to claim 8, It is characterized in that In step S221, the full-modal feature vector X is input into the full-modal encoder to form a full-modal feature fusion vector X', which specifically includes the following steps: Step S221a: Input the full modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n ; Step S221b, through the matrix Q n , matrix K n and the matrix V n , forming a full-modal fusion vector X'; Where n∈[1,k], n is a positive integer, and the learnable linear layer and Both are N×kD dimensional matrices.
10. A full-modal fusion method based on an encoder-decoder architecture according to claim 9, It is characterized in that In step S221a, the matrix Q n , matrix K n and the matrix V n The calculation formula is as follows:
11. A full-modal fusion method based on an encoder-decoder architecture according to claim 9, It is characterized in that In step S221b, the matrix Q n , matrix K n and the matrix V n , the calculation formula for forming the full-modal feature fusion vector X' is as follows: in, Represents the attention score, which is an N×N dimensional vector, each row of which (size is 1×N dimensions) represents the degree of attention of the current moment to all moments; Among them, the matrix With the matrix V n Multiplication means that the feature at each moment is obtained by weighted summing the attention score at each moment over the features at all moments; Among them, the calculation formula of Softmax is as follows: Among them, j represents the jth vector, j∈[1,J], j, J are both positive integers.
12. A full-modal fusion method based on an encoder-decoder architecture according to claim 1, It is characterized in that In step S3, the constructed loss function includes a mean square error loss function, and the calculation formula is as follows: Wherein, in step S3, optimizing the encoder-decoder architecture model is achieved by minimizing the loss function value.
13. A full-modal fusion device based on encoder-decoder architecture, It is characterized in that The modules include: Model building module, used to build encoder-decoder architecture model; The full-modal feature vector processing module is used to obtain the full-modal feature vector X, input it into the encoder-decoder architecture model, and form a reconstructed full-modal feature vector The model optimization module is used to construct a loss function and optimize the encoder-decoder architecture model through the loss function.
14. A full-modal fusion device based on the encoder-decoder architecture of claim 13, It is characterized in that The full-modal feature vector processing module specifically includes the following submodules: A full-modal feature vector acquisition submodule is used to obtain a full-modal feature vector X; The full-modal feature vector reconstruction submodule is used to input the full-modal feature vector X into the encoder-decoder architecture model to form a reconstructed full-modal feature vector 15. A full-modal fusion device based on the encoder-decoder architecture of claim 14, It is characterized in that The full-modal feature vector acquisition submodule specifically includes the following submodules: Full modal data acquisition module, used to collect full modal data DATA = {DATA 1 ,DATA 2 ,...,DATA k }, obtain the low-dimensional feature vector Data of the full modal data = {Data 1 ,Data 2 ,...,Data k }; The full-modal feature vector concatenation module is used to concatenate the low-dimensional feature vector Data of the full-modal data to form a full-modal feature vector X = {X 1 ,X 2 ,...,X k }.
16. A full-modal fusion device based on the encoder-decoder architecture of claim 14, It is characterized in that The full-modal feature vector reconstruction submodule specifically includes the following submodules: A first full-modal feature vector reconstruction module is used to input the full-modal feature vector X into the full-modal encoder to form a full-modal feature fusion vector X'; The second full-modal feature vector reconstruction module is used to input the full-modal feature fusion vector X' into the full-modal decoder to form a reconstructed full-modal feature vector 17. A full-modal fusion device based on the encoder-decoder architecture of claim 15, It is characterized in that The first submodule of full modal feature vector reconstruction includes the following units: The first unit of the full-modal feature fusion is used to input the full-modal feature vector X into three learnable linear layers and Forming the matrix Q n , matrix K n and the matrix V n ; The second unit of full-modal feature fusion is used to pass the matrix Q n , matrix K n and the matrix V n , forming a full-modal feature fusion vector X'.
18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements a full-modal fusion method based on an encoder-decoder architecture as described in any one of claims 1-12.
19. An electronic device, It is characterized in that It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a full-modal fusion method based on an encoder-decoder architecture as described in any one of claims 1 to 12.
Citation Information
Cited By
Tranform architecture-based emotion category recognition method, device and equipment and medium
CN119622492A
