This specification relates to image processing, and specifically to a multimodal image classifier.
Machine learned image classification models take image pixels as input and produce labels in a predefined taxonomy. Image classification is typically a supervised learning problem that defines a set of target classes (objects to identify in images), and trains a model to recognize them using training images that are labeled. Such systems are capable of high predictive accuracy and generalizability to unseen data. These models may rely on pixel data and features derived from the pixel data, such as color histograms, textures, and shapes, as training features.
This specification describes a system implemented as computer programs on one or more computers in one or more locations that predicts an image classification using a model that takes features from an embedding of predicted text for an image and an embedding of the image pixels of the image.
According to an aspect there is provided a method including for each image of a plurality of images: processing the image by a textual generator model to obtain a set of phrases that are descriptive of the content of the image, wherein each phrase is one or more terms, processing the set of phrases by a textual embedding model to obtain an embedding of predicted text for the image, and processing the image using an image embedding model to obtain an embedding of image pixels of the image; and training a multimodal image classifier on the embeddings of predicted text for the images and the embeddings of image pixels for the images to produce, as output, labels of an output taxonomy to classify an image based on the image as input. Additional aspects can be provided in apparatus, systems, and computer program products.
Particular embodiments of the subject matter described in this specification can be implemented to realize one or more of the following advantages. While textual information (e.g., text surrounding an image) can provide valuable orthogonal signals, machine learned models typically rely pixel data as input. Moreover, textual data may not be available for a corpus of images. The novel features of this disclosure include the generation of a textual embedding for an image from phrases generated by a text generator that does not need surrounding text as input. A multimodal image classifier is then trained on the textual embeddings and pixel embeddings of images. The use of the textual embedding for training leads to an overall performance that is better than an overall performance of a model that is trained without the textual embedding, resulting in a significant improvement in the field of image classification.
The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims.
Like reference numbers and designations in the various drawings indicate like elements.
This patent document describes a framework that includes a text generator that generates textual labels, referred to as phrases, from image data, and a multimodal image classifier that takes textual features from the text generator and visual features from the image pixels, and produces labels according to an output taxonomy. In some implementations, the text generator is trained using web-based query/image pairs to incorporate contextual information associated with each image. The output of the text generator, in some implementations, may exceed the output taxonomy of the image classifier, e.g., the text generator may generate phrases that are not included in the output taxonomy of the multimodal image classifier.
These features and other features are described in more detail below, and in Appendix A.
The multimodal image classification system 100 is configured to process images to generate textual embeddings and image pixel embeddings that are used to train a multimodal image classification model 110. The system 100 includes a text generator 120 and a textual embedding neural network 122. The text generator 120 generates, for each image of images 102, phrases of one or more terms that are descriptive of content of the image. The textual embedding neural network 122 processes the phrases generated by the text generator for the images and generates a textual embedding.
In some implementations, the text generator 100 is a neural network trained on web-based query-image pairs. The query-image pairs are images paired with respective queries for which the images were selected by users.
In some implementations, long-tail queries are included in the query-image pairs. This results in fine-grained and descriptive queries, e.g., [2016 lamborghini aventador white], [equestrian statue of bartolomeo Colleoni], and the like. The query-image pair space also covers multiple visual concepts, including landmarks, animals, to man-mad products, persons, artwork, etc. This results in a technical improvement in accuracy over systems trained on image datasets that have a much smaller vocabulary size and/or less descriptive phrases, e.g., [golden retriever] in a limited image domain, e.g., “dog.”
In some implementations, the text generator is a convolutional neural network with classification loss. One example architecture is ResNet-101 based, followed by an embedding layer projecting ResNet response to a low-dimensional vector, and a multi-way softmax at the top. In one example implementation, the vector has 64 dimensions, and is followed by a 40 million-way softmax. Other values can also be used, however.
For large scale training, an AI accelerator application specific circuit, such as a Tensor Processing Unit, and a sampled softmax loss algorithm is used. Other appropriate training pipelines can also be used, however, and the particular pipeline used may depend on the scale of the training corpus.
The text generator realizes several advantages, including the ability to distinguish very fine-grained concepts for images. e.g., [2016 Lamborghini Aventador white] and [2010 Lamborghini Aventador white], as compared to [white Lamborghini]. Such fine-grained concepts for images are derived from long-tail queries from query image pairs. Additionally, the resulting textual embedding is language agnostic and cross lingual due to the training on query-image pairs.
The textual embedding neural network 122 is an artificial neural network that is trained to map a discrete input (e.g., a feature vector of the phrases generated by the text generator 120) to a continuously valued output (e.g., a vector or matrix). The outputs of the textual embedding neural network 122 have the property that similar inputs are mapped to outputs that are close to one another in multi-dimensional space. The output of the textual embedding neural network 122 can thus be described as a latent representation of the data that is input to the embedding neural network. In this specification, a latent representation of a set of data refers to a numerical representation of the data (e.g., as a vector or matrix) which is generated internally by a network.
The pixel embedding neural network 124 generates embeddings with properties similar to the embeddings of the textual embedding neural network 122, i.e., the outputs of the pixel embedding neural network 124 have the property that similar inputs are mapped to outputs that are close to one another in multi-dimensional space. In some implementations, the embeddings for image features were obtained from a final fully connected layer of a pre-trained convolutional network. This involves training network weights on an input dataset, identifying the bottleneck layer (usually the layer prior to outputs), and extracting outputs of that layer for arbitrary images. In this way, features characterizing individual local characteristics and general visual structures are obtained.
The multimodal image classifier 110 receives the textual embeddings from the textual embedding neural network 122 and the pixel embeddings from the pixel embedding neural network 124. The classifier is trained on these embeddings to produce, as output, labels of an output taxonomy to classify an image based on the image as input. Having obtained pixel and textual embeddings for arbitrary input images, the embeddings are subsequently combined to generate representations for images that incorporate both types of features. In some implementation, the process for combining these features involved concatenating the 200-dimensional textual feature vector with 1024-dimensional visual feature vector into a singular feature vector representing both concepts. The resulting vector is subsequently input to a two-stage fully connected neural network, with the output softmax layer predicting probabilities associated with classes according to a specified taxonomy. Other appropriate training procedures can also be used, however.
Advantageously, while orthogonal textual features are extracted to supplement pixel information and generate context-aware predictions, the system 100 only requires images to generate label-wise outcomes. Since the generation of text with text generator 120 enables the identification of relevant text for arbitrary input images, the system framework only requires input images to produce predictions that are based, in part, on textual features. This is yet another technical improvement in the field of image classification.
The process 200, for each image in a set of images, (202), obtains a textual embedding of the image (205) and obtains a pixel embedding of the image (206). For example, as described above, a textual embedding for each image may be obtained by processing the image by the text generator 120, and processing the output phrases by the textual embedding neural network 122. The pixel embedding for each image may be obtained by processing he image by the pixel embedding neural network 124.
The process 200 then trains a multimodal image classifier using the textual embeddings and the pixel embeddings (208). As described above, the classifier is trained on these embeddings to produce, as output, labels of an output taxonomy to classify an image based on the image as input.
This specification uses the term “configured” in connection with systems and computer program components. For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or in addition, the program instructions can be encoded on an artificially-generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus.
The term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
A computer program, which may also be referred to or described as a program, software, a software application, an app, a module, a software module, a script, or code, can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages; and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network.
In this specification the term “engine” is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers.
Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks.
To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user's device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return.
Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute-intensive parts of machine learning training or production, i.e., inference, workloads.
Machine learning models can be implemented and deployed using a machine learning framework, e.g., a TensorFlow framework, a Microsoft Cognitive Toolkit framework, an Apache Singa framework, or an Apache MXNet framework.
Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.
The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server transmits data, e.g., an HTML page, to a user device, e.g., for purposes of displaying data to and receiving user input from a user interacting with the device, which acts as a client. Data generated at the user device, e.g., a result of the user interaction, can be received at the server from the device.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.
Number | Date | Country | |
---|---|---|---|
62768701 | Nov 2018 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 17046313 | Oct 2020 | US |
Child | 18409411 | US |