WO2021088935A1 - 对抗网络架构的优化方法、图像描述生成方法和系统 - Google Patents

对抗网络架构的优化方法、图像描述生成方法和系统 Download PDF

Info

Publication number
WO2021088935A1
WO2021088935A1 PCT/CN2020/126829 CN2020126829W WO2021088935A1 WO 2021088935 A1 WO2021088935 A1 WO 2021088935A1 CN 2020126829 W CN2020126829 W CN 2020126829W WO 2021088935 A1 WO2021088935 A1 WO 2021088935A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
image description
model
training
network architecture
Prior art date
Application number
PCT/CN2020/126829
Other languages
English (en)
French (fr)
Inventor
杨敏
刘俊浩
李成明
姜青山
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2021088935A1 publication Critical patent/WO2021088935A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Definitions

  • This application relates to the field of computer technology, and in particular to a method for optimizing a network architecture against a countermeasure, an image description generation method, system, electronic equipment, and device.
  • image description generation algorithms are often used to automatically generate image description information that matches the content in the image.
  • the commonly used generation method is to use the Encoder-Decoder (encoder-decoder) structure to use Convolutional Neural Networks (CNN) as an encoder to encode image information from pixel space to hidden space, and then loop Recurrent Neural Networks (RNN) is used as a decoder to decode the image information encoded in the hidden space into the language space.
  • Encoder-Decoder encoder-decoder
  • CNN Convolutional Neural Networks
  • RNN loop Recurrent Neural Networks
  • the inventor of the present application found that the above-mentioned generation method has the problem that it is easy to produce universal or low-information image descriptions, and these image descriptions cannot properly reflect the meaning of a given image.
  • the present application provides an optimization method, image description generation method, system, electronic equipment, and device for countering network architecture, which can solve the technical problem of poor generation quality in the image description generation method provided by related technologies.
  • this application provides a method for optimizing a confrontation network architecture.
  • the method includes the following steps: constructing a confrontation network architecture; training images to perform confrontation optimization training on the confrontation network architecture to obtain an optimized confrontation network architecture.
  • the latter confrontation network architecture is an optimized confrontation network architecture as described above.
  • this application provides an optimization system for a confrontation network architecture.
  • the system includes: a construction unit for building a confrontation network architecture; a confrontation optimization training unit for training an image to optimize the confrontation network architecture. Train to get an optimized confrontation network architecture.
  • the present application provides an image description generation method to obtain the image to be described; input the image to be described into the optimized confrontation network architecture to obtain the optimal image description of the image to be described, wherein the optimized confrontation network
  • the architecture is a confrontation network architecture optimized as described above.
  • the present application provides an image description information generation system, including: an acquisition unit for acquiring an image to be described; an input unit for inputting the above-mentioned target image into a target image description information generation network, wherein In the optimized confrontation network architecture after image input, the optimal image description of the image to be described is obtained, and the optimized confrontation network architecture is the confrontation network architecture optimized by the aforementioned method.
  • the present application provides an electronic device.
  • the electronic device includes: a memory storing computer-readable instructions; a processor reading the computer-readable instructions stored in the memory to execute the aforementioned method for optimizing the anti-network architecture.
  • the present application provides a device with a storage function.
  • the device stores computer-readable instructions.
  • the computer-readable instructions are executed by the processor of the computer, the computer executes the aforementioned optimization method against the network architecture.
  • the beneficial effects of this application are: different from the situation in the prior art, this application is different from the situation in the prior art.
  • the training image is used to conduct confrontation optimization training on the confrontation network architecture to obtain the optimized result
  • the adversarial network architecture The confrontation optimization training can enable the reinforcement learning of the confrontation network architecture, thereby achieving comprehensive optimization of the image description generated by the confrontation network architecture, thereby improving the quality of image description information generation, and overcoming the image description information generation method provided by related technologies. There is a technical problem of poor production quality.
  • Figure 1 is a schematic flow diagram of an implementation of the method for optimizing the anti-network architecture of the present application
  • FIG. 2 is a schematic flowchart of step S20 in FIG. 1;
  • FIG. 3 is another flowchart of step S20 in FIG. 1;
  • FIG. 4 is another schematic diagram of the process of step S20 in FIG. 1;
  • FIG. 5 is another schematic diagram of the flow of step S20 in FIG. 1;
  • FIG. 6 is a schematic flowchart of step S210 in FIG. 3;
  • FIG. 7 is a schematic flowchart of step S220 in FIG. 3;
  • FIG. 8 is a schematic flowchart of step S26 in FIG. 4;
  • FIG. 9 is a schematic flowchart of step S27 in FIG. 4;
  • FIG. 10 is a schematic flowchart of step S28 in FIG. 4;
  • FIG. 11 is a schematic flowchart of an embodiment of an image description generating method according to the present application.
  • FIG. 12 is a schematic structural diagram of an implementation manner of the optimization system for the confrontation network architecture of the present application.
  • FIG. 13 is a schematic structural diagram of an embodiment of the image description information generation system of the present application.
  • FIG. 14 is a schematic structural diagram of an embodiment of an electronic device of the present application.
  • FIG. 15 is a schematic structural diagram of an embodiment of a device with a storage function according to the present application.
  • CNN Convolutional Neural Networks, used to extract image features in images.
  • RNN Recurrent Neural Networks, used for language modeling and learning context features.
  • R-CNN A region-based convolutional neural network (Region-based CNN) for target detection and positioning.
  • Faster R-CNN An improved version of R-CNN, faster and more effective.
  • LSTM Long-Short Term Memory Networks (Long-Short Term Memory Networks), which can learn long-term relationships and is the most widely used RNN.
  • CNN-RNN structure CNN is used as an encoder, RNN is used as a decoder, and a general framework for image description algorithms.
  • Attention mechanism Attention mechanism, weighted calculation of input features in RNN modeling.
  • Self-critical A reinforcement learning method based on policy gradient.
  • policy gradient policy gradient, a method of reinforcement learning, which directly learns each update strategy.
  • BLEU Bilingual Evaluation Understudy, mainly used for quality evaluation of machine translation.
  • METEOR A quality evaluation standard for translation in any language.
  • CIDEr Consensus-based image description evaluation for image description.
  • SPICE Semantic Propositional Image Caption Evaluation based on semantics.
  • MSCOCO Microsoft Common Objects in Context data set, used for key point detection, target detection, picture description, etc.
  • Genome A data set of densely annotated images.
  • FIG. 1 is a schematic flowchart of an implementation manner of an optimization method for an adversarial network architecture according to the present application.
  • the method includes the following steps:
  • S20 Use training images to conduct confrontation optimization training on the confrontation network architecture to obtain an optimized confrontation network architecture.
  • the present application is different from the situation of the prior art.
  • the confrontation optimization training is performed on the confrontation network architecture through training images to obtain the optimized confrontation network architecture.
  • the confrontation optimization training can enable the reinforcement learning of the confrontation network architecture, thereby achieving comprehensive optimization of the image description generated by the confrontation network architecture, thereby improving the quality of image description information generation, and overcoming the image description information generation method provided by related technologies. There is a technical problem of poor production quality.
  • FIG. 2 is a schematic flowchart of step S20 in FIG. 1.
  • the confrontation network architecture includes: a first generation model, a second generation model, a first discriminant model, and a second discriminant model.
  • Step S20 includes the following steps:
  • S23 Determine the first image description, the second image description, and the matched image description by the first discriminant model and the second discriminant model, and output a scoring result.
  • the matched image description is a real image description generated by describing the training image.
  • S25 The first generation model and the second generation model generate higher-scoring first image descriptions and second image descriptions according to the scoring results, and perform the next round of iteration until the generated scoring results no longer improve.
  • ⁇ 1 represents the model parameters of the first generative model
  • ⁇ 2 represents the model parameters of the second generative model
  • E represents the mathematical expectation
  • y + represents the matching image description
  • y - represents the unmatched image description
  • y gen represents the first image description or the second image description
  • step S21 includes the following steps:
  • S210 Describe the training image by using the first generation model to generate several first image descriptions.
  • Step S22 includes the following steps:
  • S220 Search the database by using the second generation model to obtain a number of second image descriptions related to the training images in the database, and generate an image description candidate pool.
  • the image description candidate pool includes a first image description and a second image description.
  • FIG. 4 is another flowchart of step S20 in FIG. 1, and step S20 further includes the following steps:
  • S26 Sort each image description in the image description candidate pool by the second generation model.
  • S27 Determine whether the first image description is an image description generated or matched by the first generation model by using the first discriminant model.
  • step S20 further includes:
  • S201 Use the gradient descent method to optimize the first discriminant model and the second discriminant model.
  • the first objective function is expressed as:
  • the second objective function is expressed as:
  • y greedy represents the result of using greedy decoding in the decoding process as a benchmark for the strategy training process to reduce the reward variance during the training process.
  • the reward functions R 1 and R 2 are as follows:
  • ⁇ , ⁇ , ⁇ represent the weight coefficients that control the reward weight, Represents the evaluation index used to calculate the quality of the production.
  • the aforementioned model may, but is not limited to, include one or more evaluation indicators for evaluating the generation quality of the image description, such as BLEU, ROUGE, METEOR, CIDEr, SPICE, etc.
  • evaluation indicators for evaluating the generation quality of the image description such as BLEU, ROUGE, METEOR, CIDEr, SPICE, etc.
  • the above-mentioned parameters are related to human subjective judgments of image descriptions. Therefore, the comprehensive evaluation scores of the above-mentioned parameters can achieve the effect of objectively reflecting the generation quality of the image description.
  • the first generation model adopts an image encoder-text decoder architecture
  • the image encoder includes FasterR-CNN neural network and text decoder Including two-layer LSTM network.
  • the image encoder is used to obtain image features
  • the text decoder converts the encoding features into descriptive sentences.
  • Step S210 includes:
  • S211 Use the Faster R-CNN neural network to extract the visual features z in the training image x.
  • the visual feature z is an L ⁇ D-dimensional vector z init .
  • the vector z init can be input to the attention mechanism to perform weighted average processing to obtain the attention weight ⁇ i .
  • x represents the training image
  • z init represents the L ⁇ D-dimensional vector
  • represents the feedforward neural network, which is used to map the vector to the real value
  • f FC represents the fully connected network
  • ⁇ i represents the The attention weight of i image features z init, i , H c represents the guide description feature G c .
  • the first generative model is similar to the top-down method, which includes two layers of LSTM, among which, the first layer of LSTM is Top-Down Attention LSTM, and the second layer is the Top-Down Attention LSTM.
  • LSTM is a language long and short-term memory network (language LSTM).
  • LSTM (1) represents the first layer LSTM.
  • represents a feedforward network
  • ⁇ t,i represents the attention weight of the i-th visual feature z init,i at the t-th moment
  • z represents the visual feature
  • the second layer LSTM is the hidden state of the first layer LSTM at time t
  • visual attention Is the input and outputs the hidden state of the second layer of LSTM at time t among them,
  • LSTM (2) represents the second layer of LSTM.
  • the first generative model is a classifier on the vocabulary.
  • S217 The hidden state of the second layer LSTM at time t Input to a fully connected layer for classification to generate the first image description.
  • the Faster R-CNN neural network includes a fully connected layer.
  • the fully connected layer is used to determine the target category, that is, for classification.
  • Step S217 can be expressed as:
  • W c represents the learning parameter
  • ⁇ 1 represents the first generative model Parameters
  • step S220 includes the following steps:
  • S221 retrieve the database by using the second generation model to retrieve M2 candidate images that best match the training image to obtain corresponding M2 second image descriptions
  • the second generation model is used to retrieve candidate second image descriptions in the database.
  • e(w i ) represents the word embedding vector of the i-th word in the guide description.
  • Each guide description c i can be represented by the hidden state when encoding
  • m represent the length of the guide description c i.
  • the final boot description vector can be expressed as Where ⁇ represents the averaging function.
  • step S26 includes:
  • S261 Use the LSTM network to encode each image description p into an embedded representation o through the second generation model.
  • the image description pair corresponding to the training image x is ⁇ p1, p2>.
  • S263 Calculate the estimated probability that p1 is more relevant than p2.
  • output is used to determine the true and false probability values of the image descriptions p1 and p2 generated by the first generation model and the second generation model that match the training image x.
  • the specific expression is:
  • represents the sigmoid activation function
  • g represents any scoring function
  • step S26 the method further includes the following steps:
  • the second generation model is optimized based on the triplet ranking loss function to maximize the correlation between the training image and the matched image description, and at the same time, minimize the correlation between the training image and the first image description or the second image description.
  • triplet sorting loss function is expressed as:
  • y+ indicates the matching image description
  • y gen indicates the first image description or the second image description.
  • step S27 includes the following steps:
  • the first discriminant model includes a binary classifier based on the LSTM network.
  • S272 The binary classifier based on the LSTM network judges whether the first image description is an image description generated or matched by the first generation model.
  • step S28 includes the following steps:
  • step S28 the method further includes the following steps:
  • the second discriminant model is optimized based on the triplet ranking loss function to maximize the correlation between the training image and the matched image description, and at the same time, minimize the correlation between the training image and the first image description or the second image description.
  • triplet sorting loss function is expressed as:
  • y+ indicates the matching image description
  • y gen indicates the first image description or the second image description.
  • the MSCOCO data set contains 110,000 training set images with description tags, 5,000 verification sets, and 5,000 test sets.
  • this method is always superior to other best methods for generating image descriptions, showing great advantages and having a very broad application prospect.
  • FIG. 11 is a schematic flowchart of an embodiment of an image description generating method according to the present application. The method includes the following steps:
  • the optimized confrontation network architecture is the optimized confrontation network architecture in the foregoing embodiment.
  • FIG. 12 is a schematic structural diagram of an embodiment of the optimization system of the confrontation network architecture of the present application.
  • the system 10 includes:
  • the construction unit 11 is used to construct a confrontation network architecture.
  • the adversarial optimization training unit 12 is used to perform adversarial optimization training on the adversarial network architecture through the training images to obtain an optimized adversarial network architecture.
  • the present application is different from the situation of the prior art.
  • the confrontation optimization training is performed on the confrontation network architecture through training images to obtain the optimized confrontation network architecture.
  • the confrontation optimization training can enable the reinforcement learning of the confrontation network architecture, thereby achieving comprehensive optimization of the image description generated by the confrontation network architecture, thereby improving the quality of image description information generation, and overcoming the image description information generation method provided by related technologies. There is a technical problem of poor production quality.
  • FIG. 13 is a schematic structural diagram of an embodiment of the image description information generation system of the present application.
  • the generation system 20 includes: an acquisition unit 21 for acquiring an image to be described; an input unit 22 for inputting the above-mentioned target image into the target image
  • the description information generation network wherein the image to be described is input into the optimized confrontation network architecture to obtain the optimal image description of the image to be described, and the optimized confrontation network architecture is the confrontation network architecture optimized by the aforementioned method.
  • FIG. 14 is a schematic structural diagram of an embodiment of an electronic device of the present application.
  • the electronic device may also be a smart phone (such as Android Mobile phones, iOS phones, etc.), tablet computers, handheld computers, and mobile Internet devices (MID), PAD and other terminal devices.
  • FIG. 14 does not limit the structure of the above-mentioned electronic device.
  • the electronic device may also include more or fewer components (such as a network interface, etc.) than shown in FIG. 14, or have a configuration different from that shown in FIG.
  • the electronic device 30 includes a memory 31 and a processor 32.
  • the memory 31 stores computer readable instructions.
  • the processor 32 is connected to the memory 31, and the processor 32 reads computer-readable instructions stored in the memory to execute the method for optimizing the anti-network architecture in the foregoing embodiment.
  • the memory is configured to store instructions and applications executable by the processor. It can also cache the data to be processed or processed by the modules in the processor and the information processing equipment. It can be through flash memory (FLASH) or random access memory (Random Access Memory, RAM) implementation.
  • FIG. 15 is a schematic structural diagram of an embodiment of a storage function device of the present application.
  • the storage function device 90 stores program data 901, and the program data 901 can be executed to realize the optimization method of the above-mentioned confrontation network architecture.
  • the program data 901 can be executed to realize the optimization method of the above-mentioned confrontation network architecture.
  • the detailed optimization method of the confrontation network architecture please refer to the above-mentioned embodiment, which will not be repeated here.
  • the storage device 90 can be, but is not limited to, a U disk, an SD card, a PD optical drive, a mobile hard disk, a large-capacity floppy drive, a flash memory, a multimedia memory card, or a server.
  • the present application is different from the situation of the prior art.
  • the confrontation optimization training is performed on the confrontation network architecture through training images to obtain the optimized confrontation network architecture.
  • the confrontation optimization training can enable the reinforcement learning of the confrontation network architecture, thereby achieving comprehensive optimization of the image description generated by the confrontation network architecture, thereby improving the quality of image description information generation, and overcoming the image description information generation method provided by related technologies. There is a technical problem of poor production quality.
  • the above optimization method of the confrontation network architecture is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a device with a storage function.
  • the technical solutions of the embodiments of the present application can be embodied in the form of a software product in essence or a part that contributes to related technologies.
  • the computer software product is stored in a storage medium and includes a number of instructions to enable One terminal executes all or part of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), magnetic disk or optical disk and other media that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, such as: multiple units or components can be combined, or It can be integrated into another system, or some features can be ignored or not implemented.
  • the coupling, or direct coupling, or communication connection between the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • the functional units in the embodiments of the present invention can be all integrated into one processing unit, or each unit can be individually used as a unit, or two or more units can be integrated into one unit; the above-mentioned integration
  • the unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the foregoing program can be stored in a computer readable storage medium.
  • the execution includes The steps of the foregoing method embodiment; and the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a read only memory (Read Only Memory, ROM), a magnetic disk, or an optical disk.
  • ROM Read Only Memory
  • the aforementioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
  • the technical solutions of the embodiments of the present invention can be embodied in the form of a software product in essence or a part that contributes to related technologies.
  • the computer software product is stored in a storage medium and includes a number of instructions to enable A terminal executes all or part of the methods described in the various embodiments of the present invention.
  • the aforementioned storage media include: removable storage devices, ROMs, magnetic disks or optical discs and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

