Systems and methods herein generally relate to image recognition using a neural network and, more particularly, to training convolutional neural networks for large size input images.
Recently, deep learning has attracted more attention in the computer vision community because of its performance in terms of classification, detection, and recognition accuracy. However, there is a technical issue in the training and testing of the Convolutional Neural Networks (CNNs) that are used for image classification and detection: the prevalent CNNs require a fixed input image size (e.g., 256×256), which limits both the aspect ratio and the scale of the input image. When applied to images of arbitrary sizes, most current methods fit the input image to the required size by cropping or warping of the input image. CNNs require a fixed input size because a CNN mainly consists of two parts: convolutional layers and fully-connected layers that follow. The convolutional layers operate in a sliding-window manner and output feature maps that represent the spatial arrangement of the activations and the spatial scale of the activations. In fact, convolutional layers do not require a fixed image size and can generate feature maps of any size. On the other hand, the fully-connected layers need to have fixed size/length input by their definition. Hence, the fixed size constraint comes only from the fully-connected layers, which exist at a deeper stage of the network. A simple approach to accommodate larger input image size is to modify the parameters of the convolutional filters so that the output at the last convolutional layer will fit the size requirement of the fully connected layers. However, the scale of the spatial features extracted will then vary depending on the input image size. Another approach is to replace the pooling layers in the current network with a spatial pyramid pooling. Spatial pyramid pooling can maintain spatial information by pooling in local spatial bins. These spatial bins have sizes proportional to the image size, so the number of bins is fixed regardless of the image size. This is in contrast to the sliding window pooling of most prevalent deep networks, where the number of sliding windows depends on the input size. In the method utilizing spatial pyramid pooling, in each spatial bin, the responses of each filter (e.g., max pooling) was pooled. The outputs of the spatial pyramid pooling are kM-dimensional vectors with the number of bins denoted as M (k is the number of filters in the last convolutional layer). The fixed-dimensional vectors are the input to the fully-connected layer. This approach maintains the size of the fully connected layer by using spatial pyramid pooling at the last convolutional layer.
Systems and methods herein enable a method to overcome the input size constraints imposed by most existing Convolutional Neural Networks (CNNs). Traditional CNNs require that inputs be of a given fixed size, so images are usually cropped or resized to match the input size requirements of the network, which may introduce undesired side effects. The method disclosed herein adds additional convolutional layers (or modules) to accommodate large-size input images using a two-step training process that first trains the small CNNs with reduced-size images, then uses the weights to initialize the expanded CNNs for training/testing with large-size images.
Benefits of the invention include that it enables support of variable size inputs to existing networks with some modifications to the hyperparameters of the networks. Additionally, the training method benefits from leveraging aspects of transfer learning, which is useful to initialize the network such that it converges and converges fast.
According to exemplary methods of training a convolutional neural network herein, input images are received into a computerized device having an image processor. The image processor evaluates the input images using first convolutional layers. The number of first convolutional layers is based on a first size for the input images. Each layer of the first convolutional layers receives layer input signals comprising features of the input images and generates layer output signals. The layer input signals include signals from the input images and ones of the layer output signals from previous layers within the first convolutional layers. Responsive to an input image being a second size larger than the first size, additional convolutional layers are added to the convolutional neural network. The number of additional convolutional layers is based on the second size in relation to the first size. The additional convolutional layers are initialized using weights from the first convolutional layers. Feature maps comprising the layer output signals are created.
According to exemplary methods herein, a trained convolutional neural network (CNN) is created. The training of the CNN comprises evaluating training input images using first convolutional layers. The number of first convolutional layers is based on a first size for the training input images. Each layer of the first convolutional layers receives layer input signals comprising features of the input images and generates layer output signals. Responsive to a training input image being a second size larger than the first size, additional convolutional layers are added to the CNN. The number of additional convolutional layers is based on the second size in relation to the first size. The additional convolutional layers are initialized using weights from the first convolutional layers. Feature maps comprising the layer output signals are created. A plurality of feature maps of an output of at least one selected layer of the trained CNN is selected according to values attributed to the plurality of feature maps by the trained CNN. For each of the plurality of feature maps, a location corresponding thereto in an image space of a test input image is determined. Interest points of the test input image are defined, based on the locations corresponding to the plurality of feature maps. The test input image is classified, based on the interest points.
Systems herein include a processing unit, a memory operationally connected to the processing unit, and an imaging device connected to the processing unit. The memory comprises feature maps comprising layer output signals from a trained convolutional neural network (CNN). The imaging device receives an image comprising a set of pixels. The processing unit selects a plurality of feature maps from the memory. For each of the plurality of feature maps, the processing unit determines a location corresponding thereto in an image space of the image. The processing unit defines interest points of the image, based on the locations corresponding to the plurality of feature maps. The processing unit classifies the test input image based on the interest points.
According to a computer system for training a convolutional neural network, the computer system comprises a program product comprising a tangible computer readable storage medium having program code embodied therewith. The program code is readable and executable by a computer to provide an application to perform a method. According to the method, a trained convolutional neural network (CNN) is created. The training of the CNN comprises evaluating training input images using first convolutional layers. The number of first convolutional layers is based on a first size for the training input images. Each layer of the first convolutional layers receives layer input signals comprising features of the input images and generates layer output signals. Responsive to a training input image being a second size larger than the first size, additional convolutional layers are added to the CNN. The number of additional convolutional layers is based on the second size in relation to the first size. The additional convolutional layers are initialized using weights from the first convolutional layers. Feature maps comprising the layer output signals are created. A plurality of feature maps of an output of at least one selected layer of the trained CNN is selected according to values attributed to the plurality of feature maps by the trained CNN. For each of the plurality of feature maps, a location corresponding thereto in an image space of a test input image is determined. Interest points of the test input image are defined, based on the locations corresponding to the plurality of feature maps. The test input image is classified, based on the interest points.
These and other features are described in, or are apparent from, the following detailed description.
Various examples of the systems and methods are described in detail below, with reference to the attached drawing figures, which are not necessarily drawn to scale and in which:
For a general understanding of the features of the disclosure, reference is made to the drawings. In the drawings, like reference numerals have been used throughout to identify identical elements. While the disclosure will be described hereinafter in connection with specific devices and methods thereof, it will be understood that limiting the disclosure to such specific devices and methods is not intended. On the contrary, it is intended to cover all alternatives, modifications, and equivalents as may be included within the spirit and scope of the disclosure as defined by the appended claims.
Certain computer problems, such as character recognition and image recognition are known to be well handled by machine-leaning techniques. Chief among these is the use of neural networks. Neural networks are a class of algorithms based on a concept of inter-connected “neurons.” Referring to
In machine learning, a convolutional neural network (CNN) is a type of feed-forward artificial neural network in which the connectivity pattern between its neurons is inspired by the organization of the animal visual cortex, whose individual neurons are arranged in such a way that they respond to overlapping regions tiling the visual field. Biological processes inspired convolutional networks, which are variations of multilayer perceptrons designed to use minimal amounts of preprocessing.
When used for image recognition, image classification, etc., convolutional neural networks (CNNs) consist of multiple layers of small neuron collections that process portions of the input image, called receptive fields. The outputs of these collections are then tiled so that their input regions overlap, to obtain a better representation of the original image; this is repeated for every such layer.
Referring to
After each convolutional layer, there may be a pooling layer, which combines the outputs of neuron clusters. The pooling layer takes small rectangular blocks from the convolutional layer and subsamples it to produce a single output from that block. There are several ways to perform pooling, such as taking the average or the maximum, or a learned linear combination of the neurons in the block.
Convolutional networks may include local or global pooling layers. They also consist of various combinations of convolutional and fully connected layers, with pointwise nonlinearity applied at the end of or after each layer. To reduce the number of free parameters and improve generalization, a convolution operation on small regions of input may be introduced. One major advantage of convolutional networks is the use of shared weight in the convolutional layers, which means that the same filter (weights bank) is used for each pixel in the layer; this both reduces memory footprint and improves performance.
After several convolutional and pooling layers, the high-level reasoning in the neural network is done via fully connected layers. A fully connected layer takes all neurons in the previous layer (be it fully connected, pooling, or convolutional) and connects it to every single neuron it has. Fully connected layers are not spatially located anymore, so there can be no convolutional layers after a fully connected layer.
The introduction of CNNs and the availability of large-scale training data have had a profound impact on the computer vision community. Deep-network based approaches have demonstrated successes over the state-of-the-art in image classification, object detection, and many other recognition or even non-recognition tasks. However, there is a technical issue in the training and testing of the CNNs: the prevalent CNNs require a fixed input image size (e.g., 256×256), which limits both the aspect ratio and the scale of the input image. When applied to images of arbitrary sizes, most current methods fit the input image to the required size by cropping or warping. A proper cropping, e.g., finding windshields of vehicles, requires additional process while warping, e.g., aspect ratio modification or resolution reduction, can potentially result in unwanted geometric distortion or loss of information, which in turn compromise the classification/recognition accuracy. Current processes for vehicle passenger detection employ a two-stage process, which requires windshield/side-window cropping before image classification. Although front windshield localization has achieved above 99% accuracy, back-row side-window localization has turned out to be a very challenging task due to factors such as large variations in window shapes, multiple-rows of back seats, etc. An alternative to the two-stage process is to use the entire image for classification without region-of-interest (ROI) cropping. However, to fit the input image to the size requirement of the current CNNs, the input images have to be scaled down by a factor of 8. The downscaling of the window region will generate an ROI with only a few hundreds of pixels, which could have a significant impact on the classification accuracy. Hence, there is a desire to modify the current CNN architectures to accommodate large-size input images while maintaining training efficiency.
According to systems and methods herein, the size of the fully connected layer is maintained by adding additional pooling layers at different stages of the network (e.g., middle or late). However, because of the increased size of the network, the convergence of the training can be slow or not feasible. To overcome this challenge, a two-step training process is used. The two-step training process trains the smaller network first then uses the weights to initialize the expanded network. That is, the architecture adds additional convolutional layers (or modules) to accommodate large-size input images (e.g. 512, 1024). The two-step training process first trains the small CNNs with reduced-size images, then uses the weights to initialize the expanded CNNs for training/testing with large-size images.
According to the disclosed method, a CNN is expanded, as shown in
The GoogLeNet achieved the best results for classification and detection in the ImageNet Large-Scale Visual Recognition Challenge 2014 (ILSVRC14). Compared to other CNN architectures, GoogLeNet is a deep architecture, where the word “deep” is meant both in the sense that it introduces a new level of organization as well as in the more direct sense of increased network depth.
Although it is easy to just simply modify the parameters of the convolutional filters to ensure that the feature size fits the size requirements of the fully connected layers for large-size input images, this simple approach could potentially lose image details as the input image size gets larger and larger, especially when the region of interest (e.g., the back-row side-windows, moreover, the back-seat passengers) is relatively small in the original image (e.g., side-windows of vehicles).
The convolutional neural network (CNN), according to systems and methods herein, is illustrated in
However, with the expanded network, the training can become very challenging with the extra set of parameters. Therefore, a two-step training process for the CNN 200 is used: first, train the original CNN (i.e., without the additional modules 206); then, train the expanded network using the obtained weights to populate the existing modules and initialize newly inserted modules with random weights with relatively small learning ratio. Our experiments show that this approach converges and results in good classification performance.
The performance of the described approach was evaluated for the application of vehicle occupancy detection. In the study, the goal was to classify an image in terms of whether at least one passenger is present in the rear-row seat of a vehicle. The training dataset consisted of a total of 32,260 images, with the same number of passenger and no passenger images. The testing data set had 2082 images. For comparison, the exact same images were processed using three different input sizes, with 256×256, 512×512, and 1024×1024 input sizes with and without the two-step training process. The table below shows the classification accuracy.
Note that in the fourth cell of the first row, with 1024×1024 input, without the two-step training process, the training didn't converge even after 90,000 iterations. The two results listed in the 4th cell of the second row were obtained with the initializations taken from the 512×512 in the first and second rows, respectively. The networks used in the first row were all started from scratch. When considered the error rate in side-window localization, the accuracy listed in the second row of the table is on par with the current classification approaches.
The controller/processor 624 controls the various actions of the computerized device 616, as described below. A non-transitory computer storage medium device 620 (which can be optical, magnetic, capacitor based, etc.) is readable by the controller/processor 624 and stores instructions that the controller/processor 624 executes to allow the computerized device 616 to perform its various functions, such as those described herein.
According to systems and methods herein, the controller/processor 624 may comprise a graphical processing unit or special purpose processor that is specialized for processing image data and includes a dedicated processor that would not operate like a general purpose processor because the dedicated processor has application specific integrated circuits (ASICs) that are specialized for the handling of image processing operations, processing image data, comparing pixel values, etc. In one example, the computerized device 616 is special purpose machine that includes a specialized image processing card having unique ASICs for providing image processing, includes specialized boards having unique ASICs for input and output devices to speed network communications processing, a specialized ASIC processor that performs the logic of the methods described herein using dedicated unique hardware logic circuits, etc.
The input/output device 626 may be used for communications to and from the computerized device 616. The controller/processor 624 controls the various actions of the computerized device. A non-transitory computer storage medium 620 (which can be optical, magnetic, capacitor based, etc.) is readable by the controller/processor 624 and stores instructions that the controller/processor 624 executes to allow the computerized device 616 to perform its various functions, such as those described herein. Thus, as shown in
Those skilled in the art would appreciate that the computer storage medium 620 is not limited to a peripheral device having the program stored therein, which is distributed separately from the device for providing the program to the user. Examples of a removable medium include a magnetic disk (including a floppy disk), an optical disk (including a Compact Disk-Read Only Memory (CD-ROM) and a Digital Versatile Disk (DVD)), a magneto-optical disk (including a Mini-Disk (MD) (registered trademark)), and a semiconductor memory. Alternatively, the computer storage medium 620 may be a hard disk, or the like, which has the program stored therein and is distributed to the user together with the device that contains them.
As would be understood by those ordinarily skilled in the art, the computerized device 616 shown in
Database 722 includes any database or any set of records or data that the computerized device 616 desires to retrieve. Database 722 may be any organized collection of data operating with any type of database management system. The database 722 may contain matrices of datasets comprising multi-relational data elements.
The database 722 may communicate with the computerized device 616 directly. Alternatively, the database 722 may communicate with the computerized device 616 over network 733. The network 733 comprises a communication network either internal or external, for affecting communication between the computerized device 616 and the database 722. For example, network 733 may comprise a local area network (LAN) or a global computer network, such as the Internet.
As will be appreciated by one skilled in the art, aspects of the devices and methods herein may be embodied as a system, method, or computer program product. Accordingly, aspects of the present disclosure may take the form of an entirely hardware system, an entirely software system (including firmware, resident software, micro-code, etc.) or a system combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module”, or “system.” Furthermore, aspects of the present disclosure may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various devices and methods herein. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block might occur out of the order noted in the Figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to various systems and methods. It will be understood that each block of the flowchart illustrations and/or two-dimensional block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. The computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the processes/acts specified in the flowchart and/or block diagram block or blocks.
According to a further system and method herein, an article of manufacture is provided that includes a tangible computer readable medium having computer readable instructions embodied therein for performing the steps of the computer implemented methods, including, but not limited to, the methods illustrated in
The computer program instructions may be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to process in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the process/act specified in the flowchart and/or block diagram block or blocks.
Furthermore, the computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the processes/acts specified in the flowchart and/or block diagram block or blocks.
In case of implementing the systems and methods herein by software and/or firmware, a program constituting the software may be installed into a computer with dedicated hardware, from a storage medium or a network, and the computer is capable of performing various processes with various programs installed therein.
In the case where the above-described series of processing is implemented with software, the program that constitutes the software may be installed from a network such as the Internet or a storage medium such as the removable medium.
Those skilled in the art would appreciate that the storage medium is not limited to a peripheral device having the program stored therein, which is distributed separately from the device for providing the program to the user. Examples of a removable medium include a magnetic disk (including a floppy disk), an optical disk (including a Compact Disk-Read Only Memory (CD-ROM) and a Digital Versatile Disk (DVD)), a magneto-optical disk (including a Mini-Disk (MD) (registered trademark)), and a semiconductor memory. Alternatively, the computer storage medium may be a hard disk, or the like, which has the program stored therein and is distributed to the user together with the device that contains them.
The hardware described herein plays a significant part in permitting the foregoing method to be performed, rather than function solely as a mechanism for permitting a solution to be achieved more quickly, (i.e., through the utilization of a computer for performing calculations). Specifically, printers, scanners, and image processors that alter electronic documents each play a significant part in the methods (and the methods cannot be performed without these hardware elements). Therefore, these hardware components are fundamental to the methods being performed and are not merely for the purpose of allowing the same result to be achieved more quickly.
As would be understood by one ordinarily skilled in the art, the processes described herein cannot be performed by human alone (or one operating with a pen and a pad of paper) and instead such processes can only be performed by a machine. Specifically, processes such as printing, scanning, electronically altering documents using an image processor, etc., require the utilization of different specialized machines. Therefore, for example, the printing/scanning performed by the user device cannot be performed manually (because it can only be done by printing and scanning machines) and is integral with the processes performed by methods herein. In other words, these various machines are integral with the methods herein because the methods cannot be performed without the machines (and cannot be performed by humans alone).
While some exemplary structures are illustrated in the attached drawings, those ordinarily skilled in the art would understand that the drawings are simplified schematic illustrations and that the claims presented below encompass many more features that are not illustrated (or potentially many less) but that are commonly utilized with such devices and systems. Therefore, Applicants do not intend for the claims presented below to be limited by the attached drawings, but instead the attached drawings are merely provided to illustrate a few ways in which the claimed features can be implemented.
Many computerized devices are discussed above. Computerized devices that include chip-based central processing units (CPU's), input/output devices (including graphic user interfaces (GUI), memories, comparators, processors, etc., are well-known and readily available devices produced by manufacturers such as Dell Computers, Round Rock Tex., USA and Apple Computer Co., Cupertino Calif., USA. Such computerized devices commonly include input/output devices, power supplies, processors, electronic storage memories, wiring, etc., the details of which are omitted herefrom to allow the reader to focus on the salient aspects of the systems and methods described herein. Similarly, scanners and other similar peripheral equipment are available from Xerox Corporation, Norwalk, Conn., USA, and the details of such devices are not discussed herein for purposes of brevity and reader focus.
The terminology used herein is for the purpose of describing particular examples of the disclosed structures and methods and is not intended to be limiting of this disclosure. For example, as used herein, the singular forms ‘a’, ‘an’, and ‘the’ are intended to include the plural forms as well, unless the context clearly indicates otherwise. Additionally, as used herein, the terms ‘comprises’, ‘comprising’, ‘includes’, and/or ‘including’, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Further, the terms ‘automated’ or ‘automatically’ mean that once a process is started (by a machine or a user), one or more machines perform the process without further input from any user.
The corresponding structures, materials, acts, and equivalents of all means or step plus process elements in the claims below are intended to include any structure, material, or act for performing the process in combination with other claimed elements as specifically claimed. The descriptions of the various devices and methods of the present disclosure have been presented for purposes of illustration but are not intended to be exhaustive or limited to the devices and methods disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described devices and methods. The terminology used herein was chosen to best explain the principles of the devices and methods, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the devices and methods disclosed herein.
It will be appreciated that the above-disclosed and other features and processes, or alternatives thereof, may be desirably combined into many other different systems or applications. Those skilled in the art may subsequently make various presently unforeseen or unanticipated alternatives, modifications, variations, or improvements therein, which are also intended to be encompassed by the following claims. Unless specifically defined in a specific claim itself, steps or components of the systems and methods herein should not be implied or imported from any above example as limitations to any particular order, number, position, size, shape, angle, color, temperature, or material.
The present invention claims the benefit under 35 U.S.C. § 120 as a Division of U.S. patent application Ser. No. 15/194,757 filed on Jun. 28, 2016, the entire teachings of which are incorporated herein by reference, in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 15194757 | Jun 2016 | US |
Child | 16367309 | US |