Information generation method, device, computer device, storage medium, and computer program

By integrating semantic and visual attention mechanisms in a recurrent neural network, the method generates more accurate image captions by balancing the strengths of both feature types, addressing the limitations of existing methods in capturing both visual and non-visual descriptors.

JP7537060B2Active Publication Date: 2024-08-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023523236
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-01-29
Filing Date
2022-01-24
Publication Date
2024-08-21
Estimated Expiration
2042-01-24

AI Technical Summary

Technical Problem

Existing image caption generation methods rely heavily on visual features, often neglecting semantic features, leading to incomplete and inaccurate captions, especially for visually impaired individuals and early education scenarios.

Method used

A method that combines semantic and visual attention mechanisms in a recurrent neural network to generate image captions by performing attention fusion on both feature sets at multiple time steps, leveraging semantic attention vectors and visual attention vectors to enhance the generation of both visual and non-visual descriptors.

Benefits of technology

Improves the accuracy of image caption generation by complementing the strengths of visual and semantic features, resulting in more complete and accurate captions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007537060000009
    Figure 0007537060000009
  • Figure 0007537060000010
    Figure 0007537060000010
  • Figure 0007537060000011
    Figure 0007537060000011
Patent Text Reader

Abstract

The present invention provides an information generation method, device, equipment, storage medium, and program product relating to the technical field of image processing. The method includes the steps of: acquiring a target image (210); extracting a set of semantic features of the target image and extracting a set of visual features of the target image (220); performing attention fusion on the semantic features and visual features of the target image at n time steps to obtain descriptors at the n time steps (230); and generating image caption information for the target image based on the descriptors at the n time steps. According to the method, in the process of generating image caption information, the advantages of visual features in generating a visual vocabulary and semantic features in generating non-visual features complement each other, thereby improving the accuracy of generating image caption information.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention claims priority to a Chinese patent application filed on January 29, 2021, bearing application number 202110126753.7 and entitled "Image caption information generating method, apparatus, computer equipment and storage medium", the entire contents of which are incorporated herein by reference.

[0002] The present invention relates to the technical field of image processing, and in particular to an information generating method, apparatus, device, storage medium and program product. [Background technology]

[0003] With the development of image recognition technology, the function of computers to "see and explain pictures" can be realized by algorithms. In other words, computer devices can convert content information in images into image caption information through Image Caption.

[0004] Related technologies often focus on generating image caption information for an image based on extracted visual features of the image, i.e., after a computing device acquires the visual features of an image through an encoder, it uses a single recurrent neural network to generate a caption for the entire image. Summary of the Invention

[0005] The embodiments of the present invention provide an information generating method, an apparatus, a device, a storage medium and a program product, the technical means of which are as follows:

[0006] In one aspect, an information generation method executed by a computing device includes steps of acquiring a target image, extracting a set of semantic features of the target image, extracting a set of visual features of the target image, and performing attention fusion on the semantic features of the target image and the visual features of the target image at n time steps to acquire descriptors at the n time steps, wherein an input at a t-th time step of the attention fusion process includes a semantic attention vector at the t-th time step, a visual attention vector at the t-th time step, and an output result at a t-1-th time step of the attention fusion process, and the semantic attention vector at the t-th time step is a visual attention vector at the t-th time step is obtained by performing attention mechanism processing on the set of visual features at the t-th time step, and an output result of the attention fusion process at the t-1-th time step is used to indicate a descriptor at the t-1-th time step, the t-th time step being any of the n time steps, 1≦t≦n, t and n are all positive integers; and a step of generating image caption information of the target image based on the descriptors at the n time steps of the target image.

[0007] In another aspect, an information generating device includes an image acquisition module that acquires a target image, a feature extraction module that extracts a set of semantic features of the target image and a set of visual features of the target image, and a descriptor acquisition module that performs attention fusion on the semantic features of the target image and the visual features of the target image at n time steps and acquires descriptors at the n time steps, wherein an input at a t-th time step of the attention fusion process includes a semantic attention vector at the t-th time step, a visual attention vector at the t-th time step, and an output result at a t-1-th time step of the attention fusion process, and the semantic attention vector at the t-th time step is the visual attention vector at the t-th time step is obtained by performing attention mechanism processing on the set of visual features at the t-th time step, and an output result at the t-1-th time step of the attention fusion process is used to indicate a descriptor at the t-1-th time step, the t-th time step being any of the n time steps, 1≦t≦n, t and n are all positive integers; and an information generation module that generates image caption information of the target image based on the descriptors at the n time steps of the target image.

[0008] In another aspect, there is provided a computing device including a processor and a memory having stored therein at least one computer program, the computer program being loaded and executed by the processor to implement the information generation method described above.

[0009] In another aspect, there is provided a computer-readable storage medium having stored thereon at least one computer program, the computer program being loaded and executed by a processor to implement the information generation method described above.

[0010] In another aspect, there is provided a computer program product comprising at least one computer program, the computer program being loaded and executed by a processor to implement the information generation method described above.

[0011] The technical solutions of the embodiments of the present invention have at least the following advantageous effects:

[0012] A semantic feature set and a visual feature set of the target image are extracted respectively, and attention fusion is performed on the semantic features and the visual features in n time steps, and in each time step for the computer device to generate image caption information, a description of the target image in the current time step is generated based on the combined effect of the output results of the visual features and semantic features of the target image in the previous time step, so as to generate image caption information corresponding to the target image. In this way, in the process of generating image caption information, the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, so that the accuracy of generating image caption information can be improved. [Brief description of the drawings]

[0013] [Figure 1] 1 is a schematic diagram illustrating a system used in an information generation method according to one exemplary embodiment of the present invention. [Diagram 2] 2 is a flow chart illustrating a method for generating information according to one exemplary embodiment of the present invention. [Diagram 3] FIG. 2 is a schematic diagram illustrating extracting word information in an image based on different attention according to one exemplary embodiment of the present invention; [Figure 4] FIG. 2 is a schematic diagram illustrating selection of corresponding target images in a video scenario according to one exemplary embodiment of the present invention; [Diagram 5] FIG. 2 is a schematic diagram illustrating the model training and information generation stages according to one exemplary embodiment. [Figure 6] 1 is a flow chart illustrating a method for training an information generation model according to one exemplary embodiment of the present invention. [Figure 7] 1 is a flow chart illustrating a model training and information generation method according to one exemplary embodiment of the present invention. [Figure 8] FIG. 2 is a schematic diagram illustrating a process for generating image caption information according to one exemplary embodiment of the present invention. [Figure 9] FIG. 2 is a schematic diagram illustrating the inputs and outputs of an attention fusion network according to one exemplary embodiment of the present invention. [Figure 10] 1 is a block diagram showing a configuration of an information generating device according to an exemplary embodiment of the present invention. [Figure 11] FIG. 1 is a block diagram showing a configuration of a computer device according to one exemplary embodiment of the present invention. [Figure 12] FIG. 1 is a block diagram showing a configuration of a computer device according to one exemplary embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] 1 is a schematic diagram showing a system used in an information generating method according to an exemplary embodiment of the present invention. As shown in FIG. 1, the system includes a server 110 and a terminal 120.