一种对抗网络架构的优化方法、图像描述生成方法、系统、电子设备和装置,该方法包括以下步骤:构建对抗网络架构(S10);藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构(S20)。通过上述方式,能够解决相关技术所提供的图像描述生成方法存在生成质量较差的技术问题。

Description

对抗网络架构的优化方法、图像描述生成方法和系统 技术领域
本申请涉及计算机技术领域,特别是涉及一种对抗网络架构的优化方法、图像描述生成方法、系统、电子设备和装置。
背景技术
为了对图像中所包含的内容进行准确识别,目前常常会采用图像描述生成算法,来自动生成与图像中内容相匹配的图像描述信息。
常用的生成方式是通过Encoder-Decoder(编码器-解码器)结构,把卷积神经网络(Convolutional Neural Networks,简称CNN)用作编码器,将图像信息从像素空间编码到隐藏空间,然后把循环神经网络(Recurrent Neural Networks,RNN)用作解码器,将隐藏空间中编码后的图像信息解码到语言空间。
本申请的发明人在长期的研发过程中,发现上述生成方式存在易于产生通用或信息含量低的图像描述,这些图像描述不能恰当地反映给定图像的含义的问题。
发明内容
基于此,本申请提供一种对抗网络架构的优化方法、图像描述生成方法、系统、电子设备和装置,能够解决相关技术所提供的图像描述生成方法存在生成质量较差的技术问题。
一方面,本申请提供了一种对抗网络架构的优化方法,该方法包括以下步骤:构建对抗网络架构;藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构,优化后的对抗网络架构为如前述的方法优化后的对抗网络架构。
另一方面,本申请提供了一种对抗网络架构的优化系统,该系统包 括:构建单元,用于构建对抗网络架构;对抗优化训练单元,用于藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。
又一方面,本申请提供了一种图像描述生成方法,获取待描述图像;将待描述图像输入优化后的对抗网络架构中,得到待描述图像的最优图像描述,其中,优化后的对抗网络架构为如前述的方法优化后的对抗网络架构。
再一方面,本申请提供了一种图像描述信息生成系统,包括:获取单元,用于获取待描述图像;输入单元,用于将上述目标图像输入目标图像描述信息生成网络,其中,将待描述图像输入优化后的对抗网络架构中,得到待描述图像的最优图像描述,上述优化后的对抗网络架构为如前述的方法优化后的对抗网络架构。
再一方面,本申请提供了一种电子设备,电子设备包括:存储器,存储有计算机可读指令;处理器,读取存储器存储的计算机可读指令,以执行前述的对抗网络架构的优化方法。
再一方面,本申请提供了一种具有存储功能的装置,装置上存储有计算机可读指令,当计算机可读指令被计算机的处理器执行时,使计算机执行前述的对抗网络架构的优化方法。
本申请的有益效果是:区别于现有技术的情况,本申请区别于现有技术的情况,本申请构建对抗网络架构后,藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。该对抗优化训练可以使对抗网络架构得到强化学习,从而实现利用对抗网络架构所生成的图像描述得到综合优化,进而达到改善图像描述信息的生成质量,克服了相关技术所提供的图像描述信息生成方法存在生成质量较差的技术问题。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图 仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:
图1是本申请对抗网络架构的优化方法一实施方式的流程示意图
图2是图1中步骤S20的流程示意图;
图3是图1中步骤S20的另一流程示意图;
图4是图1中步骤S20的又一流程示意图;
图5是图1中步骤S20的再一流程示意图;
图6是图3中步骤S210的一流程示意图;
图7是图3中步骤S220的一流程示意图;
图8是图4中步骤S26的一流程示意图;
图9是图4中步骤S27的一流程示意图;
图10是图4中步骤S28的一流程示意图;
图11是本申请图像描述生成方法一实施方式的流程示意图;
图12是本申请对抗网络架构的优化系统一实施方式的结构示意图;
图13是本申请图像描述信息生成系统一实施方式的结构示意图;
图14是本申请电子设备一实施方式的结构示意图;
图15是本申请具有存储功能的装置一实施方式的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性的劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了描述上述图像描述信息生成方法,本发明实施例中涉及以下技术术语:
CNN:卷积神经网络(Convolutional Neural Networks),用于提取图像中的图像特征。
RNN:循环神经网络(Recurrent Neural Networks),用于语言建模, 学习上下文特征。
R-CNN:基于区域的卷积神经网络(Region-based CNN),用于目标检测定位。
Faster R-CNN:R-CNN的改进版,速度更快,效果更好。
LSTM:长短时记忆网络(Long-Short Term Memory Networks),能够学习到长期以来关系,应用最广泛的一种RNN。
CNN-RNN结构:CNN用作编码器,RNN用作解码器,图像描述算法的通用框架。
Attention mechanism:注意力机制,RNN建模中对输入特征的加权计算。
self-critical:一种基于policy gradient的强化学习方法。
policy gradient:策略梯度,强化学习中的一种方法,直接学习每一个的更新策略。
BLEU:双语互译质量评估辅助工具(Bilingual Evaluation Understudy),主要用于机器翻译的质量评价。
ROUGE:文本摘要总结的质量评价标准(Recall-Oriented Understudy for Gisting Evaluation)。
METEOR:一种用于任意语言翻译的质量评价标准。
CIDEr:用于图片描述的质量评价标准(Consensus-based image description evaluation)。
SPICE:基于语义的图片描述质量评价标准(Semantic Propositional Image Caption Evaluation)。
MSCOCO:Microsoft Common Objects in Context数据集,用于关键点检测,目标检测,图片描述等。
Genome:图像密集标注的数据集。
参阅图1,图1是本申请对抗网络架构的优化方法一实施方式的流程示意图,该方法包括以下步骤:
S10:构建对抗网络架构。
S20:藉由训练图像以对对抗网络架构进行对抗优化训练以得到优 化后的对抗网络架构。
区别于现有技术的情况,本申请区别于现有技术的情况,本申请构建对抗网络架构后,藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。该对抗优化训练可以使对抗网络架构得到强化学习,从而实现利用对抗网络架构所生成的图像描述得到综合优化,进而达到改善图像描述信息的生成质量,克服了相关技术所提供的图像描述信息生成方法存在生成质量较差的技术问题。
参阅图2,图2是图1中步骤S20的流程示意图,在一实施例中,对抗网络架构包括:第一生成模型、第二生成模型、第一判别模型以及第二判别模型。步骤S20包括以下步骤:
S21:藉由第一生成模型而生成第一图像描述。
S22:藉由第二生成模型而生成第二图像描述。
S23:藉由第一判别模型和第二判别模型而判别第一图像描述、第二图像描述以及匹配的图像描述,并输出一评分结果。
具体地,该匹配的图像描述是对训练图像进行描述所生成的真实图像描述。
S24:将评分结果反馈给第一生成模型和第二生成模型。
S25:第一生成模型和第二生成模型根据评分结果生成评分更高的第一图像描述和第二图像描述,进行下一轮迭代,直至生成评分结果不再提高。
上述步骤S21-S25的过程可以表述为:
Figure PCTCN2020126829-appb-000001
Figure PCTCN2020126829-appb-000002
Figure PCTCN2020126829-appb-000003
其中,
Figure PCTCN2020126829-appb-000004
表示第一生成模型,
Figure PCTCN2020126829-appb-000005
表示第二生成模型,θ 1表示第一生成模型的模型参数,θ 2表示第二生成模型的模型参数,
Figure PCTCN2020126829-appb-000006
表示第一判别模型,
Figure PCTCN2020126829-appb-000007
表示第二判别模型,E表示数学期望,y +表示匹配的图像描述,y -表示不匹配的图像描述,y gen表示第一图像描述或第二图像描述,
Figure PCTCN2020126829-appb-000008
表示第一图像描述。
参阅图3,图3是图1中步骤S20的另一流程示意图,在一实施例中,步骤S21包括以下步骤:
S210:藉由第一生成模型而对训练图像进行描述以生成若干个第一图像描述。
步骤S22包括以下步骤:
S220:藉由第二生成模型而对数据库进行检索,以得到数据库中与训练图像相关的若干个第二图像描述,并生成图像描述候选池。
其中,图像描述候选池包括第一图像描述和第二图像描述。
参阅图4,图4是图1中步骤S20的又一流程示意图,步骤S20还包括以下步骤:
S26:藉由第二生成模型而对图像描述候选池中的各个图像描述进行排序。
S27:藉由第一判别模型而判别第一图像描述是否为第一生成模型生成或匹配的图像描述。
S28:藉由第二判别模型而对各个图像描述与匹配的图像描述之间的相关度进行排序。
参阅图5,图5是图1中步骤S20的再一流程示意图,在一实施例中,步骤S20还包括:
S201:利用梯度下降法优化第一判别模型和第二判别模型。
S202:利用第一目标函数优化第一生成模型。
第一目标函数表述为:
Figure PCTCN2020126829-appb-000009
S203:利用第二目标函数优化第二生成模型。
第二目标函数表述为:
Figure PCTCN2020126829-appb-000010
S204:利用策略梯度优化第一生成模型和第二生成模型,策略梯度函数表述为:
Figure PCTCN2020126829-appb-000011
其中,针对
Figure PCTCN2020126829-appb-000012
的策略梯度函数表述为:
Figure PCTCN2020126829-appb-000013
式中,y greedy表示在解码过程中采用贪婪解码的结果,作为策略训练过程的基准以减少训练过程中的奖励方差。
针对
Figure PCTCN2020126829-appb-000014
的策略梯度函数表述为:
Figure PCTCN2020126829-appb-000015
其中,奖励函数R 1,R 2分别如下:
Figure PCTCN2020126829-appb-000016
Figure PCTCN2020126829-appb-000017
式中,α,β,γ表示控制奖励权值的权重系数,
Figure PCTCN2020126829-appb-000018
表示用于计算生成质量的评价指标。
具体地,上述模型可以但不限于包括一个或多个用于评价图像描述的生成质量的评价指标,如BLEU,ROUGE,METEOR,CIDEr,SPICE等。其中,上述参数与人类对图像描述的主观评判具有相关性,因而,上述参数的综合评价分值,将可以实现客观反映出图像描述的生成质量的效果。
参阅图6,图6是图3中步骤S210的一流程示意图,在一实施例中,第一生成模型采用图像编码器-文本解码器架构,图像编码器包括FasterR-CNN神经网络,文本解码器包括双层LSTM网络。
具体地,其中图像编码器被用于获取图像特征,文本解码器将编码特征转化为描述语句。
步骤S210包括:
S211:采用Faster R-CNN神经网络提取训练图像x中的视觉特征z。视觉特征z为一个L×D维的向量z init
具体地,可以将向量z init输入注意力机制(Attentionmechanism),以进行加权平均处理,得到注意力权值α i
其中,z init={z init,1,z init,2,…,z init,L}=R-CNN(x)
Figure PCTCN2020126829-appb-000019
Figure PCTCN2020126829-appb-000020
式中,x表示训练图像,z init表示L×D维的向量,δ表示前馈神经网络,前馈神经网络用于将向量映射到实数值,f FC表示全连接网络,α i表示对第i个图像特征z init,i的注意力权值,H c表示引导描述特征G c
S212:建立双层LSTM网络。
具体地,第一生成模型类似于自上而下的方法,它包括了两层LSTM,其中,第一层LSTM为Top-Down注意力长短期记忆网络(Top-Down Attention LSTM),第二层LSTM为语言长短期记忆网络(language LSTM)。
S213:第一层LSTM以第二层LSTM在t-1时刻的隐藏状态
Figure PCTCN2020126829-appb-000021
视觉特征z、引导描述特征G c、以及t-1时刻生成的词向量
Figure PCTCN2020126829-appb-000022
为输入,并输出第一层LSTM在t时刻的隐藏状态
Figure PCTCN2020126829-appb-000023
其中,
Figure PCTCN2020126829-appb-000024
Figure PCTCN2020126829-appb-000025
Figure PCTCN2020126829-appb-000026
式中,LSTM (1)表示第一层LSTM。
S214:计算视觉注意力
Figure PCTCN2020126829-appb-000027
其中,
Figure PCTCN2020126829-appb-000028
式中,σ表示一个前馈网络,β t,i表示在第t时刻在第i个视觉特征z init,i的注意力权值,z表示视觉特征。
S215:第二层LSTM以第一层LSTM在t时刻的隐藏状态
Figure PCTCN2020126829-appb-000029
和视觉注意力
Figure PCTCN2020126829-appb-000030
为输入,并输出第二层LSTM在t时刻的隐藏状态
Figure PCTCN2020126829-appb-000031
其中,
Figure PCTCN2020126829-appb-000032
式中,LSTM (2)表示第二层LSTM。
S216:设定词汇表。
其中,词汇表为
Figure PCTCN2020126829-appb-000033
第一生成模型为词汇表上的一个分类器。
S217:将第二层LSTM在t时刻的隐藏状态
Figure PCTCN2020126829-appb-000034
输入到一个用于分类的全连接层以生成第一图像描述。
其中,Faster R-CNN神经网络包括全连接层。全连接层用于判定目标类别,即用于分类。
步骤S217可以表述为:
Figure PCTCN2020126829-appb-000035
式中,W c表示学习参数,θ 1表示第一生成模型
Figure PCTCN2020126829-appb-000036
的参数,
Figure PCTCN2020126829-appb-000037
表示第一图像描述。
参阅图7,图7是图3中步骤S220的一流程示意图,在一实施例中,步骤S220包括以下步骤:
S221:藉由第二生成模型对数据库进行检索,以检索出与训练图像最匹配的M2个候选图像,以得到对应的M2个第二图像描述
Figure PCTCN2020126829-appb-000038
其中,
Figure PCTCN2020126829-appb-000039
具体地,本实施例中存在一个预先检索的第二生成模型,该第二生成模型用于检索数据库中候选的第二图像描述
Figure PCTCN2020126829-appb-000040
候选的第二图像描述
Figure PCTCN2020126829-appb-000041
是根据查询训练图像与数据库中其他图像的视觉相似性,检索出k个最相似的图像以得到M2个检索的候选图像描述。最相似图像是使用余弦相似性度量在查询图像与训练图像见穷举计算得来,记为引导描述集C={c 1,c 2,…,c M2}。随后,使用LSTM网络对提取出来的引导描述集提取语义表示。根据每个句子中单词嵌入表示,隐藏状态si可以根据上一个时刻的隐藏状态s i-1计算出来,可以表述为:
s i=LSTM(s i-1,e(w i))
式中,e(w i)表示引导描述中第i个词的词嵌入向量。每一个引导描述c i可以用编码时的隐藏状态进行表示
Figure PCTCN2020126829-appb-000042
和m表示引导描述c i的长度。最终的引导描述向量可以表示为
Figure PCTCN2020126829-appb-000043
其中μ表示均值化函数。
S222:藉由第二生成模型将M2个第二图像描述
Figure PCTCN2020126829-appb-000044
与第一生成模型 生成的M1个第一图像描述
Figure PCTCN2020126829-appb-000045
组成图像描述候选池
Figure PCTCN2020126829-appb-000046
其中
Figure PCTCN2020126829-appb-000047
参阅图8,图8是图4中步骤S26的一流程示意图,在一实施例中,步骤S26包括:
S261:藉由第二生成模型利用LSTM网络将各个图像描述p编码成嵌入式表示o。
其中,
Figure PCTCN2020126829-appb-000048
式中,
Figure PCTCN2020126829-appb-000049
表示LSTM网络在第i个时刻的隐藏状态,L p表示图像描述p的长度。
S262:给定训练图像x。
其中,训练图像x对应的图像描述对为<p1,p2>。
S263:计算p1比p2更相关的估计概率。
具体地,通过全连接层和sigmoid函数,输出用于判别第一生成模型、第二生成模型所生成的与训练图像x匹配的图像描述p1、p2的真假的概率值。具体表述为:
Figure PCTCN2020126829-appb-000050
式中,ρ表示sigmoid激活函数,g表示任意的打分函数。
S264:构造出训练图像x与匹配的图像描述p+之间的正样本(<p +,p i>|x),生成排序后的图像描述对<p1,p2>的概率分布。
其中,生成排序后的图像描述对<p1,p2>的概率分布表述为:
Figure PCTCN2020126829-appb-000051
在一实施例中,在步骤S26之后,该方法还包括以下步骤:
基于三重态排序损失函数对第二生成模型进行优化,以使训练图像与匹配的图像描述的相关度最大化,同时,使训练图像与第一图像描述或第二图像描述的相关度最小化。
其中,三重态排序损失函数表述为:
Figure PCTCN2020126829-appb-000052
式中,
Figure PCTCN2020126829-appb-000053
表示期望的模型相关度最小间隔,y+表示匹配的图像描述,y gen表示第一图像描述或第二图像描述。
参阅图9,图9是图4中步骤S27的一流程示意图,在一实施例中,步骤S27包括以下步骤:
S271:建立第一判别模型。
第一判别模型包括基于LSTM网络的二元分类器。
S272:基于LSTM网络的二元分类器判别第一图像描述是否为第一生成模型生成或匹配的图像描述。
参阅图10,图10是图4中步骤S28的一流程示意图,在一实施例中,步骤S28包括以下步骤:
S281:建立第二判别模型。
S282:给定训练图像x。
S283:构造训练图像x与匹配的图像描述y+之间的正样本对<x,y+>、训练图像x与第一图像描述或第二图像描述y gen之间的负样本对<x,y gen>。
S284:藉由第二判别模型
Figure PCTCN2020126829-appb-000054
对正样本对<x,y+>和负样本对<x,y gen>进行排序。
其中,排序后的负样本对<x,y gen>的概率分布表述为:
Figure PCTCN2020126829-appb-000055
在一实施例中,在步骤S28之后,该方法还包括以下步骤:
基于三重态排序损失函数对第二判别模型进行优化,以使训练图像与匹配的图像描述的相关度最大化,同时,使训练图像与第一图像描述或第二图像描述的相关度最小化。
其中,三重态排序损失函数表述为:
Figure PCTCN2020126829-appb-000056
式中,
Figure PCTCN2020126829-appb-000057
表示期望的模型相关度最小间隔,y+表示匹配的图像描述,y gen表示第一图像描述或第二图像描述。
为了验证本专利所提出方法的有效性和先进性,利用提出的用于图像描述生成的交互式对偶生成对抗网络,我们在MSCOCO、Flick-40数据集上进行了大量的实验。其中MSCOCO数据集包含11万张带有描述 标签的训练集图片以及5000张验证集、5000张测试集。在训练机上训练,并最终在测试集上测试时,本方法始终优于其他图片描述生成的最好方法,展现出巨大优越性,具有十分广阔的应用前景。
参阅图11,图11是本申请图像描述生成方法一实施方式的流程示意图,该方法包括以下步骤:
S30:获取待描述图像。
S40:将待描述图像输入优化后的对抗网络架构中,得到待描述图像的最优图像描述。
其中,优化后的对抗网络架构为上述实施例中优化后的对抗网络架构。
参阅图12,图12是本申请对抗网络架构的优化系统一实施方式的结构示意图,该系统10包括:
构建单元11,用于构建对抗网络架构。
对抗优化训练单元12,用于藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。
需要说明的是,本实施方式的系统可以执行上述方法中的步骤,相关内容的详细说明请参见上述方法部分,在此不再赘叙。
区别于现有技术的情况,本申请区别于现有技术的情况,本申请构建对抗网络架构后,藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。该对抗优化训练可以使对抗网络架构得到强化学习,从而实现利用对抗网络架构所生成的图像描述得到综合优化,进而达到改善图像描述信息的生成质量,克服了相关技术所提供的图像描述信息生成方法存在生成质量较差的技术问题。
参阅图13,图13是本申请图像描述信息生成系统一实施方式的结构示意图,生成系统20包括:获取单元21,用于获取待描述图像;输入单元22,用于将上述目标图像输入目标图像描述信息生成网络,其中,将待描述图像输入优化后的对抗网络架构中,得到待描述图像的最优图像描述,上述优化后的对抗网络架构为如前述的方法优化后的对抗网络架构。
参阅图14,图14是本申请电子设备一实施方式的结构示意图,可选地,本领域普通技术人员可以理解,图14所示的结构仅为示意,电子设备也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图14其并不对上述电子设备的结构造成限定。例如,电子设备还可包括比图14中所示更多或者更少的组件(如网络接口等),或者具有与图14所示不同的配置。
该电子设备30包括:存储器31和处理器32。存储器31存储有计算机可读指令。处理器32连接存储器31,处理器32读取存储器存储的计算机可读指令,以执行为上述实施例中的对抗网络架构的优化方法。
存储器配置为存储由处理器可执行的指令和应用,还可以缓存待处理器以及信息处理设备中各模块待处理或已经处理的数据,可以通过闪存(FLASH)或随机访问存储器(Random Access Memory,RAM)实现。
需要说明的是,本实施方式的电子设备可以执行上述方法中的步骤,相关内容的详细说明请参见上述方法部分,在此不再赘叙。
参阅图15,图15是本申请具有存储功能的装置一实施方式的结构示意图,该具有存储功能的装置90存储有程序数据901,程序数据901能够被执行以实现上述对抗网络架构的优化方法中的步骤,其中,详细的对抗网络架构的优化方法可参见上述实施例,在此不再赘述。
其中,具有存储功能的装置90可以是但不局限于U盘、SD卡、PD光驱、移动硬盘、大容量软驱、闪存、多媒体记忆卡或服务器等。
区别于现有技术的情况,本申请区别于现有技术的情况,本申请构建对抗网络架构后,藉由训练图像以对对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。该对抗优化训练可以使对抗网络架构得到强化学习,从而实现利用对抗网络架构所生成的图像描述得到综合优化,进而达到改善图像描述信息的生成质量,克服了相关技术所提供的图像描述信息生成方法存在生成质量较差的技术问题。
需要说明的是,本申请实施例中,如果以软件功能模块的形式实现上述的对抗网络架构的优化方法,并作为独立的产品销售或使用时,也 可以存储在一个具有存储功能的装置中。
基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本申请实施例不限制于任何特定的硬件和软件结合。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各 组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。另外,在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。
以上仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (16)

  1. 一种对抗网络架构的优化方法,其特征在于,所述方法包括以下步骤:
    构建对抗网络架构;
    藉由训练图像以对所述对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构。
  2. 根据权利要求1所述的方法,其特征在于,所述对抗网络架构包括:第一生成模型、第二生成模型、第一判别模型以及第二判别模型;
    所述藉由训练图像以对所述对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构的步骤包括:
    藉由所述第一生成模型而生成所述第一图像描述;
    藉由所述第二生成模型而生成所述第二图像描述;
    藉由所述第一判别模型和所述第二判别模型而判别所述第一图像描述、所述第二图像描述以及匹配的图像描述,并输出一评分结果;
    将所述评分结果反馈给所述第一生成模型和所述第二生成模型;
    所述第一生成模型和所述第二生成模型根据所述评分结果生成评分更高的所述第一图像描述和所述第二图像描述,进行下一轮迭代,直至生成所述评分结果不再提高;
    上述过程表述为:
    Figure PCTCN2020126829-appb-100001
    Figure PCTCN2020126829-appb-100002
    Figure PCTCN2020126829-appb-100003
    其中,
    Figure PCTCN2020126829-appb-100004
    表示第一生成模型,
    Figure PCTCN2020126829-appb-100005
    表示第二生成模型,θ 1表示第一生成模型的模型参数,θ 2表示第二生成模型的模型参数,
    Figure PCTCN2020126829-appb-100006
    表示第一判别模型,
    Figure PCTCN2020126829-appb-100007
    表示第二判别模型,E表示数学期望,y +表示匹配的图像描述,y -表示不匹配的图像描述,y gen表示第一图像描述或第二图像描述,
    Figure PCTCN2020126829-appb-100008
    表示第一图像描述。
  3. 根据权利要求2所述的方法,其特征在于,
    所述藉由所述第一生成模型而生成所述第一图像描述的步骤包括:
    藉由所述第一生成模型而对所述训练图像进行描述以生成若干个所述第一图像描述;
    所述藉由所述第二生成模型而生成所述第二图像描述的步骤包括:
    藉由所述第二生成模型而对数据库进行检索,以得到所述数据库中与所述训练图像相关的若干个所述第二图像描述,并生成图像描述候选池,其中,所述图像描述候选池包括所述第一图像描述和所述第二图像描述;
    所述藉由训练图像以对所述对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构的步骤还包括:
    藉由所述第二生成模型而对所述图像描述候选池中的各个所述图像描述进行排序;
    藉由所述第一判别模型而判别所述第一图像描述是否为所述第一生成模型生成或所述匹配的图像描述;
    藉由所述第二判别模型而对各个所述图像描述与所述匹配的图像描述之间的相关度进行排序。
  4. 根据权利要求2所述的方法,其特征在于,所述藉由训练图像以对所述对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构的步骤还包括:
    利用梯度下降法优化所述第一判别模型和所述第二判别模型;
    利用第一目标函数优化所述第一生成模型,所述第一目标函数表述为:
    Figure PCTCN2020126829-appb-100009
    利用第二目标函数优化所述第二生成模型,所述第二目标函数表述为:
    Figure PCTCN2020126829-appb-100010
    再利用策略梯度优化所述第一生成模型和所述第二生成模型,策略梯度函数表述为:
    Figure PCTCN2020126829-appb-100011
    针对
    Figure PCTCN2020126829-appb-100012
    的策略梯度函数表述为:
    Figure PCTCN2020126829-appb-100013
    式中,y greedy表示在解码过程中采用贪婪解码的结果,作为策略训练过程的基准以减少训练过程中的奖励方差;
    针对
    Figure PCTCN2020126829-appb-100014
    的策略梯度函数表述为:
    Figure PCTCN2020126829-appb-100015
    其中,奖励函数R 1,R 2分别如下:
    Figure PCTCN2020126829-appb-100016
    Figure PCTCN2020126829-appb-100017
    式中,α,β,γ表示控制奖励权值的权重系数,
    Figure PCTCN2020126829-appb-100018
    表示用于计算生成质量的评价指标。
  5. 根据权利要求3所述的方法,其特征在于,所述第一生成模型采用图像编码器-文本解码器架构,所述图像编码器包括FasterR-CNN神经网络,所述文本解码器包括双层LSTM网络;
    藉由所述第一生成模型而对所述训练图像进行描述以生成若干个所述第一图像描述的步骤包括:
    采用FasterR-CNN神经网络提取所述训练图像x中的视觉特征z,所述视觉特征z为一个L×D维的向量z init
    其中,z init={z init,1,z init,2,…,z init,L}=R-CNN(x)
    Figure PCTCN2020126829-appb-100019
    Figure PCTCN2020126829-appb-100020
    式中,x表示训练图像,z init表示L×D维的向量,δ表示前馈神经网络,前馈神经网络用于将向量映射到实数值,f FC表示全连接网络,α i表示对第i个图像特征z init,i的注意力权值,H c表示引导描述特征H c
    建立双层LSTM网络;
    第一层LSTM以第二层LSTM在t-1时刻的隐藏状态
    Figure PCTCN2020126829-appb-100021
    所述视觉特征z、引导描述特征H c、以及t-1时刻生成的词向量
    Figure PCTCN2020126829-appb-100022
    为输入,并输出所述第一层LSTM在t时刻的隐藏状态
    Figure PCTCN2020126829-appb-100023
    其中,
    Figure PCTCN2020126829-appb-100024
    Figure PCTCN2020126829-appb-100025
    Figure PCTCN2020126829-appb-100026
    计算视觉注意力
    Figure PCTCN2020126829-appb-100027
    其中,
    Figure PCTCN2020126829-appb-100028
    式中,σ表示一个前馈网络,β t,i表示在第t时刻在第i个视觉特征z init,i的注意力权值,z表示视觉特征;
    所述第二层LSTM以所述第一层LSTM在t时刻的隐藏状态
    Figure PCTCN2020126829-appb-100029
    和所述视觉注意力
    Figure PCTCN2020126829-appb-100030
    为输入,并输出所述第二层LSTM在t时刻的隐藏状态
    Figure PCTCN2020126829-appb-100031
    其中,
    Figure PCTCN2020126829-appb-100032
    设定词汇表为
    Figure PCTCN2020126829-appb-100033
    其中,所述第一生成模型为所述词汇表上的一个分类器;
    将所述第二层LSTM在t时刻的隐藏状态
    Figure PCTCN2020126829-appb-100034
    输入到一个用于分类的全连接层以生成所述第一图像描述,表述为:
    Figure PCTCN2020126829-appb-100035
    其中,式中,W c表示可学习参数,θ 1表示所述第一生成模型
    Figure PCTCN2020126829-appb-100036
    的参数,
    Figure PCTCN2020126829-appb-100037
    表示第一图像描述。
  6. 根据权利要求3所述的方法,其特征在于,藉由所述第二生成模型而对数据库进行检索,以得到所述数据库中与所述训练图像相关的若干个所述第二图像描述,并生成图像描述候选池的步骤包括:
    藉由所述第二生成模型对所述数据库进行检索,以检索出与所述训练图像最匹配的M 2个候选图像,以得到对应的M 2个所述第二图像描述
    Figure PCTCN2020126829-appb-100038
    其中
    Figure PCTCN2020126829-appb-100039
    藉由所述第二生成模型将M 2个所述第二图像描述
    Figure PCTCN2020126829-appb-100040
    与所述第一生成模型生成的M 1个所述第一图像描述
    Figure PCTCN2020126829-appb-100041
    组成所述图像描述候选池
    Figure PCTCN2020126829-appb-100042
    其中
    Figure PCTCN2020126829-appb-100043
  7. 根据权利要求6所述的方法,其特征在于,藉由所述第二生成模型而对所述图像描述候选池中的各个所述图像描述进行排序的步骤包括:
    藉由所述第二生成模型利用LSTM网络将各个所述图像描述p编码成嵌入式表示o,
    其中,
    Figure PCTCN2020126829-appb-100044
    式中,
    Figure PCTCN2020126829-appb-100045
    表示LSTM网络在第i个时刻的隐藏状态,L p表示所述图像描述p的长度;
    给定所述训练图像x,其中,所述训练图像x对应的图像描述对为<p1,p2>;
    计算p1比p2更相关的估计概率,表述为:
    Figure PCTCN2020126829-appb-100046
    式中,ρ表示sigmoid激活函数,g表示任意的打分函数;
    构造出所述训练图像x与所述匹配的图像描述p+之间的正样本(<p +,p i>|x),生成排序后的所述图像描述对<p1,p2>的概率分布表述为:
    Figure PCTCN2020126829-appb-100047
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    基于三重态排序损失函数对所述第二生成模型进行优化,以使所述训练图像与匹配的图像描述的相关度最大化,同时,使所述训练图像与所述第一图像描述或第二图像描述的相关度最小化,
    其中,三重态排序损失函数表述为:
    Figure PCTCN2020126829-appb-100048
    式中,
    Figure PCTCN2020126829-appb-100049
    表示期望的模型相关度最小间隔,y +表示匹配的图像描述,y gen表示第一图像描述或第二图像描述。
  9. 根据权利要求3所述的方法,其特征在于,藉由所述第一判别模型而判别所述第一图像描述是否为所述第一生成模型生成或所述匹配的图像描述的步骤包括:
    建立所述第一判别模型,所述第一判别模型包括基于LSTM网络的二元分类器;
    其中,所述基于LSTM网络的二元分类器判别所述第一图像描述是否为所述第一生成模型生成或所述匹配的图像描述。
  10. 根据权利要求3所述的方法,其特征在于,藉由所述第二判别模型而对各个所述图像描述与所述匹配的图像描述之间的相关度进行排序的步骤包括:
    建立所述第二判别模型;
    给定所述训练图像x;
    构造所述训练图像x与所述匹配的图像描述y +之间的正样本对<x,y +>、所述训练图像x与所述第一图像描述或第二图像描述y gen之间的负样本对<x,y gen>;
    藉由所述第二判别模型
    Figure PCTCN2020126829-appb-100050
    对正样本对<x,y+>和负样本对<x,y gen>进行排序,排序后的负样本对<x,y gen>的概率分布表述为
    Figure PCTCN2020126829-appb-100051
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:
    基于三重态排序损失函数对所述第二判别模型进行优化,以使所述训练图像与匹配的图像描述的相关度最大化,同时,使所述训练图像与所述第一图像描述或第二图像描述的相关度最小化;
    其中,三重态排序损失函数表述为:
    Figure PCTCN2020126829-appb-100052
    式中,
    Figure PCTCN2020126829-appb-100053
    表示期望的模型相关度最小间隔,y +表示所述匹配的图像描 述,y gen表示所述第一图像描述或第二图像描述。
  12. 一种对抗网络架构的优化系统,其特征在于,所述系统包括:
    构建单元,用于构建对抗网络架构;
    对抗优化训练单元,用于藉由训练图像以对所述对抗网络架构进行对抗优化训练以得到优化后的对抗网络架构,所述优化后的对抗网络架构为如权利要求1-11任一项所述的方法优化后的对抗网络架构。
  13. 一种图像描述生成方法,其特征在于,
    获取待描述图像;
    将所述待描述图像输入优化后的对抗网络架构中,得到所述待描述图像的最优图像描述,其中,所述优化后的对抗网络架构为如权利要求1-11任一项所述的方法优化后的对抗网络架构。
  14. 一种图像描述信息生成系统,其特征在于,包括:
    获取单元,用于获取待描述图像;
    输入单元,用于将上述目标图像输入目标图像描述信息生成网络,其中,将所述待描述图像输入优化后的对抗网络架构中,得到所述待描述图像的最优图像描述,所述优化后的对抗网络架构为如权利要求1-11任一项所述的方法优化后的对抗网络架构。
  15. 一种电子设备,其特征在于,所述电子设备包括:
    存储器,存储有计算机可读指令;
    处理器,读取存储器存储的计算机可读指令,以执行如权利要求1-11中的任一项所述的方法。
  16. 一种具有存储功能的装置,其特征在于,所述装置上存储有计算机可读指令,当所述计算机可读指令被计算机的处理器执行时,使计算机执行如权利要求1-11中的任一项所述的方法。
