Visual dialogue method, device and electronic device based on artificial intelligence
By obtaining the channel information of pictures and dialogue history in visual dialogue technology, processing and fusion, and generating accurate dialogue answers, the problem of reasoning deviation in the existing technology is solved, and the accuracy of dialogue answers and user experience are improved.
Patent Information
- Application Number
- CN201911294260.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-16
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-12-16
AI Technical Summary
The reasoning process in existing visual dialogue technology can easily deviate from the original dialogue question, resulting in dialogue answers that do not correspond to the question and poor accuracy.
By obtaining channel information in pictures and conversation history, tracking and positioning processing are performed, channel features are generated, and channel features are fused with pictures and conversation questions to generate fusion features to predict conversation answers.
Improved the matching between dialogue answers and dialogue questions, improving the accuracy of dialogue answers and user experience.
Smart Images

Figure CN112905754B
Abstract
Description
Technical Field
[0001] The present invention relates to artificial intelligence technology, and in particular to a visual dialogue method, device, electronic device and storage medium based on artificial intelligence. Background Art
[0002] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
[0003] Visual dialogue (VD) is an important branch of artificial intelligence. It integrates machine vision, natural language processing and dialogue systems. Its main goal is to teach machines how to communicate visual data with humans using natural language. However, in the visual dialogue solutions provided by related technologies, the reasoning process is likely to deviate from the representation of the original dialogue question, resulting in the dialogue answer obtained by reasoning not corresponding to the dialogue question, and the accuracy of visual dialogue is poor. Summary of the invention
[0004] The embodiments of the present invention provide a visual dialogue method, device, electronic device and storage medium based on artificial intelligence, which can improve the accuracy of the dialogue answers obtained and enhance the user experience of visual dialogue.
[0005] The technical solution of the embodiment of the present invention is achieved as follows:
[0006] An embodiment of the present invention provides a visual dialogue method based on artificial intelligence, comprising:
[0007] Get the conversation questions and conversation history corresponding to the picture;
[0008] determining at least one of the picture and the conversation history as channel information;
[0009] According to the dialogue question and the channel information, at least one of tracking processing and positioning processing is performed to obtain corresponding channel features;
[0010] According to the channel feature, the image, the conversation question and the conversation history are fused to obtain a fusion feature;
[0011] Prediction processing is performed based on the fusion features to obtain a dialogue answer corresponding to the dialogue question.
[0012] An embodiment of the present invention provides a visual dialogue device based on artificial intelligence, comprising:
[0013] An acquisition module is used to obtain the dialogue questions and dialogue history corresponding to the picture;
[0014] a determination module, configured to determine at least one of the picture and the conversation history as channel information;
[0015] A channel processing module, configured to perform at least one of tracking processing and positioning processing according to the dialogue question and the channel information to obtain corresponding channel features;
[0016] A fusion module, configured to fuse the image, the conversation question and the conversation history according to the channel feature to obtain a fusion feature;
[0017] The prediction module is used to perform prediction processing based on the fusion features to obtain a dialogue answer corresponding to the dialogue question.
[0018] An embodiment of the present invention provides an electronic device, including:
[0019] A memory for storing executable instructions;
[0020] The processor is used to implement the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention when executing the executable instructions stored in the memory.
[0021] An embodiment of the present invention provides a storage medium storing executable instructions for causing a processor to execute the instructions to implement the artificial intelligence-based visual dialogue method provided by the embodiment of the present invention.
[0022] The embodiments of the present invention have the following beneficial effects:
[0023] The embodiments of the present invention obtain channel features by performing at least one of tracking processing and positioning processing, thereby deepening the multimodal representation of the original dialogue question, and determining the dialogue answer by combining the channel features, pictures, dialogue questions and dialogue history, thereby improving the matching degree between the obtained dialogue answer and the dialogue question, that is, improving the accuracy of the dialogue answer and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is an optional architecture diagram of an artificial intelligence-based visual dialogue system provided in an embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of an optional architecture of a server provided in an embodiment of the present invention;
[0026] Figure 3This is an optional architecture diagram of an artificial intelligence-based visual dialogue device provided in an embodiment of the present invention;
[0027] Figure 4A This is an optional flowchart of the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention;
[0028] Figure 4B This is an optional flowchart of the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention;
[0029] Figure 4C is an optional flow chart of processing in a dual-channel mode provided by an embodiment of the present invention;
[0030] Figure 4D This is an optional flowchart of the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention;
[0031] Figure 5 is an optional architecture diagram of an artificial intelligence-based visual dialogue system provided in an embodiment of the present invention;
[0032] Figure 6 is an optional schematic diagram of dual-channel multi-step reasoning provided by an embodiment of the present invention;
[0033] Figure 7 It is a schematic diagram of an optional architecture of a decoder provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0035] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0036] In the following description, the terms "first\second" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0038] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0039] 1) Modality: refers to the source or form of information. For example, if the media of information includes voice, video, and text, each medium of information can be regarded as a modality. It is worth noting that multimodality in this article refers to at least two modalities.
[0040] 2) Conversational questions: Questions asked in response to an image in a visual conversation, such as “What color is the boy’s hair in the picture?”. Conversational questions can be asked by the user or automatically generated.
[0041] 3) Dialogue answers: Answers to dialogue questions in visual dialogues based on the meaning of the pictures.
[0042] 4) Dialog History: includes picture description, historical dialogue questions and historical dialogue answers. Picture description refers to the annotated description of the picture, such as "a young boy is playing tennis on the court."
[0043] 5) Channel: refers to the channel for answer reasoning in visual dialogue. In this paper, the channel includes the visual information channel and the dialogue history channel. In addition, in the single-channel mode, only tracking processing or positioning processing is performed, and in the dual-channel mode, tracking processing and positioning processing are performed simultaneously.
[0044] 6) Multi-Layer Perception (MLP) model: a feed-forward artificial neural network model used to map multiple input features into a single feature.
[0045] 7) Convolutional Neural Network (CNN) model: A feedforward neural network model with deep structure and convolutional computing, which has the ability to learn representations and can perform translation-invariant classification of input information according to its hierarchical structure.
[0046] 8) Recurrent Neural Network (RNN) model: a type of recurrent neural network model that takes sequence data as input, performs recursion in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain.
[0047] 9) Hidden state: The RNN model allows information to be persisted and retains memory of the current state. The retained state exists in the form of hidden variables, which is the hidden state, usually written as h t .
[0048] Embodiments of the present invention provide a visual dialogue method, device, electronic device, and storage medium based on artificial intelligence, which can improve the accuracy of dialogue answers and enhance the user experience of visual dialogue. The following describes an exemplary application of the electronic device provided by the embodiment of the present invention.
[0049] See also Figure 1 , Figure 1 It is an optional architecture diagram of the artificial intelligence-based visual dialogue system 100 provided in an embodiment of the present invention. To support an artificial intelligence-based visual dialogue application, the terminal device 400 (the terminal device 400-1 and the terminal device 400-2 are shown as examples) is connected to the server 200 via the network 300, and the server 200 is connected to the database 500, wherein the network 300 can be a wide area network or a local area network, or a combination of the two.
[0050] The terminal device 400 is used to display pictures on the graphical interface 410 (graphical interface 410-1 and graphical interface 410-2 are shown as examples); the terminal device 400 is also used to obtain a conversation question input by a user based on the picture, and send the conversation question to the server 200; the server 200 is used to obtain a conversation history corresponding to the picture from the database 500, and determine at least one of the picture and the conversation history as channel information; based on the conversation question and the channel information, perform at least one of tracking processing and positioning processing to obtain corresponding channel features; based on the channel features, fuse the picture, the conversation question and the conversation history to obtain a fusion feature; based on the fusion feature, perform prediction processing to obtain a conversation answer corresponding to the conversation question, and send the conversation answer to the terminal device 400; the terminal device 400 is also used to display the conversation answer on the graphical interface 410.
[0051] It is worth noting that the picture displayed by the terminal device 400 can be a picture obtained by requesting the server 200 in real time, or it can be a picture requested in advance from the server 200 and cached locally on the terminal device 400. The server 200 can obtain the corresponding conversation history from the database 500 based on information such as the address or identification of the picture, wherein the database 500 stores the index relationship between the picture and the conversation history.
[0052] The following is a description of exemplary applications of the electronic device provided by the embodiment of the present invention. The electronic device can be implemented as various types of terminal devices such as a laptop computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), and can also be implemented as a server. The following description is made by taking the electronic device as a server as an example.
[0053] See also Figure 2 , Figure 2 The server 200 provided in the embodiment of the present invention (for example, it may be Figure 1 The server 200 shown in FIG. Figure 2 The server 200 shown includes: at least one processor 210, a memory 240 and at least one network interface 220. The various components in the server 200 are coupled together via a bus system 230. It is understood that the bus system 230 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 230 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 230 is not described in detail. Figure 2 Various buses are labeled as bus system 230 .
[0054] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0055] The memory 240 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 240 may optionally include one or more storage devices that are physically remote from the processor 210.
[0056] The memory 240 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 240 described in the embodiment of the present invention is intended to include any suitable type of memory.
[0057] In some embodiments, memory 240 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0058] Operating system 241, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0059] The network communication module 242 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).
[0060] In some embodiments, the artificial intelligence-based visual dialogue device provided in the embodiments of the present invention can be implemented in software. Figure 2 The visual dialogue device 243 based on artificial intelligence stored in the memory 240 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: an acquisition module 2431, a determination module 2432, a channel processing module 2433, a fusion module 2434 and a prediction module 2435. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0061] In other embodiments, the artificial intelligence-based visual dialogue device provided by the embodiments of the present invention may be implemented in hardware. As an example, the artificial intelligence-based visual dialogue device provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the artificial intelligence-based visual dialogue method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor may adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0062] The artificial intelligence-based visual dialogue method provided in the embodiment of the present invention can be executed by the above-mentioned server, or by a terminal device (for example, Figure 1 The process may be executed by the terminal device 400-1 and the terminal device 400-2 as shown, or may be executed jointly by the server and the terminal device.
[0063] The following will describe the process of implementing an artificial intelligence-based visual dialogue method in an electronic device by embedding an artificial intelligence-based visual dialogue device in the electronic device in combination with the exemplary applications and structures of the electronic device described above.
[0064] See also Figure 3 and Figure 4A , Figure 3 is an optional architecture diagram of the artificial intelligence-based visual dialogue device 243 provided in an embodiment of the present invention, showing the process of performing visual dialogue through a series of modules. Figure 4A is a flowchart of a visual dialogue method based on artificial intelligence provided by an embodiment of the present invention, which will be combined with Figure 3 right Figure 4A The steps shown are explained.
[0065] In step 101, the dialogue question and dialogue history corresponding to the picture are obtained.
[0066] As an example, see Figure 3 In the acquisition module 2431, the dialogue question input by the user according to the picture is obtained, and the dialogue history corresponding to the picture is obtained from the database. Of course, this does not constitute a limitation on the embodiment of the present invention. For example, the dialogue question can also be automatically generated. It is worth noting that the dialogue history includes the annotated picture description, the historical dialogue question and the historical dialogue answer.
[0067] In step 102, at least one of the picture and the conversation history is determined as channel information.
[0068] As an example, see Figure 3 In the determination module 2432, at least one of the picture and the conversation history is determined as channel information, and different channel modes are applied to perform answer reasoning according to the different contents included in the channel information.
[0069] In step 103, at least one of tracking processing and positioning processing is performed according to the dialogue question and the channel information to obtain corresponding channel features.
[0070] The channels of the embodiment of the present invention include a visual information channel and a conversation history channel, wherein, in the single-channel mode, only the visual information channel or the conversation history channel is applied, and when the visual information channel is applied, only tracking processing is performed, and when the conversation history channel is applied, only positioning processing is performed; in the dual-channel mode, the visual information channel and the conversation history channel are applied at the same time, and at least tracking processing is performed in the visual information channel, and at least positioning processing is performed in the conversation history channel. Through tracking processing and positioning processing, the connection between conversation problems and channel information can be effectively captured, and the specific processing method is described in detail later. After completing the corresponding processing, the output of the single channel or dual channel is determined as the channel feature corresponding to the image, and the channel feature can be in vector form.
[0071] In step 104, the image, the conversation question and the conversation history are fused according to the channel features to obtain fused features.
[0072] Here, the RNN model can be initialized according to the obtained channel features, and the image, dialogue question and dialogue history can be fused according to the RNN model to obtain fused features. The specific content will be explained in detail later.
[0073] In step 105, prediction processing is performed based on the fused features to obtain a dialogue answer corresponding to the dialogue question.
[0074] Here, prediction processing is performed based on the fusion features to obtain an accurate dialogue answer corresponding to the dialogue question, and the dialogue answer is output. The embodiment of the present invention does not limit the specific output method. For example, the dialogue answer is presented on the front-end interface, or the dialogue answer is output in the form of voice.
[0075] Through the embodiments of the invention Figure 4A It can be seen from the above exemplary implementation that the embodiments of the present invention capture the connection between dialogue questions and channel information through at least one of tracking processing and positioning processing, and through subsequent fusion processing, make the answer reasoning process fit the original dialogue question, thereby improving the accuracy of the obtained dialogue answers and enhancing the user experience. It is suitable for application scenarios such as picture-based dialogues and chats.
[0076] In some embodiments, see Figure 4B , Figure 4B is an optional flow chart of the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention. Figure 4A The illustrated step 103 may be implemented by any one of steps 201 to 203, and will be described in conjunction with each step.
[0077] In step 201, single channel tracking processing is performed according to the dialogue question and channel information to obtain visual channel features.
[0078] As an example, see Figure 3 In the channel processing module 2433, a single channel mode including only the visual information channel may be applied to perform answer reasoning. Specifically, the channel information includes pictures, and in the single channel mode, tracking processing is performed based on the dialogue questions and pictures to obtain visual channel features.
[0079] In some embodiments, the above-mentioned single-channel tracking processing based on the dialogue question and channel information can be implemented in the following manner to obtain the visual channel feature: enhance the question feature corresponding to the dialogue question and the image feature corresponding to the image to obtain the attention weight; normalize the attention weight; multiply the normalized attention weight and the image feature to obtain the jth updated question feature; iterate the value of j until the Jth updated question feature is obtained, and determine the Jth updated question feature as the visual channel feature; wherein the value of j is 1, ...J, and J is an integer greater than 0.
[0080] For ease of processing, we first extract features from the dialogue questions to obtain question features, and extract features from the pictures to obtain picture features. In the process of tracking, feature enhancement is achieved through the attention mechanism. Specifically, the question features are weighted by the first MLP model to obtain a first weighted result, and the picture features are weighted by the second MLP model to obtain a second weighted result. The first weighted result and the second weighted result are then dot-producted, and the result of the dot-product operation is determined as the attention weight. The first MLP model corresponds to the question features, and the second MLP model corresponds to the picture features. The MLP model in this article can be a two-layer MLP model, and of course it can also be an MLP model with other layers.
[0081] Then, the attention weights are normalized, for example, by a softmax function. The normalized attention weights are multiplied by the image features to obtain the jth update question feature, which reflects the connection between the original dialogue question and the image. The value of j is iterated until the Jth update question feature is obtained. For ease of distinction, the Jth update question feature is named the visual channel feature as the output of the visual information channel, where the value of j is an integer from 1 to J, and j starts at 1, and J is an integer greater than 0, which can be pre-set.
[0082] It is worth noting that when only the visual information channel is applied, the tracking process can be performed once or at least twice. For the latter, the question feature input for the next tracking process is the updated question feature output by the previous tracking process. For example, when the first tracking process is performed, the updated question feature 1 is output, then the updated question feature 1 and the image feature are determined as the input for the second tracking process. In addition, the product processing in this article can apply the Hadamard product, and of course other product processing methods can also be applied. Through the above-mentioned tracking processing method, it is possible to combine the connection between the dialogue question and the image to generate a more accurate updated question feature and improve the accuracy of answer reasoning.
[0083] In step 202, single channel positioning processing is performed according to the dialogue question and channel information to obtain dialogue history channel features.
[0084] As an example, see Figure 3 In the channel processing module 2433, a single channel mode including only the dialogue history channel may also be applied to perform answer reasoning. Specifically, the channel information includes the dialogue history, and positioning processing is performed according to the dialogue question and the dialogue history in the single channel mode to obtain the dialogue history channel feature.
[0085] In some embodiments, the above-mentioned single-channel positioning processing based on the dialogue question and channel information can be implemented in the following manner to obtain the dialogue history channel feature: enhance the question feature of the dialogue question and the dialogue history feature corresponding to the dialogue history to obtain the attention weight; normalize the attention weight; multiply the normalized attention weight with the dialogue history feature to obtain the intermediate dialogue history feature; activate the intermediate dialogue history feature, and regularize the result of the activation processing together with the image description feature in the dialogue history feature to obtain the rth updated question feature; iterate the value of r until the Rth updated question feature is obtained, and determine the Rth updated question feature as the dialogue history channel feature; wherein the value of r is 1, ...R, and R is an integer greater than 0.
[0086] For ease of processing, we first extract features from the conversation question to obtain question features, and extract features from the conversation history to obtain conversation history features. In the positioning process, we first enhance the question features and conversation history features to obtain attention weights. The enhancement method is the same as above and will not be repeated here. We normalize the attention weights, for example, by using a softmax function, and then multiply the normalized attention weights by the conversation history features to obtain intermediate conversation history features.
[0087] After the intermediate dialogue history features are activated, the activation result is added to the image description features in the dialogue history features, and the added result is regularized to obtain the rth update problem feature. It is worth noting that the activation processing here can be implemented by the Rectified Linear Unit (ReLU) function, and of course it can also be implemented by other activation functions such as the tanh function or the LeakReLU function, and the regularization processing can be implemented by the LayerNormalization method.
[0088] Iterate the value of r until the Rth updated problem feature is obtained. For the sake of distinction, the Rth updated problem feature is named the dialogue history channel feature as the output of the dialogue history channel, where r is an integer from 1 to R, and r starts at 1, R is an integer greater than 0, and R can be pre-set according to the actual application scenario. In the case of applying only the dialogue history channel, one positioning process can be performed, or at least two positioning processes can be performed. For the latter, the problem feature input for the next positioning process is the updated problem feature output by the previous positioning process. For example, when performing the first positioning process, the updated problem feature 1 is output, and the updated problem feature 1 and the dialogue history feature are determined as the input of the second positioning process. In the above manner, the problem feature is updated in combination with the dialogue history feature, and the connection between the dialogue history channel feature and the dialogue history feature is deepened.
[0089] In step 203, dual-channel tracking processing is performed according to the dialogue question and the channel information to obtain visual channel features, dual-channel positioning processing is performed according to the dialogue question and the channel information to obtain dialogue history channel features, and multimodal fusion processing is performed on the visual channel features and the dialogue history channel features to obtain multimodal channel features.
[0090] As an example, see Figure 3 In the channel processing module 2433, a dual-channel mode can also be applied to answer reasoning, that is, a visual information channel and a conversation history channel are applied. Specifically, the channel information includes pictures and conversation history. In the dual-channel mode, tracking processing is performed in the visual information channel according to the conversation questions and channel information to obtain visual channel features; positioning processing is performed in the conversation history channel according to the conversation questions and channel information to obtain conversation history channel features. Then, multimodal fusion processing is performed on the visual channel features and the conversation history channel features to obtain multimodal channel features.
[0091] In some embodiments, the above-mentioned multimodal fusion processing of visual channel features and dialogue history channel features to obtain multimodal channel features can be achieved in the following manner: enhancing the question features and visual channel features corresponding to the dialogue questions to obtain a first attention weight; enhancing the question features and dialogue history channel features corresponding to the dialogue questions to obtain a second attention weight; concatenating the first attention weight and the second attention weight, and activating the result of the concatenation to obtain a multimodal channel feature.
[0092] The question features and visual channel features corresponding to the dialogue question are enhanced to obtain the first attention weight. Specifically, the question features are weighted by the first MLP model corresponding to the question features to obtain the first weighted result. At the same time, the visual channel features are weighted by the second MLP model corresponding to the visual channel features to obtain the second weighted result. Then, the first weighted result and the second weighted result are dot-producted to obtain the first attention weight. The question features and the dialogue history channel features are enhanced in the same way to obtain the second attention weight.
[0093] The first attention weight and the second attention weight are concatenated, and the concatenated result is activated to complete multimodal fusion and obtain multimodal channel features. The activation process here can be achieved through the tanh function. In this way, the information output by the two channels is effectively fused, which improves the accuracy of the obtained multimodal channel features.
[0094] Through the embodiments of the invention Figure 4B It can be seen from the above exemplary implementation that the embodiments of the present invention provide three ways to determine channel features, thereby effectively performing answer reasoning, improving the flexibility of processing, and determining the specific processing method based on the specific circumstances of the picture and conversation history.
[0095] In some embodiments, see Figure 4C , Figure 4C is an optional flow chart of processing in dual-channel mode provided by an embodiment of the present invention, Figure 4B The illustrated step 203 can be implemented through steps 301 to 305 , which will be described in conjunction with each step.
[0096] In step 301, a tracking process is performed based on the dialogue question and channel information to obtain visual channel features.
[0097] In dual-channel mode, the number of tracking processes performed in the visual information channel and the number of positioning processes performed in the dialogue history channel can be the same or different. In one case, a tracking process is performed in the visual information channel based on the dialogue question and the picture in the channel information, and the obtained updated question features are determined as visual channel features. When a tracking process is performed once, less computing resources are consumed and faster feedback can be obtained. The specific method of the tracking process here is the same as above and will not be repeated here.
[0098] In step 302, at least two tracking processes are performed according to the dialogue question and the channel information, and positioning processing is included between two adjacent tracking processes to obtain visual channel features.
[0099] In the visual information channel, at least two tracking processes can be performed based on the dialogue questions and the channel information, and positioning processing can be included between two adjacent tracking processes to obtain visual channel features. Compared with only one tracking process, the visual channel features obtained in this way are more accurate.
[0100] In some embodiments, the above-mentioned tracking process of performing at least two times according to the dialogue question and the channel information, and including positioning process between two adjacent tracking processes to obtain the visual channel feature, can be implemented in the following manner: performing tracking process according to the question feature corresponding to the dialogue question and the image feature corresponding to the image to obtain the nth updated question feature; performing positioning process according to the nth updated question feature and the dialogue history feature corresponding to the dialogue history to obtain the n+1th updated question feature; iterating the value of n until the Nth updated question feature is obtained, and determining the Nth updated question feature as the visual channel feature; wherein the value of n is 1, ...N, respectively, and N is an integer greater than 1.
[0101] For the visual information channel, tracking processing is performed based on the question features corresponding to the dialogue question and the image features corresponding to the image to obtain the nth updated question feature. Then, positioning processing is performed based on the nth updated question feature and the dialogue history feature obtained through tracking processing to obtain the n+1th updated question feature. Here, the value of n is an integer from 1 to N, and n starts from 1. N is an integer greater than 1, and the specific value can be set according to the actual application scenario. Iterate the value of n until the Nth updated question feature is obtained, and the Nth updated question feature is named the visual channel feature, that is, as the output of the visual information channel.
[0102] It is worth noting that in the iterative process, the question features input to the next positioning process are the updated question features output by the previous tracking process, and the question features input to the next tracking process are the updated question features output by the previous positioning process. For example, when performing the first tracking process, the updated question feature 1 is output, then the updated question feature 1 and the conversation history feature are determined as the input of the first positioning process, and the updated question feature 2 and the image feature output by the first positioning process are determined as the input of the second tracking process. In the above manner, more refined answer reasoning can be achieved, that is, fine-grained analysis can be achieved to improve the accuracy of the obtained visual channel features.
[0103] In step 303, a positioning process is performed based on the dialogue question and channel information to obtain dialogue history channel features.
[0104] In the dialogue history channel, a positioning process can be performed based on the dialogue question and the dialogue history in the channel information, and the obtained updated question feature is determined as the dialogue history channel feature. The specific method of the positioning process here is the same as above and will not be repeated here.
[0105] In step 304, at least two positioning processes are performed according to the dialogue question and the channel information, and tracking processes are included between two adjacent positioning processes to obtain dialogue history channel features.
[0106] In addition to one positioning process, at least two positioning processes may be performed in the conversation history channel according to the conversation question and the channel information, and tracking process may be included between two adjacent positioning processes to obtain more accurate conversation history channel features.
[0107] In some embodiments, the above-mentioned positioning processing based on the dialogue question and channel information can be implemented in the following manner, and the two adjacent positioning processing include tracking processing to obtain the dialogue history channel feature: positioning processing is performed based on the question feature corresponding to the dialogue question and the dialogue history feature corresponding to the dialogue history to obtain the mth updated question feature; tracking processing is performed based on the mth updated question feature and the image feature corresponding to the image to obtain the m+1th updated question feature; iterate the value of m until the Mth updated question feature is obtained, and determine the Mth updated question feature as the dialogue history channel feature; wherein the value of m is 1, ...M, respectively, and M is an integer greater than 1.
[0108] For the dialogue history channel, positioning processing is performed according to the problem features and dialogue history features to obtain the mth updated problem features, and tracking processing is performed according to the mth updated problem features and image features obtained by positioning processing to obtain the m+1th updated problem features. Here, the value of m is an integer from 1 to M, and m starts from 1, and M is an integer greater than 1. Generally speaking, M is the same as the value of N above, but different values can also be set for M and N according to the actual application scenario. Iterate the value of m until the Mth updated problem feature is obtained, and the Mth updated problem feature is named the dialogue history channel feature, that is, as the output of the dialogue history channel. It is worth noting that in the iterative process, the problem feature input for the next tracking processing is the updated problem feature output by the previous positioning processing, and the problem feature input for the next positioning processing is the updated problem feature output by the previous tracking processing. In the above manner, a more fine-grained problem feature update is achieved in the dialogue history channel, and the accuracy of the obtained dialogue history channel feature is improved.
[0109] In step 305, multimodal fusion processing is performed on the visual channel features and the dialogue history channel features to obtain multimodal channel features.
[0110] Through the embodiments of the invention Figure 4C As can be seen from the above exemplary implementation, the embodiment of the present invention provides two processing methods for the dual-channel mode, which improves the flexibility of the dual-channel mode. In actual application scenarios, the specific processing method can be determined according to the response speed requirements in the visual dialogue. For example, when rapid feedback of dialogue answers is required, a tracking process is set in the visual information channel and a positioning process is set in the dialogue history channel to speed up the speed of obtaining the visual channel features and the dialogue history channel features.
[0111] In some embodiments, see Figure 4D , Figure 4D is an optional flow chart of the artificial intelligence-based visual dialogue method provided by an embodiment of the present invention. Figure 4A The illustrated step 104 can be implemented through steps 401 to 404 , which will be described in conjunction with each step.
[0112] In step 401, image features corresponding to the image, question features corresponding to the conversation question, and conversation history features corresponding to the conversation history are determined.
[0113] Feature extraction processing is performed on the image, conversation question and conversation history respectively in advance, and the image features, question features and conversation history features are determined in this step. The feature extraction processing operation can be performed before step 103.
[0114] In step 402, the hidden layer state of the decoding recurrent neural network model is initialized according to the channel characteristics.
[0115] Based on the RNN model, multi-modal information fusion is performed. For the sake of distinction, the RNN model here is named the decoding RNN model. As an example, see Figure 3 , in the fusion module 2434, the first hidden state of the decoding RNN model is initialized according to the obtained channel features, wherein the channel features can be visual channel features, dialogue history channel features or multimodal channel features, depending on the specific channel mode.
[0116] In some embodiments, the above-mentioned determination of image features corresponding to images, question features corresponding to conversation questions, and conversation history features corresponding to conversation histories can be achieved in the following manner: performing feature extraction processing on images through a convolutional neural network model to obtain image features; performing feature extraction processing on conversation questions through a first recurrent neural network model to obtain question features; and performing feature extraction processing on conversation histories through a second recurrent neural network model to obtain conversation history features.
[0117] Here, the image features can be extracted by a CNN model to obtain image features, such as a FastR-CNN model, a Visual Geometry Group (VGG) model, or a Residual Neural Network (ResNet) model. At the same time, the dialogue question is extracted by a first RNN model to obtain the question features, and the dialogue history is extracted by a second RNN model to obtain the dialogue history features. The first RNN model and the second RNN model can be a Long Short-Term Memory (LSTM) model, a Bi-directional Long Short-Term Memory (Bi-LSTM) model, or a Gated Recurrent Unit (GRU) model, or other variants of the RNN model. The above method can effectively extract image features, and extract features of dialogue questions and dialogue history by using the RNN model, and effectively obtain the sequence data therein.
[0118] In some embodiments, the above-mentioned initialization of the hidden state of the decoding recurrent neural network model according to the channel characteristics can be achieved in the following way: the hidden state of the decoding recurrent neural network model is initialized according to the channel characteristics and the last hidden state of the first recurrent neural network model.
[0119] Based on the feature extraction of the dialogue question by the first RNN model, the first hidden state of the decoding RNN model is initialized according to the channel features and the last hidden state of the first RNN model, thereby improving the decoding capability of the decoding RNN model.
[0120] In step 403, according to the hidden layer state of the decoding recurrent neural network model, attention processing is performed on the image features, question features and dialogue history features respectively.
[0121] As an example, see Figure 3 ,In the fusion module 2434, the attention mechanism is applied to ,attend to the picture features, question features and dialogue history features ,respectively according to the current hidden state of the decoding RNN model.
[0122] In some embodiments, the above-mentioned attention processing of image features, question features and conversation history features respectively according to the hidden state of the decoding recurrent neural network model can be achieved in the following way: the hidden state of the decoding recurrent neural network model and the initial features are activated together, and the result of the activation processing is normalized to obtain intermediate attention features; the intermediate attention features are multiplied by the initial features to obtain the initial features after attention; wherein the initial features are image features, question features or conversation history features.
[0123] Taking the initial feature as the problem feature as an example, when performing attention processing, the current hidden state of the decoding RNN model and the problem feature are first activated together, for example, through the tanh function. Then, the result of the activation process is normalized to obtain the intermediate attention feature. The normalization process here can be implemented using the softmax function. Finally, the intermediate attention feature is multiplied with the problem feature to obtain the problem feature after attention. The problem feature after attention is the embodiment of the more important information in the original problem feature.
[0124] In step 404, the noted image features, the noted question features and the noted conversation history features are concatenated, and the concatenated results are activated to obtain fused features.
[0125] As an example, see Figure 3 In the fusion module 2434, the noted image features, the noted question features and the noted conversation history features are concatenated, and the concatenated results are activated according to an activation function such as a tanh function to obtain fused features.
[0126] exist Figure 4D middle, Figure 4AThe illustrated step 105 can be implemented through steps 405 to 407 , which will be described in conjunction with each step.
[0127] In step 405, the fusion features and the hidden layer states of the decoding recurrent neural network model are weighted through the multi-layer perceptron model to obtain the answer features; wherein each numerical value in the answer features corresponds to the probability of selecting a word.
[0128] As an example, see Figure 3 In the prediction module 2435, the fusion features and the current hidden layer state of the decoding RNN model are weighted through the MLP model to obtain the answer features. The answer features here are in vector form, and each value corresponds to the selection probability of a word (Chinese word or word).
[0129] In step 406, when the answer feature meets the selection condition, the word corresponding to the largest value in the answer feature is added to the answer sequence.
[0130] Here, the selection condition determines whether to select the word corresponding to the answer feature. The selection condition can be set according to the actual application scenario, for example, it is set to a value in the answer feature that exceeds a probability threshold, such as 40%. When the answer feature determined according to the current hidden state of the decoding RNN model meets the selection condition, the word corresponding to the largest value in the answer feature is added to the answer sequence.
[0131] In step 407, when the answer feature does not meet the selection condition, the words in the answer sequence are combined into a dialogue answer.
[0132] On the contrary, when the answer feature does not meet the selection conditions, the existing words in the answer sequence are combined into a dialogue answer in the order of adding time from early to late, so as to respond to the dialogue question.
[0133] Through the embodiments of the invention Figure 4D It can be seen from the above exemplary implementation that the embodiments of the present invention combine multimodal information of pictures, dialogue questions and dialogue history, and obtain dialogue answers by initializing hidden layer states, attention processing and splicing processing, thereby improving the accuracy of dialogue answers, making it possible to effectively respond to dialogue questions through dialogue answers, thereby improving the accuracy of visual dialogue.
[0134] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.
[0135] See also Figure 5 , Figure 5 This is an optional architecture diagram of an artificial intelligence-based visual dialogue system provided by an embodiment of the present invention. Figure 5 Each module shown is described in detail. Figure 5 In the feature representation module shown, pictures, dialogue questions and dialogue history are read in, where the dialogue history includes picture description ( Figure 5 ), historical dialogue questions and historical dialogue answers, where historical dialogue questions are Figure 5 In the Q, such as "How old are the girls?", historical dialogue questions are Figure 5 In the , A is used to represent, such as "late juvenile". Figure 5 In the process, the image is subjected to feature extraction to obtain image features. Specifically, the feature extraction process can be performed through a CNN model such as a Fast R-CNN model, a VGG model, or a ResNet model. For example, if I represents an image, the image features can be extracted through a Fast R-CNN model. The process is as follows:
[0136] v=Faster R-CNN(I)
[0137] Among them, v is the image feature.
[0138] The Bi-LSTM model is used to solve the dialogue question Q t Perform feature extraction processing, the specific formula is as follows:
[0139]
[0140]
[0141]
[0142] Among them, LSTM f It is the forward part of the Bi-LSTM model; LSTM b is the backward part of the Bi-LSTM model; w is the word vector obtained after the word in the dialogue question is processed by word embedding; x is the feature vector of the word obtained after w is processed by the Bi-LSTM model; L represents the length of the dialogue question, that is, the number of words in the dialogue question; q t It is worth noting that the word here can be a Chinese word, an English word, or a word in other languages. In addition, the j in this formula has nothing to do with the j in the single-channel tracking process above.
[0143] Similarly, after the Bi-LSTM model performs feature extraction on the conversation history, the conversation history feature u is obtained. Figure 5 The blank rectangles in represent eigenvectors.
[0144] After completing the feature representation of the image, dialogue question and dialogue history, the image features, question features and dialogue history features are input into Figure 5 The dual-channel multi-step reasoning module shown is composed of two sub-modules: a tracking module and a positioning module. Multi-step reasoning is implemented in two channels through the tracking module and the positioning module.
[0145] In the tracking module, two different MLP models are used to process the question features and image features respectively to obtain new features, and then the updated question features are obtained by applying the attention mechanism. The MLP model can be a two-layer MLP model or an MLP model with other layers. For easy distinction, the question features input to the tracking module are named q track , then the formula for tracking processing in the tracking module is as follows:
[0146]
[0147] α=softmax(W γ γ+b γ )
[0148]
[0149] Among them, f represents a two-layer MLP model, represents the MLP model corresponding to the problem features in the tracking module, represents the MLP model corresponding to the image features in the tracking module; W and b are trainable parameter matrices; K represents the total number of rows of the image feature v; "ο" is the dot product operator. In addition, γ is the attention weight in the above tracking process, and α is the normalized attention weight in the above tracking process.
[0150] In the localization module, different two-layer MLP models are used to process the question features and conversation history features respectively to obtain new features, and then the intermediate conversation history features are obtained by applying the attention mechanism. The intermediate conversation history features and the image description features u0 in the conversation history features are processed by the two-layer MLP model and regularized (corresponding to the ReLU activation processing and LayerNorm processing in the formula below), and finally the updated question features are obtained. For easy distinction, the question features input to the localization module are named q locate , then the formula for positioning processing in the positioning module is as follows:
[0151]
[0152] α=softmax(W β β+b β )
[0153]
[0154]
[0155] q locate =LayerNorm(g+u0)
[0156] Where T represents the total number of rows of conversation history features u; and Used to distinguish different W, and Similarly, u0 represents the image description feature, where 0 is a subscript, which is used to indicate the position of the image description feature in the conversation history feature. The ReLU function in the formula can be replaced by other activation functions, such as tanh function or LeakReLU function. In addition, β is the attention weight in the above positioning process, and α is the normalized attention weight in the above positioning process. That is the intermediate dialogue history feature.
[0157] The embodiments of the present invention provide Figure 6 The schematic diagram of dual-channel multi-step reasoning shown in FIG. shows the process of dual-channel multi-step reasoning based on n+2 as the final number of steps. For the sake of convenience, n is the final number of steps, Track() represents the tracking process in the tracking module, and Locate() represents the positioning process in the positioning module. The multi-step reasoning process of the visual information channel can be described as:
[0158] Step 1:
[0159] Step 2:
[0160] Step 3:
[0161] …
[0162] step n:
[0163] Among them, each step is a step of reasoning.
[0164] The multi-step reasoning process of the dialogue history channel can be described as:
[0165] Step 1:
[0166] Step 2:
[0167] Step 3:
[0168] …
[0169] step n:
[0170] When performing multi-step reasoning, n may be an integer greater than 2, and further, n may be an odd number greater than 2. Of course, the above is only an example of multi-step reasoning, and any number of reasoning steps may be set according to different actual application scenarios.
[0171] The visual channel features obtained after dual-channel multi-step reasoning and conversation history channel features Input to Figure 5 The multimodal fusion module shown in FIG. 1 is used to enhance the attention module in the multimodal fusion module. and Specifically, and Corresponding to different attention enhancement modules, In the corresponding attention enhancement module, the enhancement processing formula is as follows:
[0172]
[0173] in, This is the first attention weight mentioned above.
[0174] exist In the corresponding attention enhancement module, the enhancement processing formula is as follows:
[0175]
[0176] in, This is the second attention weight mentioned above.
[0177] Then, the linear transformation module transforms and Perform splicing processing and activate the splicing results to obtain multimodal channel features The formula is:
[0178]
[0179]
[0180] Among them, the linear transformation module can be a fully connected layer.
[0181] Will Input to Figure 5The multimodal attention module shown in FIG. 1 is decoded by the decoder therein. It is worth noting that the decoder of the embodiment of the present invention can be constructed based on the multimodal attention mechanism, and of course can also be constructed based on other attention mechanisms. For ease of understanding, the decoder constructed based on the multimodal attention mechanism is described below. Figure 7 The decoder includes an LSTM model. In the decoder, first, according to Initialize the hidden state of the LSTM model:
[0182]
[0183] Among them, s q It is the last hidden state of the Bi-LSTM model that performs feature extraction on dialogue questions.
[0184] In the attention mechanism module, according to the current hidden state h of the LSTM model t , the image features, question features and conversation history features are processed with attention respectively. For example, if the question feature is q, the process of processing the question feature with attention is as follows:
[0185]
[0186]
[0187]
[0188] Among them, A is a matrix with all elements set to 1, T here represents the transpose of the matrix, and l here represents the total number of rows of the problem feature q. The obtained m q This is the feature of the question after attention. Similarly, the feature of the conversation history after attention, m, can be obtained u And the image features after attention m v .
[0189] Through the fusion module, m q 、m u and m v Perform splicing processing and activate the splicing result to obtain the fusion feature c t , the formula is:
[0190] c t =tanh(W C [m q ,m u ,m v ])
[0191] Then, the answer feature f(h t ,ct ), answer feature f(h t ,c t ) reflects the t-1 ,q,v,u appear at the same time, word y t The probability of occurrence is:
[0192] logp(y t |y1,…,y t-1 ,q,v,u)=f(h t ,c t )
[0193] When the answer feature meets the selection condition, the word y corresponding to the largest value in the answer feature is t Add to the answer sequence; when the answer feature does not meet the selection criteria, combine the existing words in the answer sequence into a dialogue answer in the order of addition time from earliest to latest. Figure 5 It shows that when the dialogue question is "What color is it", the dual-channel multi-step reasoning results in y1,...,y t The dialogue answer composed of "black and white" means that in the process of visual dialogue, the picture, dialogue question and dialogue history are combined to more finely analyze the meaning of "it" in the dialogue question (that is, clothes), and give corresponding replies based on the pictures, thereby improving the reply effect.
[0194] The inventor has experimentally verified that, compared with the visual dialogue model provided by the prior art, the visual dialogue method based on artificial intelligence provided by the embodiment of the present invention can improve the accuracy of the dialogue answers obtained and achieve better precision. The specific indicators are as follows:
[0195]
[0196]
[0197] Among them, mean reciprocal rank (MRR), R@k and Mean (mean rank of human response, average ranking) are all evaluation indicators of visual dialogue accuracy. The higher the values of MRR and R@k, the higher the accuracy of visual dialogue; the lower the value of Mean, the higher the accuracy of visual dialogue. Generally speaking, an increase or decrease of one point in the value of the evaluation indicator means a significant change in the accuracy of visual dialogue.
[0198] The present invention also provides the following ablation test results:
[0199]
[0200]
[0201] Among them, "√" means that the corresponding component has been deployed or the corresponding processing has been executed, and "×" means that the corresponding component has not been deployed or the corresponding processing has not been executed. Based on the ablation experiment results, it can be obtained that after the positioning module, tracking module and decoder ( Figure 5 The best visual dialogue accuracy is achieved when the decoder in the multimodal attention module is used and two-channel three-step reasoning is performed.
[0202] The following is a description of an exemplary structure of the artificial intelligence-based visual dialogue device 243 provided in an embodiment of the present invention implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the artificial intelligence-based visual dialogue device 243 of the memory 240 may include: an acquisition module 2431, used to acquire dialogue questions and dialogue histories corresponding to the picture; a determination module 2432, used to determine at least one of the picture and the dialogue history as channel information; a channel processing module 2433, used to perform at least one of tracking processing and positioning processing according to the dialogue question and the channel information to obtain corresponding channel features; a fusion module 2434, used to fuse the picture, the dialogue question and the dialogue history according to the channel features to obtain fusion features; a prediction module 2435, used to perform prediction processing according to the fusion features to obtain a dialogue answer corresponding to the dialogue question.
[0203] In some embodiments, the channel processing module 2433 is also used to: perform any one of the following processing: perform single-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features; perform single-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features; perform dual-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features, perform dual-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features, and perform multimodal fusion processing on the visual channel features and the dialogue history channel features to obtain multimodal channel features.
[0204] In some embodiments, the channel processing module 2433 is also used to: perform any one of the following processing: perform a tracking process according to the dialogue question and the channel information to obtain visual channel features; perform at least two tracking processes according to the dialogue question and the channel information, and include positioning processing between two adjacent tracking processes to obtain visual channel features.
[0205] The channel processing module 2433 is also used to: perform any one of the following processing: perform a positioning process according to the dialogue question and the channel information to obtain the dialogue history channel characteristics; perform at least two positioning processes according to the dialogue question and the channel information, and include tracking processing between two adjacent positioning processes to obtain the dialogue history channel characteristics.
[0206] In some embodiments, the channel processing module 2433 is further used to: perform tracking processing based on the question features corresponding to the conversation question and the image features corresponding to the image to obtain the nth updated question feature; perform positioning processing based on the nth updated question feature and the conversation history features corresponding to the conversation history to obtain the n+1th updated question feature; iterate the value of n until the Nth updated question feature is obtained, and determine the Nth updated question feature as the visual channel feature; wherein the value of n is 1, ...N, respectively, and N is an integer greater than 1.
[0207] In some embodiments, the channel processing module 2433 is further used to: perform positioning processing based on the question feature corresponding to the conversation question and the conversation history feature corresponding to the conversation history to obtain the mth updated question feature; perform tracking processing based on the mth updated question feature and the image feature corresponding to the image to obtain the m+1th updated question feature; iterate the value of m until the Mth updated question feature is obtained, and determine the Mth updated question feature as the conversation history channel feature; wherein the value of m is 1, ...M, respectively, and M is an integer greater than 1.
[0208] In some embodiments, the channel processing module 2433 is also used to: enhance the question features corresponding to the dialogue question and the visual channel features to obtain a first attention weight; enhance the question features corresponding to the dialogue question and the dialogue history channel features to obtain a second attention weight; concatenate the first attention weight and the second attention weight, and activate the concatenated result to obtain a multimodal channel feature.
[0209] In some embodiments, the channel processing module 2433 is also used to: perform weighted processing on the question features corresponding to the dialogue question through a first multi-layer perceptron model to obtain a first weighted result; perform weighted processing on the visual channel features through a second multi-layer perceptron model to obtain a second weighted result; perform dot product processing on the first weighted result and the second weighted result to obtain a first attention weight.
[0210] In some embodiments, the channel processing module 2433 is also used to: enhance the question features corresponding to the dialogue question and the image features corresponding to the image to obtain attention weights; normalize the attention weights; multiply the normalized attention weights by the image features to obtain the jth updated question feature; iterate the value of j until the Jth updated question feature is obtained, and determine the Jth updated question feature as the visual channel feature; wherein the value of j is 1, ...J, respectively, and J is an integer greater than 0.
[0211] In some embodiments, the channel processing module 2433 is further used to: enhance the question features of the dialogue question and the dialogue history features corresponding to the dialogue history to obtain attention weights; normalize the attention weights; multiply the normalized attention weights by the dialogue history features to obtain intermediate dialogue history features; activate the intermediate dialogue history features, and regularize the results of the activation processing together with the image description features in the dialogue history features to obtain the rth updated question feature; iterate the value of r until the Rth updated question feature is obtained, and determine the Rth updated question feature as the dialogue history channel feature; wherein the values of r are 1, ...R, respectively, and R is an integer greater than 0.
[0212] In some embodiments, the fusion module 2434 is also used to: determine the image features corresponding to the image, the question features corresponding to the conversation questions, and the conversation history features corresponding to the conversation history; initialize the hidden layer state of the decoding recurrent neural network model according to the channel features; perform attention processing on the image features, the question features, and the conversation history features according to the hidden layer state of the decoding recurrent neural network model; perform splicing processing on the attended image features, the attended question features, and the attended conversation history features, and perform activation processing on the splicing results to obtain fused features.
[0213] In some embodiments, the prediction module 2435 is also used to: perform weighted processing on the fusion features and the hidden layer states of the decoding recurrent neural network model through a multi-layer perceptron model to obtain answer features; wherein each numerical value in the answer features corresponds to the selection probability of a word; when the answer features meet the selection conditions, the word corresponding to the largest numerical value in the answer features is added to the answer sequence; when the answer features do not meet the selection conditions, the words in the answer sequence are combined into a dialogue answer.
[0214] In some embodiments, the fusion module 2434 is further used to: perform feature extraction processing on the image through a convolutional neural network model to obtain image features; perform feature extraction processing on the dialogue question through a first recurrent neural network model to obtain question features; perform feature extraction processing on the dialogue history through a second recurrent neural network model to obtain dialogue history features;
[0215] The fusion module 2434 is also used to initialize the hidden layer state of the decoding recurrent neural network model according to the channel feature and the last hidden layer state of the first recurrent neural network model.
[0216] In some embodiments, the fusion module 2434 is also used to: activate the hidden layer state and initial features of the decoding recurrent neural network model together, and normalize the results of the activation processing to obtain intermediate attention features; multiply the intermediate attention features with the initial features to obtain the initial features after attention; wherein the initial features are the picture features, the question features or the conversation history features.
[0217] The embodiment of the present invention provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the visual dialogue method based on artificial intelligence provided by the embodiment of the present invention, for example, Figure 4A , 4B Or the artificial intelligence-based visual dialogue method shown in 4D.
[0218] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0219] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0220] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0221] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0222] In summary, the embodiments of the present invention deepen the multimodal representation of dialogue questions, and at the same time strengthen the decoder through the multimodal attention mechanism, thereby effectively improving the accuracy of the obtained dialogue answers and improving the precision of visual dialogue.
[0223] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims
1. A visual dialogue method based on artificial intelligence, characterized in that: include: Get the conversation questions and conversation history corresponding to the picture; determining at least one of the picture and the conversation history as channel information; Perform any of the following: Performing single channel tracking processing according to the dialogue question and the channel information to obtain visual channel features; Performing single channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features; Performing dual-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features, performing dual-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features, and performing multimodal fusion processing on the visual channel features and the dialogue history channel features to obtain multimodal channel features; According to the channel feature, the image, the conversation question and the conversation history are fused to obtain a fusion feature; Prediction processing is performed based on the fusion features to obtain a dialogue answer corresponding to the dialogue question.
2. The visual dialogue method according to claim 1, characterized in that: The performing dual-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features includes: Perform any of the following: Perform a tracking process according to the dialogue question and the channel information to obtain a visual channel feature; Perform at least two tracking processes according to the dialogue question and the channel information, and include positioning processing between two adjacent tracking processes to obtain visual channel features; The performing dual-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features includes: Perform any of the following: Performing a positioning process according to the dialogue question and the channel information to obtain dialogue history channel features; At least two positioning processes are performed according to the dialogue question and the channel information, and tracking processes are included between two adjacent positioning processes to obtain dialogue history channel features.
3. The visual dialogue method according to claim 2, characterized in that: The step of performing at least two tracking processes according to the dialogue question and the channel information, and including positioning processing between two adjacent tracking processes, so as to obtain visual channel features, includes: According to the question feature corresponding to the dialogue question and the image feature corresponding to the image, tracking processing is performed to obtain the nth updated question feature; Performing positioning processing according to the nth update question feature and the conversation history feature corresponding to the conversation history to obtain the n+1th update question feature; Iterate the value of n until an Nth update problem feature is obtained, and determine the Nth update problem feature as a visual channel feature; The value of n is 1, ..., N, and N is an integer greater than 1.
4. The visual dialogue method according to claim 2, characterized in that: The performing at least two positioning processes according to the conversation question and the channel information, and including a tracking process between two adjacent positioning processes, so as to obtain the conversation history channel features, includes: Performing positioning processing according to the question feature corresponding to the dialogue question and the dialogue history feature corresponding to the dialogue history to obtain the mth updated question feature; According to the mth update problem feature and the picture feature corresponding to the picture, tracking processing is performed to obtain the m+1th update problem feature; Iterate the value of m until the Mth update question feature is obtained, and determine the Mth update question feature as the conversation history channel feature; The value of m is 1, ..., M, and M is an integer greater than 1.
5. The visual dialogue method according to claim 1, characterized in that: The performing multimodal fusion processing on the visual channel feature and the conversation history channel feature to obtain the multimodal channel feature includes: Performing enhancement processing on the question feature corresponding to the dialogue question and the visual channel feature to obtain a first attention weight; Performing enhancement processing on the question feature corresponding to the dialogue question and the dialogue history channel feature to obtain a second attention weight; The first attention weight and the second attention weight are concatenated, and an activation process is performed on the concatenated result to obtain a multimodal channel feature.
6. The visual dialogue method according to claim 5, characterized in that: The step of enhancing the question feature corresponding to the dialogue question and the visual channel feature to obtain a first attention weight includes: Performing weighted processing on the question features corresponding to the dialogue question through a first multi-layer perceptron model to obtain a first weighted result; The visual channel features are weighted by a second multi-layer perceptron model to obtain a second weighted result; Perform a dot product process on the first weighted result and the second weighted result to obtain a first attention weight.
7. The visual dialogue method according to claim 1, characterized in that: The single channel tracking process is performed according to the dialogue question and the channel information to obtain visual channel features, including: Performing enhancement processing on question features corresponding to the dialogue question and image features corresponding to the image to obtain attention weights; Normalizing the attention weights; Multiplying the normalized attention weight by the image feature to obtain the jth updated problem feature; Iterate the value of j until the Jth update problem feature is obtained, and determine the Jth update problem feature as the visual channel feature; The value of j is 1, ..., J, and J is an integer greater than 0.
8. The visual dialogue method according to claim 1, characterized in that: The performing single channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features includes: Performing enhancement processing on the question feature of the dialogue question and the dialogue history feature corresponding to the dialogue history to obtain an attention weight; Normalizing the attention weights; Multiplying the normalized attention weight by the conversation history feature to obtain an intermediate conversation history feature; Activate the intermediate conversation history feature, and perform regularization on the result of the activation process and the image description feature in the conversation history feature to obtain the rth updated question feature; Iterate the value of r until the Rth update question feature is obtained, and determine the Rth update question feature as the conversation history channel feature; The value of r is 1, ..., R in sequence, and R is an integer greater than 0.
9. The visual dialogue method according to any one of claims 1 to 8, characterized in that: The step of fusing the image, the conversation question and the conversation history according to the channel feature to obtain a fusion feature includes: Determining an image feature corresponding to the image, a question feature corresponding to the conversation question, and a conversation history feature corresponding to the conversation history; Initializing the hidden layer state of the decoding recurrent neural network model according to the channel characteristics; According to the hidden layer state of the decoding recurrent neural network model, attention processing is performed on the image features, the question features, and the conversation history features respectively; The noted image features, the noted question features and the noted conversation history features are spliced together, and the splicing result is activated to obtain a fusion feature.
10. The visual dialogue method according to claim 9, characterized in that: The performing prediction processing according to the fusion feature to obtain a dialogue answer corresponding to the dialogue question includes: The fusion feature and the hidden layer state of the decoding recurrent neural network model are weighted by a multi-layer perceptron model to obtain an answer feature; wherein each value in the answer feature corresponds to a probability of selecting a word; When the answer feature meets the selection condition, the word corresponding to the largest value in the answer feature is added to the answer sequence; When the answer feature does not satisfy the selection condition, the words in the answer sequence are combined into a dialogue answer.
11. The visual dialogue method according to claim 9, characterized in that: The step of performing attention processing on the image feature, the question feature, and the conversation history feature respectively according to the hidden layer state of the decoding recurrent neural network model includes: Activating the hidden layer state and the initial features of the decoding recurrent neural network model together, and normalizing the activation results to obtain intermediate attention features; Performing a product process on the intermediate attention feature and the initial feature to obtain the initial feature after attention; The initial feature is the picture feature, the question feature or the conversation history feature.
12. A visual dialogue device based on artificial intelligence, characterized in that: include: An acquisition module is used to obtain the dialogue questions and dialogue history corresponding to the picture; a determination module, configured to determine at least one of the picture and the conversation history as channel information; a channel processing module, configured to perform any one of the following processing: performing single-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features; performing single-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features; performing dual-channel tracking processing according to the dialogue question and the channel information to obtain visual channel features, performing dual-channel positioning processing according to the dialogue question and the channel information to obtain dialogue history channel features, and performing multimodal fusion processing on the visual channel features and the dialogue history channel features to obtain multimodal channel features; A fusion module, configured to fuse the image, the conversation question, and the conversation history according to the channel feature to obtain a fusion feature; The prediction module is used to perform prediction processing based on the fusion features to obtain a dialogue answer corresponding to the dialogue question.
13. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, used to implement the artificial intelligence-based visual dialogue method described in any one of claims 1 to 11 when executing the executable instructions stored in the memory.
14. A storage medium, characterized in that: Executable instructions are stored, which are used to cause the processor to execute and implement the artificial intelligence-based visual dialogue method described in any one of claims 1 to 11.
Citation Information
Patent Citations
Generative multi-round chat dialogue method and system and computer-readable storage medium
CN108681610A
Question and answering (QA) system realization method based on deep learning and topic model
CN108763284A
Control method based on synchronous acquisition and fusion of multimode man-machine sensing information
CN109634407A
Autonomous evolution intelligent dialogue method, system and device based on physical environment game
CN109800294A
Problem generation method and device, equipment and storage medium
CN110162613A