[0015] Here, the server 110 may be an independent physical server, or may be a server cluster or a distributed system configured by a plurality of physical servers.

[0016] The terminal 120 may be a terminal device having a network connection function and an image display function and / or a video playback function. The terminal may also be a terminal having a function of generating image caption information. For example, the terminal 120 may be a smartphone, a tablet computer, an e-book reader, smart glasses, a smart watch, a smart TV, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop portable computer, a desktop computer, etc.

[0017] Preferably, the above system includes one or more servers 110 and multiple terminals 120. The embodiment of the present invention is not limited to the number of servers 110 and terminals 120.

[0018] The terminal and the server may be connected via a communication network. Preferably, the communication network is a wired network or a wireless network.

[0019] In an embodiment of the present invention, a computer device obtains a target image, extracts a semantic feature set of the target image, extracts a visual feature set of the target image, performs attention fusion on the semantic features of the target image and the visual features of the target image in n time steps, obtains descriptors in the n time steps, an input of the attention fusion process in the t-th time step includes a semantic attention vector in the t-th time step, a visual attention vector in the t-th time step, and an output result of the attention fusion process in the t-1-th time step, wherein the semantic attention vector in the t-th time step is obtained by performing an attention mechanism processing on the semantic feature set in the t-th time step, the visual attention vector in the t-th time step is obtained by performing an attention mechanism processing on the visual feature set in the t-th time step, and the output result of the attention fusion process in the t-1-th time step is used to indicate the descriptors in the t-1-th time step, the t-th time step being any of the n time steps, 1≦t≦n, t and n are all positive integers, and generates image caption information of the target image based on the descriptors in the n time steps of the target image. According to this method, the computer device performs attention fusion on the visual features and semantic features of the target image at each time step in the process of generating image caption information, so that the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, thereby improving the accuracy of generating image caption information.

[0020] Preferably, the computer device may obtain the description words at each time step by performing attention fusion on the semantic features and visual features of the target image by the attention fusion network in the information generation model. Figure 2 is a flow chart showing an information generation method according to an exemplary embodiment of the present invention. The method may be executed by a computer device. The computer device may be realized as a terminal or a server, and the terminal or the server may be the terminal or the server shown in Figure 1. As shown in Figure 2, the information generation method may include the following steps.

[0021] Step 210: Acquire a target image.

[0022] In one possible embodiment, the target image may be a locally stored image, or the target image may be an image acquired in real time based on a target object designation operation. For example, the target image may be an image acquired in real time based on a screencast operation by the target subject. Alternatively, the target image may be an image on the terminal screen collected in real time by a computing device when the target subject triggers the generation of image caption information by long pressing a designated area in the screen. Alternatively, the target image may be an image acquired in real time by an image acquisition component of the terminal. Note that the present invention is not limited to the acquisition method of the target image.

[0023] Step 220: Extract a set of semantic features of the target image, and extract a set of visual features of the target image.

[0024] The semantic feature set of the target image is used to indicate a set of term vectors corresponding to candidate descriptors for describing the image information of the target image.

[0025] A visual feature set of a target image is used to denote a set of image features obtained based on features such as RGB (Red Green Blue) distribution of pixel points of a target image.

[0026] Step 230: Through the attention fusion network in the information generation model, attention fusion is performed on the semantic features of the target image and the visual features of the target image in the n time steps to obtain the descriptions in the n time steps.

[0027] Corresponding to the above attention fusion process, the input of the attention fusion network at the t-th time step includes a semantic attention vector at the t-th time step, a visual attention vector at the t-th time step, and an output result of the attention fusion network at the t-1-th time step, where the semantic attention vector at the t-th time step is obtained by performing attention mechanism processing on the semantic feature set at the t-th time step, the visual attention vector at the t-th time step is obtained by performing attention mechanism processing on the visual feature set at the t-th time step, and the output result of the attention fusion network at the t-1-th time step is used to indicate the descriptive word at the t-1-th time step, where the t-th time step is any one of n time steps, where 1≦t≦n, and t and n are all positive integers.

[0028] Here, the number of time steps n is the number of time steps required to generate image caption information for the target image.

[0029] The essence of the Attention Mechanism is a set of weight coefficients autonomously learned through a network, which emphasizes the interest areas of the target object in the manner of "dynamic weighting" and suppresses irrelevant background areas. In the field of computer vision, attention mechanisms are mainly divided into two types: hard attention and soft attention.

[0030] Attention mechanisms are often used in RNNs (Recurrent Neural Networks). Each time a pixel in a target image is processed, the RNN with attention mechanism processes it based on the partial pixels of the target image that are more focused on the previous state of the current state, instead of processing based on all the pixels of the target image, which can reduce the processing complexity of the task.

[0031] In an embodiment of the present invention, when generating image caption information, the computer device generates one word, and then generates a next word based on the generated word. Here, the time required to generate one word is referred to as a time step. Preferably, the number of time steps n may be a non-fixed value greater than 1. When the generated description word is a word or character to indicate the end of the description word generation process, the computer device ends the description word generation process.

[0032] An information generation model according to an embodiment of the present invention is used to generate image caption information of an image, and the information generation model is generated by training a sample image and image caption information corresponding to the sample image, where the image caption information of the sample image can be text information.

[0033] In an embodiment of the present invention, the semantic attention vector may utilize multiple attributes to enhance the generation of both visual and non-visual descriptive words. Visual descriptive words refer to descriptive word information that can be directly extracted based on pixel information of an image, such as descriptive words whose part of speech is a noun in image caption information. Meanwhile, non-visual descriptive words refer to descriptive word information that is unlikely to be extracted based on pixel information of an image or that cannot be directly extracted, such as descriptive words whose part of speech is a verb or a preposition in image descriptive information.

[0034] The visual attention vector enhances the generation of visual descriptors and has a good representation for the visual descriptors in the extracted image. FIG. 3 is a schematic diagram illustrating extracting word information in an image based on different attention according to one exemplary embodiment of the present invention. Part A of FIG. 3 illustrates the weight change of each descriptor obtained by the semantic attention mechanism for a given image. Part B of FIG. 3 illustrates the weight change of each descriptor obtained by the visual attention mechanism for the same given image. If the descriptors are words, for three words "people", "standing" and "table", in the semantic attention mechanism, when each word is generated, the weight corresponding to each word reaches a peak, that is, the semantic attention mechanism pays attention to the word with the highest relevance to the current context. In the visual attention mechanism, when generating visual words of the three words, i.e., when generating "people" and "table", the visual attention pays attention to the image region corresponding to the visual word in the given image. For example, as shown in FIG. 3, when generating "people", the visual attention pays attention to the region 310 containing a face in the given image. In generating a non-visual word of the three words, i.e., generating "table", visual attention focuses on a region 320 in a given image that contains a table. However, in generating a non-visual word based on the visual attention mechanism, e.g., generating "standing", the visual attention mechanism focuses on an irrelevant and potentially misleading image region 330.