PCT/CN2020/126829 2019-11-05 2020-11-05 对抗网络架构的优化方法、图像描述生成方法和系统 WO2021088935A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911073209.X 2019-11-05
CN201911073209.XA CN111105013B (zh) 2019-11-05 2019-11-05 对抗网络架构的优化方法、图像描述生成方法和系统

Publications (1)

Publication Number Publication Date
WO2021088935A1 true WO2021088935A1 (zh) 2021-05-14

Family

ID=70420632

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/126829 WO2021088935A1 (zh) 2019-11-05 2020-11-05 对抗网络架构的优化方法、图像描述生成方法和系统

Country Status (2)

Country Link
CN (1) CN111105013B (zh)
WO (1) WO2021088935A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554040A (zh) * 2021-09-07 2021-10-26 西安交通大学 一种基于条件生成对抗网络的图像描述方法、装置设备
CN114091662A (zh) * 2021-11-26 2022-02-25 广东伊莱特电器有限公司 一种文本图像生成方法、装置及电子设备
CN115455423A (zh) * 2022-08-22 2022-12-09 国网浙江省电力有限公司电力科学研究院 模糊测试用例生成方法及装置
CN116071641A (zh) * 2023-04-06 2023-05-05 中国石油大学(华东) 一种水下图像中文描述生成方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111105013B (zh) * 2019-11-05 2023-08-11 中国科学院深圳先进技术研究院 对抗网络架构的优化方法、图像描述生成方法和系统
CN116595385B (zh) * 2023-07-18 2023-10-03 深圳须弥云图空间科技有限公司 作文生成模型训练方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685116A (zh) * 2018-11-30 2019-04-26 腾讯科技(深圳)有限公司 图像描述信息生成方法和装置及电子装置
CN110287357A (zh) * 2019-05-31 2019-09-27 浙江工业大学 一种基于条件生成对抗网络的图像描述生成方法
CN111105013A (zh) * 2019-11-05 2020-05-05 中国科学院深圳先进技术研究院 对抗网络架构的优化方法、图像描述生成方法和系统

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108230239A (zh) * 2017-12-25 2018-06-29 中国科学院自动化研究所 人脸表情图像合成装置
CN108319686B (zh) * 2018-02-01 2021-07-30 北京大学深圳研究生院 基于受限文本空间的对抗性跨媒体检索方法
US11100632B2 (en) * 2018-04-13 2021-08-24 Elekta, Inc. Image synthesis using adversarial networks such as for radiation therapy
CN108615073B (zh) * 2018-04-28 2020-11-03 京东数字科技控股有限公司 图像处理方法及装置、计算机可读存储介质、电子设备
CN108711138B (zh) * 2018-06-06 2022-02-11 北京印刷学院 一种基于生成对抗网络的灰度图片彩色化方法
CN108846124B (zh) * 2018-06-29 2022-05-17 北京百度网讯科技有限公司 训练方法、装置、计算机设备和可读存储介质
CN109800768B (zh) * 2018-12-15 2021-05-14 中国人民解放军陆军工程大学 半监督gan的散列特征表示学习方法
CN110138595A (zh) * 2019-04-12 2019-08-16 中国科学院深圳先进技术研究院 动态加权网络的时间链路预测方法、装置、设备及介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685116A (zh) * 2018-11-30 2019-04-26 腾讯科技(深圳)有限公司 图像描述信息生成方法和装置及电子装置
CN110287357A (zh) * 2019-05-31 2019-09-27 浙江工业大学 一种基于条件生成对抗网络的图像描述生成方法
CN111105013A (zh) * 2019-11-05 2020-05-05 中国科学院深圳先进技术研究院 对抗网络架构的优化方法、图像描述生成方法和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YI ZILI; ZHANG HAO; TAN PING; GONG MINGLUN: "DualGAN: Unsupervised Dual Learning for Image-to-Image Translation", 2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV), IEEE, 22 October 2017 (2017-10-22), pages 2868 - 2876, XP033283153, DOI: 10.1109/ICCV.2017.310 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554040A (zh) * 2021-09-07 2021-10-26 西安交通大学 一种基于条件生成对抗网络的图像描述方法、装置设备
CN113554040B (zh) * 2021-09-07 2024-02-02 西安交通大学 一种基于条件生成对抗网络的图像描述方法、装置设备
CN114091662A (zh) * 2021-11-26 2022-02-25 广东伊莱特电器有限公司 一种文本图像生成方法、装置及电子设备
CN114091662B (zh) * 2021-11-26 2024-05-14 广东伊莱特生活电器有限公司 一种文本图像生成方法、装置及电子设备
CN115455423A (zh) * 2022-08-22 2022-12-09 国网浙江省电力有限公司电力科学研究院 模糊测试用例生成方法及装置
CN115455423B (zh) * 2022-08-22 2023-07-07 国网浙江省电力有限公司电力科学研究院 模糊测试用例生成方法及装置
CN116071641A (zh) * 2023-04-06 2023-05-05 中国石油大学(华东) 一种水下图像中文描述生成方法、装置、设备及存储介质
CN116071641B (zh) * 2023-04-06 2023-08-04 中国石油大学(华东) 一种水下图像中文描述生成方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN111105013A (zh) 2020-05-05
CN111105013B (zh) 2023-08-11