[0035] Therefore, in order to balance the advantages of the visual attention mechanism in generating visual vocabulary and the semantic attention mechanism in generating non-visual features, in an embodiment of the present invention, by combining visual attention and semantic attention, a computing device can more accurately guide the generation of visual and non-visual words, and reduce the interference of visual attention in the generation of non-visual words, so as to generate more complete and rich image captions.

[0036] Step 240: Generate image caption information for the target image based on the descriptive words at the n time steps of the target image.

[0037] In one possible embodiment, the descriptors in the n time steps are sorted, for example sequentially sorted, according to a predefined order to generate image caption information for the target image.

[0038] As described above, the information generation method according to the embodiment of the present invention respectively extracts a semantic feature set and a visual feature set of a target image, and uses an attention fusion network in the information generation model to perform attention fusion on the semantic features and the visual features, and in each time step for the computer device to generate image caption information, generates a description of the target image in the current time step based on the combined effect of the output results of the visual features and semantic features of the target image in the previous time step, thereby generating image caption information corresponding to the target image. In this way, in the process of generating image caption information, the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, so as to improve the accuracy of generating image caption information.

[0039] It should be noted that the method according to the embodiment of the present invention may be applied to the following scenarios, but is not limited to these scenarios.

[0040] 1. Scenario in which a visually impaired person obtains image information The visual function of the visually impaired (a person with visual impairment) is not normal due to reduced vision or visual field disorder, and the acquisition of visual information is impaired. For example, when a visually impaired person uses a mobile phone to view images, text, or videos, he or she cannot obtain the complete visual information content visually, so he or she needs to obtain the information in the image through hearing. One possible method is to select an area or range of an area in which the content to be viewed by the target subject exists, generate image caption information corresponding to the area through the information generating method according to an embodiment of the present invention, and convert the image caption information from text information to audio information and play it, thereby helping the visually impaired person to obtain complete image information.

[0041] 4 is a schematic diagram illustrating the selection of a corresponding target image in a video scenario according to an exemplary embodiment of the present invention. As shown in FIG. 4, the target image may be an image obtained from the video being played by the computer device based on a predetermined operation of the video being played, or an image obtained from the dynamic video of the live booth displayed in real time on the live preview interface received by the computer device based on a predetermined operation on the dynamic video. The dynamic video displayed on the live preview interface is used to help the target subject preview the real-time content in the live booth to judge whether to enter the live booth to view.

[0042] In one possible aspect, the target subject may click (a predetermined operation) on an area of ​​a video image or dynamic image and decide to capture the current image within that area (the image at the time the click operation is received) as the target image.

[0043] In order to enhance the selection of the target image of the display target, the area selected by a predetermined operation may be highlighted, for example, by highlighting, enlarging, displaying with a thick frame, etc. As shown in Fig. 4, the frame of area 410 is displayed with a thick frame.

[0044] 2. Early education scenario In early education scenarios, education through images is effective because young children have a limited range of recognition for objects and letters. In such scenarios, the information generation method according to the present invention can provide image information captions for images touched by young children, thereby transmitting information to young children from two perspectives, visual and auditory, and stimulating their learning motivation and improving the effectiveness of information transmission.

[0045] The method according to the present invention includes a model training stage and an information generation stage. Figure 5 is a schematic diagram showing the model training stage and the information generation stage according to an exemplary embodiment. As shown in Figure 5, in the model training stage, the model training device 510 uses pre-set training samples (including sample images and image caption information corresponding to the sample images, for example, the image caption information may be sequentially arranged descriptive words) to obtain a Visual-Semantic Double Attention (VSDA) model, i.e., an information generation model. The visual-semantic double attention model includes a semantic attention network, a visual attention network, and an attention fusion network.

[0046] In the information generation stage, the information generation device 520 processes the input target image based on the visual-semantic dual attention model, and obtains image caption information corresponding to the target image.

[0047] Here, the above-mentioned model training device 510 and information generating device 520 may be computer devices. For example, the computer devices may be fixed computer devices such as personal computers and servers, or mobile computer devices such as tablet computers and electronic book readers.

[0048] Preferably, the model training device 510 and the information generating device 520 may be the same device, or the model training device 510 and the information generating device 520 may be different devices. In addition, when the model training device 510 and the information generating device 520 are different devices, the model training device 510 and the information generating device 520 may be the same type of device, for example, the model training device 510 and the information generating device 520 may both be servers. Alternatively, the model training device 510 and the information generating device 520 may be different types of devices, for example, the information generating device 520 may be a personal computer or a terminal, and the model training device 510 may be a server, etc. It should be noted that the embodiment of the present invention is not limited to the specific types of the model training device 510 and the information generating device 520.

[0049] Fig. 6 is a flow chart showing a method for training an information generation model according to an exemplary embodiment of the present invention. The method can be performed by a computer device, and the computer device can be implemented as a terminal or a server. As shown in Fig. 6, the method for training an information generation model includes the following steps:

[0050] Step 610: Obtain a sample image set, where the sample image set includes at least two image samples and image caption information corresponding to the at least two image samples, respectively.

[0051] Step 620: Training is performed based on the sample image set to obtain an information generating model.

[0052] The information generation model may be a visual-semantic dual attention model, which includes a semantic attention network, a visual attention network, and an attention fusion network, where the semantic attention network is used to obtain a semantic attention vector based on a set of semantic features of an image, and the visual attention network is used to obtain a visual attention vector based on a set of visual features of an image, and the attention fusion network is used to perform attention fusion on the semantic features and visual features of the image to obtain descriptive words constituting image caption information corresponding to the image.

[0053] As described above, the method for training an information generation model according to the embodiment of the present invention obtains an information generation model including a semantic attention network, a visual attention network and an attention fusion network by training a set of sample images. In the process of generating image caption information, the above information generation model is used to generate a description of the target image in the current time step based on the combined effect of the output results of the visual features and semantic features of the target image in the previous time step, so as to generate image caption information corresponding to the target image. In this way, in the process of generating image caption information, the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, so as to improve the accuracy of generating image caption information.

[0054] In an embodiment of the present invention, the process of model training may be performed by a server, and the process of generating image caption information may be performed by the server or the terminal. If the process of generating image caption information is performed by the terminal, the server may send the trained visual-semantic dual attention model to the terminal, and the terminal may process the acquired target image by the visual-semantic dual attention model to obtain image caption information of the target image. In the following embodiment, an example is taken to describe that both the model training process and the process of generating image caption information are performed by the server. FIG. 7 is a flowchart illustrating a model training and information generating method according to an exemplary embodiment of the present invention. The method may be performed by a computer device. As shown in FIG. 7, the model training and information generating method may include the following steps:

[0055] Step 701: Obtain a sample image set, where the sample image set includes at least two image samples and image caption information corresponding to the at least two image samples, respectively.

[0056] Here, image caption information corresponding to each sample image may be labeled by a human participant.

[0057] Step 702: Training is performed based on a sample image set to obtain an information generation model.

[0058] The information generation model may be a visual-semantic dual attention model, which includes a semantic attention network, a visual attention network, and an attention fusion network, where the semantic attention network is used to obtain a semantic attention vector based on a set of semantic features of a target image, and the visual attention network is used to obtain a visual attention vector based on a set of visual features of the target image, and the attention fusion network is used to perform attention fusion on the semantic features and visual features of the target image to obtain descriptive terms constituting image caption information corresponding to the target image.

[0059] In one possible embodiment, the information generation model further includes a semantic convolutional neural network and a visual convolutional neural network, where the semantic convolutional neural network is used to process a target image, obtain a semantic feature vector of the target image, and obtain a descriptor set corresponding to the target image, and the visual convolutional neural network is used to process a target image and obtain a visual feature set corresponding to the target image.

[0060] In one possible embodiment, the process of training the information generation model is realized as follows.

[0061] Each sample image in the set of sample images is input to an information generation model to obtain predicted image caption information corresponding to each sample image.

[0062] A loss function value is calculated based on the predicted image caption information corresponding to each sample image and the image caption information corresponding to each sample image.

[0063] The parameters of the information generation model are updated based on the loss function value.

[0064] In order to ensure the accuracy of the image caption information of the target image generated when applying an information generation model, the output result of the information generation model based on a sample image (i.e., predicted image caption information) needs to be approximated to the image caption information corresponding to the sample image. Therefore, until the information generation model converges, it is necessary to perform multiple training rounds in the training process of the information generation model and update each parameter of each network in the information generation model.

[0065] Let θ be all parameters involved in the information generation model, and the ground truth sequence {w1, w2, …, w t}, that is, setting the descriptive word sequence in the image caption information of the sample image, and setting the loss function as a minimizing cross entropy loss function, the formula for calculating the loss function value corresponding to the information generation model may be expressed as follows:

[0066]

number

[0067] Step 703: Obtain a target image.

[0068] When the process of generating image caption information is performed by a server, the target image may be an image sent to the server for obtaining image caption information after the target image is obtained by the terminal. In response, the server receives the target image.

[0069] Step 704: Obtain the semantic feature vector of the target image.

[0070] In one possible embodiment, a target image is input into a semantic convolutional neural network, and a semantic feature vector of the target image is obtained output by the semantic convolutional neural network.

[0071] Here, the semantic convolutional neural network may be a fully conventional network (FCN) or a convolutional neural network (CNN). Here, CNN is a feedforward neural network, a neural network with a unidirectional multi-layer structure. There is no mutual connection between neurons in the same layer, information transmission between layers is only in one direction, and all intermediate layers except the input layer and the output layer are hidden layers, and there is one or more hidden layers. CNN can extract features from an image layer by layer directly from the features of pixels in the lower layers of the image. CNN is the most common implementation model of an encoder, and encodes an image into a vector.

[0072] The computing device can process the target image through the semantic convolutional neural network to obtain a rough graph representation vector of the target image, i.e., a semantic feature vector of the target image.

[0073] Step 705: Extract a semantic feature set of the target image based on the semantic feature vector.

[0074] In a vocabulary library, not all attribute words correspond to the target image. Therefore, performing probability calculations or verifications for all words in the vocabulary library would result in excessive and unnecessary data processing. Therefore, before acquiring the set of descriptors, the computer device may screen the attribute words in the vocabulary library based on the semantic feature vector indicating the acquired target image attributes, and acquire from the resultant set of attribute words a set of attribute words composed of attribute words corresponding to the target image, i.e., a set of candidate descriptors, and then extract the semantic features of the attribute words in the set of candidate descriptors to acquire a set of semantic features of the target image.

[0075] In one possible embodiment, the computing device may extract a corresponding attribute word set of the target image from a vocabulary library based on the semantic feature vector, where the attribute word set is a set of candidate descriptors for describing the target image.

[0076] Then, a term vector set corresponding to the attribute term set is obtained as the semantic feature set of the target image, the term vector set including term vectors corresponding to each of the candidate descriptors in the attribute term set.

[0077] The candidate descriptors in the attribute word set are attribute words that correspond to the context of the target image.The present invention is not limited by the number of candidate descriptors in the attribute word set.

[0078] Here, the candidate descriptors may include different forms of the same word, for example, play, playing, plays, etc.

[0079] In one possible aspect, the process of obtaining the matching probability of each vocabulary term, selecting candidate descriptors from a vocabulary library based on the matching probability of each vocabulary term, and constructing an attribute term set may be realized as follows.

[0080] According to the semantic feature vector, obtain a matching probability of each vocabulary in the vocabulary library, which is the probability that the vocabulary in the vocabulary library matches the target image.

[0081] From the vocabulary library, vocabulary with a matching probability greater than a matching probability threshold is extracted as candidate descriptive words, and a set of attribute words is formed.

[0082] In one possible embodiment, the probability of each attribute word in an image may be calculated by the Noisy-OR method. In order to improve the accuracy of the obtained attribute words, the probability threshold may be set to 0.5. However, the setting of the probability threshold may be adjusted according to circumstances, and the present invention is not limited thereto.

[0083] In order to improve the accuracy of acquiring attribute words, in one possible embodiment, a vocabulary detector may be pre-trained, and the vocabulary detector is used to acquire attribute words from a vocabulary library based on the feature vector of a target image. Thus, the computer may use the pre-trained vocabulary detector to acquire attribute words.

[0084] The feature vector is input to a vocabulary detector, such that the vocabulary detector extracts attribute words from a vocabulary library based on the feature vector.

[0085] Preferably, the vocabulary detector is a vocabulary detection model obtained by weakly supervised Multiple Instance Learning (MIL) learning.

[0086] Step 706: Extract a set of visual features of the target image.

[0087] In one possible embodiment, the computing device may input a target image to a visual convolutional neural network and obtain a set of visual features of the target image output by the visual convolutional neural network.

[0088] In order to improve the accuracy of the acquired visual feature set, in one possible embodiment, the computer device may pre-process the target image before extracting the visual feature set of the target image. The pre-processing process may include the following steps:

[0089] A sub-region segmentation is performed on the target image to obtain at least one sub-region.

[0090] In this case, the process of extracting a visual feature set of the target image is realized as follows.

[0091] Visual features of at least one sub-region are extracted respectively to form a visual feature set.

[0092] Here, the computer device may divide the target image at equal intervals to obtain at least one sub-region. The division interval may be set by the computer device based on the image size of the target image, and the division interval corresponding to different image sizes is different. The present invention is not limited to the number of sub-blocks and the size of the division interval.

[0093] In an embodiment of the present invention, the process of extracting a set of semantic features of the target object and the process of extracting a set of visual features of the target object may be performed synchronously, i.e., steps 704 to 705 and step 706 may be performed synchronously.

[0094] Step 707: Through the attention fusion network in the information generation model, perform attention fusion on the semantic features of the target image and the visual features of the target image in the n time steps to obtain descriptive words in the n time steps.

[0095] Taking the t-th time step in n time steps as an example, the process of obtaining the descriptor at the t-th time step may be realized as follows.

[0096] At the tth time step, the semantic attention vector at the tth time step, the visual attention vector at the tth time step, the hidden layer vector at the t-1th time step, and the output result of the attention fusion network at the t-1th time step are input into the attention fusion network to obtain the output result of the attention fusion network at the tth time step and the hidden layer vector at the tth time step.