Similar Documents

Publication Publication Date Title
WO2021088935A1 (zh) 对抗网络架构的优化方法、图像描述生成方法和系统
CN110737801B (zh) 内容分类方法、装置、计算机设备和存储介质
CN108829757B (zh) 一种聊天机器人的智能服务方法、服务器及存储介质
CN112131350B (zh) 文本标签确定方法、装置、终端及可读存储介质
CN111783902B (zh) 数据增广、业务处理方法、装置、计算机设备和存储介质
CN107480144B (zh) 具备跨语言学习能力的图像自然语言描述生成方法和装置
CN110147457A (zh) 图文匹配方法、装置、存储介质及设备
CN112395979B (zh) 基于图像的健康状态识别方法、装置、设备及存储介质
AU2019101138A4 (en) Voice interaction system for race games
CN113656563B (zh) 一种神经网络搜索方法及相关设备
US20220164533A1 (en) Optical character recognition using a combination of neural network models
CN114282528A (zh) 一种关键词提取方法、装置、设备及存储介质
Zhang et al. Multi-task framework based on feature separation and reconstruction for cross-modal retrieval
CN117558270B (zh) 语音识别方法、装置、关键词检测模型的训练方法和装置
CN117150436B (zh) 多模态自适应融合的主题识别方法及系统
Cao et al. Visual question answering research on multi-layer attention mechanism based on image target features
Zhou et al. Collaborative strategy network for spatial attention image captioning
Li et al. MAFH: Multilabel aware framework for bit-scalable cross-modal hashing
CN116561314B (zh) 基于自适应阈值选择自注意力的文本分类方法
CN116049371A (zh) 一种基于正则化和对偶学习的视觉问答方法与装置
CN115759262A (zh) 基于知识感知注意力网络的视觉常识推理方法及系统
WO2022165858A1 (en) Multi-clue reasoning with memory augmentation for knowledge-based visual question answering
CN113535888A (zh) 一种情感分析装置、方法、计算设备及可读存储介质
CN118035427B (zh) 一种通过3d对比学习增强多模态图文检索的方法及装置
CN112597289B (zh) 问询信息分类方法、模型训练方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20885723

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20885723

Country of ref document: EP

Kind code of ref document: A1