[0097] Alternatively, at the tth time step, the semantic attention vector at the tth time step, the visual attention vector at the tth time step, and the output result of the attention fusion network at the t-1th time step are input into the attention fusion network to obtain the output result of the attention fusion network at the tth time step and the hidden layer vector at the tth time step.

[0098] In other words, in one possible embodiment, the semantic attention vector and the visual attention vector can be applied to the output result in the previous time step to obtain the output result in the current time step. Alternatively, in another possible embodiment, in order to improve the accuracy of the output result in each time step obtained, the semantic attention vector, the visual attention vector and the hidden layer vector in the previous time step can be applied to the output result in the previous time step to obtain the output result in the current time step. The output result in the current time step is the word vector of the description word of the current time step.

[0099] In order to obtain the descriptors at each time step of the target image, it is necessary to obtain the attention vector at each time step of the target image, which includes a semantic attention vector and a visual attention vector.

[0100] Taking the t-th time step as an example, when obtaining the semantic attention vector, at the t-th time step, the semantic attention vector at the t-th time step is generated based on the hidden layer vector at the t-1-th time step and the semantic feature set.

[0101] Here, the hidden layer vectors indicate intermediate content generated in generating the descriptors, and the hidden layer vectors include historical or contextual information that indicates the generation of the next descriptor, so that the next descriptor generated in the next time step is more suited to the current context.

[0102] The tth time step represents any time step among the n time steps, where n represents the number of time steps required to generate image caption information, where 1≦t≦n, and both t and n are positive integers.

[0103] When generating the semantic attention vector at the current time step, the information generation model may generate the semantic attention vector at the current time step based on the hidden layer vector at the previous time step and the semantic feature set of the target image.

[0104] In one possible aspect, the information generation model may input the hidden layer vector output at the t-1th time step and a set of semantic features of the target image into a semantic attention network in the information generation model, and obtain a semantic attention vector at the tth time step output by the semantic attention network.

[0105] The semantic attention network obtains a weight at the t-1th time step of each semantic feature in the semantic feature set based on the hidden layer vectors at the t-1th time step and the semantic feature set.

[0106] The information generation model may generate a semantic attention vector at the t-th time step based on the weights at the t-1-th time step of each semantic feature in the semantic feature set and the semantic feature set.

[0107] Here, the semantic attention vector at each time step is the sum of the weights of each attribute word, and the calculation formula is as follows:

[0108]

number

[0109] Taking the t-th time step as an example, when obtaining the visual attention vector, at the t-th time step, the visual attention vector at the t-th time step is generated based on the hidden layer vector at the t-1-th time step and the visual feature set.

[0110] When generating the visual attention vector at the current time step, the information generation model may generate the visual attention vector at the current time step based on the hidden layer vector output at the previous time step and a set of visual features of the target image.

[0111] In one possible aspect, the information generation model may input the hidden layer vector output at the t-1th time step and a set of visual features of the target image into a visual attention model in the information generation model to obtain a semantic attention vector for the tth time step output by the visual attention model.

[0112] The visual attention model obtains a weight at the t-1th time step of each visual feature in the visual feature set based on the hidden layer vectors and the visual feature set at the t-1th time step.

[0113] The information generation model may generate a visual attention vector at the t-th time step based on the weights of each visual feature in the visual feature set at the t-1-th time step and the visual feature set.

[0114] Here, the visual attention vector at each time step is the sum of the weights of the visual features of each subregion, and the calculation formula is as follows:

[0115]

number

[0116] Here, the information generation model may perform calculations according to an element-wise multiplication strategy in order to obtain better performance when calculating weights corresponding to the visual features of each sub-region.

[0117] Because the attention model can capture more detailed sub-region image features, the soft attention mechanism can adaptively focus on corresponding regions when generating descriptive vocabulary for different objects and has better performance. Therefore, the embodiment of the present invention adopts a visual attention model built on the soft attention mechanism.

[0118] The visual attention model and the semantic attention model calculate the weight of the corresponding feature vector at each time step. Because the hidden layer vectors at different time steps are different, and the weight of each feature vector obtained at each time step is different, at each time step, the information generation model may pay attention to the image focus region and the feature word to generate the image caption that is more suitable for the context at each time step.

[0119] In one possible embodiment, the attention fusion network in the information generation model may be realized as a sequence network, which may include a Long Short Term Memory (LSTM) network, a Transformer network, etc. Here, the LSTM is a time-recurrent neural network that predicts important times with relatively long intervals or delays in a time series, and is a special RNN.

[0120] Take the sequence network as an example: an LSTM network. When generating image caption information, the visual attention vector V and the semantic attention vector A are taken as additional input parameters of the LSTM network, and these two attention features are merged into the unit node of the LSTM network to guide the generation of image caption information. The guided information generation model simultaneously focuses on the visual features and semantic features of the image to make the two feature vectors complement each other.

[0121] In the embodiment of the present invention, the symbols BOS and EOS may be used to represent the beginning and end of a sentence, respectively. Based on this, the formula for the LSTM network to generate a description word based on the visual attention vector and the semantic attention vector is as follows:

[0122]

number

[0123] The LSTM outputs a probability distribution for the next word using a softmax function.

[0124]

number

[0125] In the process of generating image caption information, the visual attention feature and the semantic attention feature affect the image caption information generated by the information generation model in different aspects, so that the visual attention vector V guides the model to pay attention to the relevant area of ​​the image, and the semantic attention vector A enhances the generation of the most relevant attribute words. Considering that the two attention vectors are complementary to each other, the hyperparameters may be set in the attention fusion network to determine the optimal combination of the two attention vectors. Take the attention fusion network still as an example, the formula for the updated LSTM network to generate description words based on the visual attention vector and the semantic attention vector is as follows:

[0126]

number

[0127] The values ​​of the hyperparameters may be set according to the expression effect of the model in different weight assignments, and the present invention is not limited to the magnitude of the values ​​of the hyperparameters.

[0128] Step 708: Generate image caption information of the target image based on the descriptive words at the n time steps of the target image.

[0129] In one possible embodiment, the image caption information generated by the information generation model is caption information in a first language, for example, the first language may be English, Chinese, or other languages.

[0130] In order to make the image caption information more suitable for the usage requirements of different subjects, in one possible embodiment, when the language of the generated target image caption information is a non-predetermined language, the computer device may change the generated caption information of the first language to caption information of a predetermined language. For example, when the image caption information generated by the information generation model is English caption information and the predetermined language required by the target subject is Chinese, when the image caption information in English is generated by the information generation model, the computer device may translate the English image caption information into Chinese image caption information and output it.

[0131] Here, the language type of the output image caption information, i.e., the type of a predetermined language, may be set according to actual needs depending on the related object, but the present invention is not limited to the language type of the image caption information.

[0132] In one possible aspect, since the generated image caption information is text information, in order for the target subject to easily receive the image caption information, the computer device may convert the text-type image caption information into audio-type image caption information based on TTS (Text-To-Speech) technology, and transmit the image caption information to the target subject in the form of audio playback.

[0133] The above process may be realized as follows: the server converts the acquired text-type image caption information into voice-type image caption information through TTS technology, and then: The server may send voice-type image caption information to the terminal, so that the terminal plays the image caption information according to the acquired voice-type image caption information. Alternatively, the server may send text-type image caption information to the terminal, and the terminal may convert the text-type image caption information into voice-type image caption information through TTS technology, and then play the image caption information in voice.

[0134] As described above, the model training and information generation method according to the embodiment of the present invention respectively extracts a semantic feature set and a visual feature set of a target image, and uses an attention fusion network in the information generation model to perform attention fusion on the semantic features and the visual features, and in each time step for generating image caption information, generates a description of the target image in the current time step based on the combined effect of the output results of the visual features and semantic features of the target image in the previous time step, thereby generating image caption information corresponding to the target image. In this way, in the process of generating image caption information, the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, so as to improve the accuracy of generating image caption information.

[0135] In addition, before the semantic attention network obtains the weight of each attribute word, the vocabulary in the vocabulary library is screened according to the feature vector of the image, the attribute words related to the image are obtained as candidate descriptive words, and the weight calculation is performed according to the candidate descriptive words, thereby reducing the data processing amount of the semantic attention network, ensuring the processing accuracy, and reducing the data processing pressure of the information generation model.

[0136] Take as an example that the attention fusion network is an LSTM network, and the input of the attention fusion network includes the hidden layer vector of the previous time step, the output result of the previous time step, the visual attention vector of the current time step, and the semantic attention vector of the current time step. Figure 8 is a schematic diagram showing a process of generating image caption information according to one exemplary embodiment of the present invention. As shown in Figure 8, after a computer device obtains a target image 810, it inputs the target image 810 into an information generation model 820. The information generation model 820 inputs the target image 810 into a semantic convolutional neural network 821 to obtain a semantic feature vector of the target image. Then, a vocabulary detector 822 screens attribute words in a vocabulary library according to the semantic feature vector of the target image, obtains a candidate description word 823 corresponding to the target image, and obtains a semantic feature set corresponding to the target image. At the same time, the information generation model 820 inputs the target image 810 into a visual convolutional neural network 824 to obtain a visual feature set 825 corresponding to the target image. The semantic attention network 826 calculates the semantic attention vector A at the current time step based on the hidden layer vector output at the previous time step. t The semantic feature set is input to the semantic attention network 826 to obtain a visual attention vector V at the current time step based on the hidden layer vector output at the previous time step, where t represents the current time step, where t=1, the hidden layer vector output at the previous time step is the preset hidden layer vector. Accordingly, the visual attention network 827 obtains a visual attention vector V at the current time step based on the hidden layer vector output at the previous time step. t The set of visual features is input to the visual attention network 827 to obtain a visual attention vector V t , Semantic attention vector A t , the hidden layer vector output at the previous time step and the descriptor x t (i.e. y t-1) into the LSTM network 828, and the descriptor y t Here, when t=1, the description word output in the previous time step is a preset start word or character. The above process is repeated until the description word obtained by the LSTM network is an end word or terminal character. The computer device sorts each obtained description word according to the order of acquisition to obtain image caption information 830 of the target image.

[0137] Here, Fig. 9 is a schematic diagram illustrating the input and output of the attention fusion network according to one exemplary embodiment of the present invention. As shown in Fig. 9, for the t-th time step, the input of the attention fusion network 910 is the hidden layer vector h t-1 And, h t-1 The visual attention vector V at the t-th time step is generated based on t And, h t-1 The semantic attention vector A generated based on t and the graph representation vector of the descriptors output at the t-1th time step (i.e., the output vector y t-1 ) The output of the attention fusion network 910 is the output vector (y t ) and the hidden layer vector (h t :used to generate the next descriptor), where the visual attention vector is calculated by the visual attention network 930 based on a weighted sum of visual features corresponding to each sub-region, and the semantic attention vector is calculated by the semantic attention network 920 based on a weighted sum of each attribute term.

[0138] It should be noted that, although specific embodiments of the present invention refer to data related to target images and the like, when the above embodiments of the present invention are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws and regulations and standards of the relevant countries and regions.

[0139] 10 is a block diagram showing the configuration of an information generating device according to an exemplary embodiment of the present invention. As shown in FIG. 10, the device includes the following modules:

[0140] The image acquisition module 1010 acquires a target image.

[0141] The feature extraction module 1020 extracts a set of semantic features of the target image and extracts a set of visual features of the target image.

[0142] The descriptor acquisition module 1030 performs attention fusion on the semantic features of the target image and the visual features of the target image in n time steps to obtain descriptors in n time steps. The input of the attention fusion process in the t-th time step includes the semantic attention vector in the t-th time step, the visual attention vector in the t-th time step, and the output result of the attention fusion process in the t-1-th time step, where the semantic attention vector in the t-th time step is obtained by performing attention mechanism processing on the semantic feature set in the t-th time step, the visual attention vector in the t-th time step is obtained by performing attention mechanism processing on the visual feature set in the t-th time step, and the output result of the attention fusion process in the t-1-th time step is used to indicate the descriptor in the t-1-th time step, where the t-th time step is any one of the n time steps, where 1≦t≦n, t and n are all positive integers.

[0143] The information generation module 1040 generates image caption information for the target image based on the descriptive words at the n time steps of the target image.

[0144] In one possible aspect, the descriptor acquisition module 1030 performs attention fusion on the semantic features of the target image and the visual features of the target image at n time steps using an attention fusion network in the information generation model to acquire descriptors at n time steps.

[0145] In one possible aspect, at the tth time step, the descriptor acquisition module 1030 inputs the semantic attention vector at the tth time step, the visual attention vector at the tth time step, the hidden layer vector at the t-1th time step, and the output result of the attention fusion network at the t-1th time step into the attention fusion network, and obtains the output result of the attention fusion network at the tth time step and the hidden layer vector at the tth time step.

[0146] Alternatively, at the tth time step, the descriptor acquisition module 1030 inputs the semantic attention vector at the tth time step, the visual attention vector at the tth time step, and the output result of the attention fusion network at the t-1th time step into the attention fusion network, and obtains the output result of the attention fusion network at the tth time step and the hidden layer vector at the tth time step.

[0147] In one possible aspect, hyperparameters are set for the attention fusion network, and the hyperparameters indicate the respective weights of the visual attention vector and the semantic attention vector in the attention fusion network.

[0148] In one possible embodiment, the device further comprises the following modules:

[0149] The first generation module generates a semantic attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and the semantic feature set at the t-th time step.

[0150] In one possible embodiment, the first generation module includes the following sub-modules:

[0151] The first obtaining sub-module obtains a weight at the t-1th time step of each semantic feature in the semantic feature set according to the hidden layer vector at the t-1th time step and the semantic feature set.

[0152] The first generation sub-module generates a semantic attention vector at the t-th time step based on the weight at the t-1-th time step of each semantic feature in the semantic feature set and the semantic feature set.

[0153] In one possible embodiment, the device further comprises the following modules:

[0154] The second generation module generates a visual attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and the visual feature set at the t-th time step.

[0155] In one possible embodiment, the second generation module includes the following sub-modules:

[0156] The second acquisition sub-module acquires a weight at the t-1th time step of each visual feature in the visual feature set based on the hidden layer vector at the t-1th time step and the visual feature set.

[0157] The second generation sub-module generates a visual attention vector at the t-th time step based on the weights of each visual feature in the visual feature set at the t-1-th time step and the visual feature set.

[0158] In one possible embodiment, the feature extraction module 1020 includes the following sub-modules:

[0159] The third acquisition sub-module acquires a semantic feature vector of the target image.

[0160] The extraction sub-module extracts a set of semantic features of the target image based on the semantic feature vector.

[0161] In one possible embodiment, the extraction sub-module includes the following parts:

[0162] The attribute word extraction unit extracts an attribute word set corresponding to the target image from the vocabulary library based on the semantic feature vector, The attribute word set is a set of candidate descriptive words for describing the target image.

[0163] The semantic feature extraction unit acquires a set of word vectors corresponding to the set of attribute words as a set of semantic features of the target image.

[0164] In one possible embodiment, the attribute term extractor obtains a matching probability of each vocabulary in the vocabulary library according to the semantic feature vector, the matching probability being a probability that the vocabulary in the vocabulary library matches the target image.

[0165] The attribute word extraction unit extracts, from the vocabulary library, vocabulary having a matching probability greater than a matching probability threshold as candidate descriptive words, and configures a set of attribute words.

[0166] In one possible embodiment, the attribute word extraction unit inputs the semantic feature vector to a vocabulary detector, and obtains a set of attribute words extracted from a vocabulary library by the vocabulary detector based on the semantic feature vector.

[0167] Here, the vocabulary detector is a vocabulary detection model obtained by weakly supervised learning of multi-instance learning.

[0168] In one possible embodiment, before the feature extraction module 1020 extracts a set of visual features of the target image, the apparatus further includes the following modules:

[0169] A sub-region segmentation module performs sub-region segmentation on the target image to obtain at least one sub-region.

[0170] The feature extraction module 1020 extracts visual features of at least one sub-region each to construct a visual feature set.

[0171] As described above, the information generating device according to the embodiment of the present invention respectively extracts a semantic feature set and a visual feature set of a target image, performs attention fusion on the semantic features and the visual features in n time steps, and in each time step for the computer device to generate image caption information, generates a description of the target image in the current time step based on the combined effect of the output result of the visual features and semantic features of the target image in the previous time step, thereby generating image caption information corresponding to the target image. In this way, in the process of generating image caption information, the advantages of visual features in generating visual vocabulary and the advantages of semantic features in generating non-visual features complement each other, so as to improve the accuracy of generating image caption information.

[0172] 11 is a block diagram showing a configuration of a computer device 1100 according to an exemplary embodiment of the present invention. The computer device may be realized as a server in the above-mentioned embodiment of the present invention. The computer device 1100 includes a central processing unit (CPU) 1101, a system memory 1104 including a random access memory (RAM) 1102 and a read-only memory (ROM) 1103, and a system bus 1105 connected to the system memory 1104 and the central processing unit 1101. The computer device 1100 also includes a mass storage device 1106 for storing an operating system 1109, an application program 1110, and other program modules 1111.

[0173] It should be noted that the computer readable medium may include computer storage media and communication media. Computer storage media include RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, tape cartridge, magnetic tape, disk storage, or other magnetic storage devices. It should be noted that the computer storage media is not limited to the above, as will be appreciated by those skilled in the art. The above system memory 1104 and mass storage device 1106 may be collectively referred to as memory.

[0174] The memory stores at least one instruction, at least one program, code set or instruction set, which is executed by the central processing unit 1101 to realize all or part of the steps in the information generation method of each of the above embodiments.

[0175] 12 is a block diagram showing a configuration of a computer device 1200 according to an exemplary embodiment of the present invention. The computer device 1200 may be realized as the face quality assessment device and / or the quality assessment model training device described above, such as a smartphone, a tablet computer, a laptop computer, or a desktop computer. The computer device 1200 may be called a terminal device, a mobile terminal, a laptop terminal, a desktop terminal, or other names.

[0176] Typically, the computing device 1200 includes a processor 1201 and a memory 1202 .

[0177] The processor 1201 may include one or more processing cores.

[0178] The memory 1202 may include one or more computer-readable storage media, which may be tangible and non-transitory. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 is used to store at least one instruction, which is executed by the processor 1201 to implement an information generation method according to a method embodiment of the present invention.

[0179] In some embodiments, the computing device 1200 may preferably further include a peripheral interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral interface 1203 may be connected via a bus or signal lines. Each peripheral device may be connected to the peripheral interface 1203 via a bus, signal lines, or a circuit board. Specifically, the peripheral devices include at least one of a radio frequency circuit 1204, a display screen 1205, a camera component 1206, an audio circuit 1207, and a power source 1208.

[0180] In some embodiments, the computing device 1200 further includes one or more sensors 1209, including, but not limited to, an acceleration sensor 1210, a gyroscope sensor 1211, a pressure sensor 1212, an optical sensor 1213, and a proximity sensor 1214.

[0181] However, as will be appreciated by those skilled in the art, computing device 1200 is not limited to the configuration shown in FIG. 12 and may include more or fewer components than those shown, may combine certain components, or may employ different arrangements of components.

[0182] In one exemplary embodiment, there is further provided a computer-readable storage medium having at least one computer program stored thereon, which is loaded and executed by a processor to implement all or part of the steps in the information generating method described above. For example, the computer-readable storage medium includes a ROM (Read-Only Memory), a RAM (Random-Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0183] In one exemplary embodiment, there is further provided a computer program product including at least one computer program, which is loaded and executed by a processor to implement all or part of the steps of the method according to any of the embodiments of Figures 2, 6 or 7 above.

Claims

1. 1. A computer device implemented information generation method, comprising: acquiring a target image; extracting a set of semantic features of the target image; and extracting a set of visual features of the target image. performing attention fusion on semantic features of the target image and visual features of the target image at n time steps to obtain descriptive words at the n time steps, wherein an input at a t-th time step of the attention fusion process includes a semantic attention vector at the t-th time step, a visual attention vector at the t-th time step, and an output result at a t-1-th time step of the attention fusion process, the semantic attention vector at the t-th time step is obtained by performing an attention mechanism process on the semantic feature set at the t-th time step, the visual attention vector at the t-th time step is obtained by performing an attention mechanism process on the visual feature set at the t-th time step, and the output result at the t-1-th time step of the attention fusion process is used to indicate a descriptive word at the t-1-th time step, the t-th time step being any one of the n time steps, 1≦t≦n, t and n are both positive integers; generating image caption information for the target image based on descriptive words at the n time steps of the target image; The step of extracting a set of semantic features of the target image includes: obtaining a semantic feature vector of the target image; extracting the set of semantic features of the target image based on the semantic feature vector; Extracting the set of semantic features of the target image based on the semantic feature vector includes: extracting an attribute word set corresponding to the target image from a vocabulary library based on the semantic feature vector, the attribute word set being a set of candidate descriptors for describing the target image; obtaining a set of term vectors corresponding to the set of attribute words as the set of semantic features of the target image; The step of extracting an attribute word set corresponding to the target image from a vocabulary library based on the semantic feature vector includes: obtaining a matching probability for each vocabulary in the vocabulary library based on the semantic feature vector, the matching probability being a probability that a vocabulary in the vocabulary library matches the target image; extracting, from the vocabulary library, vocabulary terms having a matching probability greater than a matching probability threshold as the candidate descriptors, and configuring the attribute word set.

2. The step of performing attention fusion on the semantic features of the target image and the visual features of the target image in the n time steps to obtain descriptors in the n time steps includes: The method of claim 1 , comprising a step of performing attention fusion on semantic features of the target image and visual features of the target image at n time steps using an attention fusion network in an information generation model to obtain descriptive words at the n time steps.

3. The step of performing attention fusion on the semantic features of the target image and the visual features of the target image at n time steps by an attention fusion network in the information generation model to obtain descriptive words at the n time steps includes: At the t-th time step, inputting the semantic attention vector at the t-th time step, the visual attention vector at the t-th time step, the hidden layer vector at the t-1-th time step, and the output result of the attention fusion network at the t-1-th time step into the attention fusion network, and obtaining the output result of the attention fusion network at the t-th time step and the hidden layer vector at the t-th time step; or The method of claim 2, comprising the step of inputting the semantic attention vector at the t-th time step, the visual attention vector at the t-th time step, and the output result of the attention fusion network at the t-1-th time step into the attention fusion network at the t-th time step, and obtaining the output result of the attention fusion network at the t-th time step and the hidden layer vector at the t-th time step.

4. The attention fusion network is configured with hyperparameters, The method of claim 2 or 3, wherein the hyper-parameters indicate respective weights of the visual attention vector and the semantic attention vector in the attention fusion network.

5. The method of claim 3, further comprising: at the t-th time step, generating the semantic attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and the semantic feature set.

6. At the t-th time step, generating the semantic attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and the semantic feature set includes: obtaining a weight at the t-1th time step of each semantic feature in the semantic feature set based on the hidden layer vectors at the t-1th time step and the semantic feature set; The method of claim 5, further comprising: generating the semantic attention vector at the t-1th time step based on the weight of each semantic feature in the semantic feature set at the t-1th time step; and generating the semantic attention vector at the t-th time step based on the semantic feature set.

7. The method of claim 3, further comprising: at the t-th time step, generating the visual attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and a visual feature set.

8. At the t-th time step, generating the visual attention vector at the t-th time step based on the hidden layer vector at the t-1-th time step and a visual feature set, obtaining a weight for each visual feature in the visual feature set at the t-1-th time step based on the hidden layer vectors and the visual feature set at the t-1-th time step; The method of claim 7, further comprising: generating the visual attention vector at the t-1th time step based on the weights of each visual feature in the visual feature set at the t-1th time step and the visual feature set.

9. The step of extracting an attribute word set corresponding to the target image from a vocabulary library based on the semantic feature vector includes: inputting the semantic feature vector into a vocabulary detector, and obtaining the attribute word set extracted from the vocabulary library by the vocabulary detector based on the semantic feature vector; The method of claim 1 , wherein the vocabulary detector is a vocabulary detection model obtained by weakly supervised multi-instance learning.

10. Prior to extracting the visual feature set of the target image, performing sub-region segmentation on the target image to obtain at least one sub-region; The step of extracting a set of visual features of the target image comprises: The method according to claim 1 , further comprising the step of extracting visual features of each of the at least one sub-region and forming the visual feature set.

11. An information generating device, an image capture module for capturing a target image; a feature extraction module for extracting a set of semantic features of the target image and for extracting a set of visual features of the target image; a descriptor acquisition module that performs attention fusion on semantic features of the target image and visual features of the target image at n time steps to acquire descriptors at the n time steps, wherein an input at a t-th time step of the attention fusion process includes a semantic attention vector at the t-th time step, a visual attention vector at the t-th time step, and an output result at a t-1-th time step of the attention fusion process, the semantic attention vector at the t-th time step is obtained by performing an attention mechanism process on the semantic feature set at the t-th time step, the visual attention vector at the t-th time step is obtained by performing an attention mechanism process on the visual feature set at the t-th time step, and the output result at the t-1-th time step of the attention fusion process is used to indicate a descriptor at the t-1-th time step, the t-th time step being any one of the n time steps, 1≦t≦n, t and n are both positive integers; an information generating module that generates image caption information of the target image based on descriptive words at the n time steps of the target image; The feature extraction module: a third acquisition sub-module for acquiring a semantic feature vector of the target image; an extraction submodule for extracting the set of semantic features of the target image based on the semantic feature vector; The extraction sub-module: an attribute word extraction unit that extracts an attribute word set corresponding to the target image from a vocabulary library based on the semantic feature vector, the attribute word set being a set of candidate descriptive words for describing the target image; a semantic feature extraction unit that acquires a word vector set corresponding to the attribute word set as the semantic feature set of the target image, The attribute word extraction unit Obtain a matching probability for each vocabulary in the vocabulary library based on the semantic feature vector, the matching probability being a probability that a vocabulary in the vocabulary library matches the target image; The apparatus extracts, from the vocabulary library, vocabulary whose matching probability is greater than a matching probability threshold as the candidate descriptors, and configures the attribute word set.

12. The description acquisition module includes: The device of claim 11, wherein an attention fusion network in an information generation model performs attention fusion on semantic features of the target image and visual features of the target image at n time steps to obtain descriptors at the n time steps.

13. The description acquisition module includes: At the t-th time step, input the semantic attention vector at the t-th time step, the visual attention vector at the t-th time step, the hidden layer vector at the t-1-th time step, and the output result of the attention fusion network at the t-1-th time step into the attention fusion network, and obtain the output result of the attention fusion network at the t-th time step and the hidden layer vector at the t-th time step; or The device of claim 12, wherein at the t-th time step, the semantic attention vector at the t-th time step, the visual attention vector at the t-th time step, and the output result of the attention fusion network at the t-1-th time step are input into the attention fusion network to obtain the output result of the attention fusion network at the t-th time step and the hidden layer vector at the t-th time step.

14. The attention fusion network is configured with hyperparameters, The apparatus of claim 12 or 13, wherein the hyper-parameters indicate respective weights of the visual attention vector and the semantic attention vector in the attention fusion network.

15. A computing device comprising a processor and a memory having stored therein at least one computer program, the computer program being loaded and executed by the processor so as to implement an information generation method according to any one of claims 1 to 10.

16. A computer-readable storage medium having stored thereon at least one computer program, the computer program being loaded and executed by a processor so as to implement the information generating method according to any one of claims 1 to 10.

17. A computer program that is loaded and executed by a processor to implement the information generating method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image description method and system based on vision and semantic attention combined strategy

    CN107563498A

  • Image subtitle generation method and system fusing visual attention and semantic attention

    CN107608943A

  • Fine-grained image description method and system based on multistage attention

    CN110472642A

  • Cross-modal image semantic extraction method, system and device and medium

    CN111144410A