Foreground object detection from multiple images

A method for determining a salient region of an image is disclosed. For a plurality of different saliency cue functions, a single saliency value is calculated for each pixel in a plurality of adjacent pixels in an image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast with the region's background and another of the saliency cue functions is based on a foreground and background color models of the image. A classifier is used to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel. The salient region of the pixels is determined with a subwindow search based on the combined single saliency values.

BACKGROUND

Accurate saliency detection (a.k.a. subject or foreground detection) can be used for auto cropping images or for restricting annotation, visual similarity search, or clustering to images' subjects. In some auto cropping, visual similarity search, or clustering problems, multiple related images exist. For instance, online news aggregators collect images for the same story from many sources or for an ongoing story, a continuing sequence of images from one source.

SUMMARY

In general, one aspect of the subject matter described in this specification can be embodied in a method that includes for a plurality of different saliency cue functions, calculating a single saliency value for each pixel in a plurality of adjacent pixels in an image using the saliency cue function. One of the saliency cue functions is based on whether the pixel is in a region of the pixels whose colors contrast with the region's background and another of the saliency cue functions is based on foreground and background color models of the image. A classifier is used to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel. A salient region of the pixels is determined with a subwindow search based on the combined single saliency values.

Another aspect of the subject matter described in this specification can be embodied in a method that includes for each image in a set of images and for a plurality of different saliency cue functions, a single saliency value is calculated for each pixel in the image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast with the region's background and another of the saliency cue functions is based on foreground and background color models of the image. Each image in the set of images is segmented into two or more segments. For each segment, a diverse density saliency value is calculated for the segment indicating how similar the segment is to the other segments in each image in the set of images. A linear combination is used to calculate a combined diverse density saliency value for each pixel based on a combined single saliency value calculated based on the single saliency values for the pixel and the diverse density saliency value of the segment including the pixel. A salient region of the pixels of each image is determined with a subwindow search based on the combined single saliency values.

Saliency cues based on whether the pixel is in a region of the image whose colors contrast with the region's background and based on foreground and background color models of the image allow for a more accurate salient region detection. Using multiple image, rather than a single image, also allows for a more accurate salient region detection.

DETAILED DESCRIPTION

FIGS. 1aand1billustrate an image100. The image100is one that has not been processed by the salient region detection system described below. The subject of the image100is the car as identified by the human eye. The system described will show how the image100can be processed intoFIG. 1bwhere the car102is automatically detected.

FIG. 2illustrates an example system200for identifying candidate salient regions of an image. A salient region is a main subject of an image. For example, in an image of a swimmer swimming in a pool, the salient region is the swimmer. In an image of a car on a road, the main image is the car. The system200includes an image engine204that performs one or more functions for identifying salient regions in a set of images. The system200generally, for a plurality of different saliency cue functions, calculates a single saliency value for each pixel in a plurality of adjacent pixels in an image using the saliency cue functions, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast with the region's background and another of the saliency cue functions is based on a foreground and background color models of the image. The system200uses a classifier to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel, determines a salient region of the pixels with a subwindow search based on the combined single saliency values.

The system200can also identify the salient region using another method. The system200generally, for each image in a set of images and for a plurality of different saliency cue functions, calculates a single saliency value for each pixel in a plurality of adjacent pixels in an image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast with the region's background and another of the saliency cue functions is based on a foreground and background color models of the image. The system200segments each image in the set of images into two or more segments. For each segment, the system200calculates a diverse density saliency value for the segment indicating how similar the segment is to the other segments in each image in the set of images. The system200uses a linear combination to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel and the diverse density saliency value, and determines a salient region of the pixels with a subwindow search based on the combined single saliency values.

These processes will be described in greater detail below.

Single Image Saliency

The system200includes a data store202that includes one or more images. An image engine204calculates single saliency values using saliency cue functions and combines them into a final saliency map by scoring individual pixels of an image with a Support Vector Machine (SVM) or other classifier. A saliency map is a matrix or image that provides an estimate of how salient pixels in the image are. One SVM that can be used is the Pegasos SVM, described in S. Shalev-Shwartz, Y. Singer, and N. Srebro. “Pegasos: Primal estimated sub-gradient solver for SVM.” ACM international conference on machine learning, 2007. A salient region, e.g., rectangle, is the one region that best encompasses the strong responses in the final saliency map while excluding the weak responses, and which is detected using an efficient subwindow search (ESS).

In some implementations, one saliency cue function is a multi-scale cue function and is based on a multi-scale contrast of a pixel. Contrast information, such as strong gradient regions and edges, is commonly known for stimulating the human visual attention system and therefore has been widely used as a feature for saliency detection. The image engine204captures the contrast information by averaging gradient information across multiple level of a Gaussian pyramid. The single saliency value is calculated based on the multi-scale contrast cue according to the following formula:

f1⁡(x)=∑s=1N⁢∑x′∈W⁡(x)⁢Is⁡(x)-Is⁡(x′)2(1)
where s is the scale in the N-level Gaussian pyramid and W(x) is a square window centered at pixel x.

Another saliency cue function is a color spatial distribution cue function and is based on a spatial distribution of a pixel's color. The degree of spatial scatter of a certain color cluster can be evaluated in order to generate this cue. Non-parametric density estimation and a mean shift algorithm are used to determine the number of color clusters. Non-parametric density estimation is described in Duda, Hart, and Stork, “Pattern Classification,” Second edition, Wiley Interscience, 2000. The mean shift algorithm is described in Comaniciu and Meer, “Mean Shift: A robust approach toward feature space analysis,” IEEE Pattern Analysis and Machine Intelligence, May 2002. The degree of scatter of each color cluster is evaluated. The single saliency value of the pixel is set to be inversely proportional to the degree of scatter of the cluster to which it belongs.

Another saliency cue function is a super-pixel based center surround cue and is based on whether the pixel is in a region of the image whose colors contrast with the region's background. For each pixel in an image, a determination is made as to whether the pixel is part of a region whose colors contrast highly with the region's background, i.e., has a high center-surround. A set of super-pixels is defined as:
S={si|i=1, . . . ,M} composed byMsuper-pixels.
Super-pixel computation is described in the algorithm described in P. Felzenszwalb and D. Huttenlocher. “Efficient graph-based image segmentation.” International Journal of Computer Vision, 2(50): 167-181, 2004. A neighborhood of super-pixel is defined as:
N(s)={si|siis 8−connected tos}
(if s touches the boundaries of the image, the image engine204mirrors it adding a super-pixel identical to s to its neighborhood). χSN2(s) the chi square distance between the color histogram of s and the color histogram of N(s) is calculated. The algorithm for calculating the single saliency value of a pixel based on the super-pixel based center surround cue, described below as Algorithm 1, starts from each super-pixel and expands it, by taking the union with the neighbor that produces the highest χSN2. In the process the χSN2value can be recorded as a measure of saliency for the current super-pixel. The expansion is terminated when it covers the entire image domain. In some implementations, the expansion process can be limited to a certain number of iterations, which can significantly speed up the computation and has little effect on the obtained saliency map, a per pixel map that indicates the pixel's saliency.

where S is a set of pixels in the image, N(t) is a set of neighboring segments of t, and χSN2(s) the chi square distance between a color histogram of s and a color histogram of N(s)

Another saliency cue function is a color model cue and is based on foreground and background color models of the image. This cue reflects the tendency for subjects to be closer to the center of the image than the edge. The image engine204randomly samples locations on the image with high probability close to an image center and low probability at the image boundaries. The sampled values can then be used to train a Gaussian Mixture Model (GMM), which would be the model for the foreground object, while the remaining pixels can be used to train a GMM for the background. For every pixel x, the image engine204evaluates the two conditional probabilities of belonging to the foreground histogram (P(x|F)) and of belonging to the background histogram (P(x|B)). The single saliency value of pixel x is calculated based on the foreground and background color models according to the following formula:

In some implementations, the image engine204uses the single saliency values for the pixels in an image to identify salient regions in the image. The image engine204first normalizes one or more of the single saliency values to the range [0,1]. The image engine204then learns the parameters of an SVM classifier, with a Gaussian kernel, to fuse the information from these saliency cue functions. For each pixel x, the SVM classifier takes as input the one or more of the single saliency values for the saliency cue functions, and produces a global pixel-wise saliency measure fG(x), which is then again normalized to the range [0,1].

In some implementations, the SVM classifier is trained using training images where humans have hand marked salient rectangles in each. For each training image, a number of random pixels in the interior of the rectangle and the same number in the exterior are selected, and the image engine204make a training sample for each of those random pixels by combining the saliency values for that pixel in the four single-cue saliency maps into a four-dimensional vector. For example, 1000 random pixels can be selected in the interior and 1000 random pixels can be selected in the exterior. These four-dimension training vectors can be marked as positive or negative examples based on whether the pixel was on the inside or outside of the human-marked salient region. For training the SVM the image engine204can use a predetermined number of iterations of the existing Pegasos SVM training algorithm on those training vectors.

In some implementations, to make a combined saliency map from the individual feature maps after training, the image engine204can make a four-dimensional vector for each pixel from the values for that pixel in the four individual feature maps, and supplies the four-dimensional vector to the SVM, which scores the vector, and calculates the combined single saliency value for each pixel. The image engine204can then insert the score into the combined saliency map at that pixel.

In some implementations, the image engine204identifies an image's salient region by first finding a region, e.g., a rectangle R, that maximizes the following equation:

where f is the combined single saliency value, and RCis the complement of R.

In order to accomplish the maximization, the image engine204uses ESS, a branch and bound technique, described in described in Lampert, Blaschko, and Hofmann, “Beyond sliding windows: object localization by efficient subwindow search.” IEEE Conference on computer vision and pattern recognition, 2007. To avoid an O(n4) exhaustive search of all rectangles, ESS prunes parts of the search space that cannot contain the optimal rectangle by applying an upper bound {circumflex over (q)} for q over a rectangle set R whose innermost and outermost rectangles are Rminand Rmax. The bound must satisfy: {circumflex over (q)}(R)≧maxRεRq(R) and {circumflex over (q)}(R)=q(R) if R is the only element in R. By rewriting Equation (3) as:
q(R)=q1(R)+q2(R)  (4)

q1⁡(R)=∑x∈R,f⁡(x)<0.5⁢f⁡(x)+∑x∈RC,f⁡(x)<0.5⁢1-f⁡(x)(5)q2⁡(R)=∑x∈R,f⁡(x)≥0.5⁢f⁡(x)+∑x∈RC,f⁡(x)≥0.5⁢1-f⁡(x)(6)
then a bound that satisfies these requirements is:
{circumflex over (q)}(R)=q1(Rmin)+q2(Rmax)  (7)

FIG. 3illustrates saliency cue functions detected on an image302.FIG. 3illustrates as an input image, image302. Four feature maps304,306,308, and310have been determined based on four saliency cue functions for the image302. Saliency map304is based on the color spatial distribution cue function. Saliency map306is based on the foreground and background color models. Saliency map308is based on the super-pixel based center surround distance cue function. Saliency map310is based on the multiscale contrast cue function. These four saliency cue functions are processed by the SVM described above to generate a combined saliency map312, which includes a combined single saliency value for each pixel in the image302. The combined saliency map312including the combined single saliency values are then processed using ESS described above to produce the salient region314.

Diverse Density

In some implementations, a saliency map is calculated for a set of images, and the saliency map is based on a diverse density measure which gives a segment of an image a high weight if there is a similar segment in most other images in the set, and will give a segment a low weight if most images in the set do not contain a similar segment. The set of images can be associated with a similar topic, e.g., a set of images about “swimming.”

In some implementations, the image engine204segments each of the images in the set into segments. The images can be segmented using a graph-based segmentation algorithm of Felzenszwalb and Huttenlocher described in P. Felzenszwalb and D. Huttenlocher “Efficient graph-based image segmentation.” International Journal of Computer Vision, 2(59): 167-181, 2004.

The image engine204identifies the segments that are similar across the image set. For example, in a set of images associated with the topic of “swimming,” it is the swimmer that would typically be the most consistent object and thus a saliency map based on multiple images, a diverse density saliency map, will provide higher emphasis on the swimmers.

In some implementation, the image engine204computes a diverse density saliency map for each segment indicating how similar the segment is to the other segments in each image in the set of images. For segments si,sjthe image engine204uses a similarity measure dist(si,sj) that combines a texton histogram, a LAB color histogram, and segment shape information. Given an image X and segment s from some other image in the set, the image engine204defines

Therefore, the distance between a segment siand image X is defined based on the closest matching segment to siin X. The image engine204then defines a diverse density measure, DD, for each segment. Let L be the provided set of related images. For each image XεL and segment sεX, the image engine204defines
DD(s,X)=πYεL−{X}exp−dist2(s,Y)/σ2.

As indicated, the product goes over all images Y in the set L other than X. The parameter σ controls the amount by which the diverse density value decays for a segment as the distance of the best matching segment in the other image increases. In some implementations, σ=0.6. Finally, the image engine204normalizes DD(s, X) to be in the range [0, 1].

In some implementations, the image engine204also calculates a single saliency map for each pixel in the image using the saliency cue functions described above. The image engine204then combines the single saliency maps of each image with the diverse density saliency map to create a combined saliency map in which the value for each pixel P of image XεL is wDD(p)+(1−w)f(p) where DD(p) is the value of DD(s,X) for segment s that includes p, and f(p) is the combined single saliency value for the pixel calculated as described above. In some implementations, w=0.6.

In some implementations, the image engine204determines the salient region of the pixels with the subwindow search based on the combined diverse density saliency values using the following formula, as described above.

q⁡(R)=q1⁡(R)+q2⁡(R)(4)q1⁡(R)=∑x∈R,f⁡(x)<0.5⁢f⁡(x)+∑x∈RC,f⁡(x)<0.5⁢1-f⁡(x)(5)q2⁡(R)=∑x∈R,f⁡(x)≥0.5⁢f⁡(x)+∑x∈RC,f⁡(x)≥0.5⁢1-f⁡(x)(6)
then a bound that satisfies these requirements is:
{circumflex over (q)}(R)=q1(Rmin)+q2(Rmax)  (7)

FIG. 4illustrates images that have salient regions detected using the diverse density saliency map.FIG. 4illustrates an example in which the single saliency map402focuses on a portion of the image. The salient region402is determined with the subwindow search described above based on the saliency map404. In contrast the diverse density saliency map406focuses on a segment that includes both the swimmer and some of the pool. The salient region408is determined with the subwindow search based on the single saliency map404and the diverse density saliency map406. By combining these two maps into a combined map410, a much better salient region412is obtained.

Color Models

In some implementations, the image engine204identifies color models208-210using the salient regions206found in random subsets of the images using either the single saliency method or the diverse density method. By way of illustration, color models208to210from candidate salient regions in 1,000 random subsets of the images can be used, and the color models can be 7×7×7 histograms of the RGB color values inside and outside the rectangles, as shown inFIG. 5a.

In some implementations, the image engine204builds foreground and background color models using the salient regions206. Foreground and background models are built for a number of random sets of images. For example, 1000 foreground and background models are built using subsets of 10 or more of the images. Each model can be a histogram of RGB values inside and outside of the regions. For example the models are 10×10×10 histograms of the RGB values.

For each color model208-210and image combination, the image engine204identifies a color model candidate region207that best matches the color models208-210. The image engine204identifies the color model candidate region207by identifying the image rectangle R whose interior and exterior histograms hR, hRCbest match the model's foreground and background histograms hF, hB, by minimizing with respect to R:
χ2(hF,hR)+χ2(hB,hRC)  (8)

where RCis the complement of R, and:

In some implementations, the image engine204scores each foreground and background model208-210using the sum of χ2distances between the interior and exterior histograms of the rectangles found above. The image engine204can select the model with the highest score as the final model.

In some implementations, the image engine204identifies a final salient region212in each image based on the score of each color model. The image engine204identifies the color model with the highest score and identifies as the final salient region for each image, the color model candidate region identified using the identified color model with the highest score.

FIG. 5aillustrates a histogram displaying counts of RGB pixel values. The histogram500is a 7×7×7 histogram showing the counts of RGB pixel values, representing a model of colors in an images' foreground or background.

FIG. 5billustrates identifying a salient region candidate that best matches a color model.FIG. 5bshows three images506,508, and510and three color models501,511, and521. Each color model includes a 7×7×7 histogram for the foreground (502,512,522) and a 7×7×7 histogram for the background (504,514,524). In each image, the candidate salient region that best matches the color model is shown.

For example, image506includes a region507that best matches the color model1. Image508includes a region509that best matches the color model1. Image510includes a region511that best matches the color model1. Image506includes a region516that best matches the color model2. Image508includes a region518that best matches the color model2. Image510includes a region520that best matches the color model2. Image506includes a region526that best matches the color model3. Image508includes a region528that best matches the color model3. Image510includes a region530that best matches the color model3.

Below each image is the chi-squared distance in color pixel histograms between the interior of the box and the exterior of the box. The chi squared distance is calculated using Algorithm 1 described above.

For example, the chi-squared distance of image506for the color model1is 10, the chi-squared distance of image508for the color model1is 20, and the chi-squared distance of image510for the color model1is 15. The chi-squared distance of image506for the color model 2 is 15, the chi-squared distance of image508for the color model2is 25, and the chi-squared distance of image510for the color model2is 40. The chi-squared distance of image506for the color model3is 5, the chi-squared distance of image508for the color model3is 4, and the chi-squared distance of image510for the color model3is 20.

The sum chi-squared distances for each color model is also displayed. For color model1the total sum is 45, for color model2the total sum is 80, and for color model3the total sum is 29.

The sum of chi-squared distances for each model are compared and the greatest distance, 80 for model2is selected. Therefore model2is selected as the model that best describes the common foreground object in the images.

FIG. 6illustrates an example process for detecting salient regions on an image. For a plurality of different saliency cue functions, a single saliency value is calculated for each pixel in a plurality of adjacent pixels in an image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the pixels whose colors contrast with the region's background and another of the saliency cue functions is based on foreground and background color models of the image (602). For example, the image engine204can, for a plurality of different saliency cue functions, calculate a single saliency value for each pixel in a plurality of adjacent pixels in an image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the pixels whose colors contrast with the region's background and another of the saliency cue functions is based on foreground and background color models of the image. A classifier is used to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel (604). For example, the image engine204can use a classifier to calculate a combined single saliency value for each pixel based on the single saliency values for the pixel. The classifier can be an SVM. A salient region of the pixels is determined with a subwindow search based on the combined single saliency values (606). For example, the image engine204can determine a salient region of the pixels with a subwindow search based on the combined single saliency values.

FIG. 7illustrates another example process for detecting salient regions on an image. For each image in a set of images and for a plurality of different saliency cue functions, a single saliency value is calculated for each pixel in the image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast With the region's background and another of the saliency cue functions is based on foreground and background color models of the image (702). For example, the image engine204can calculate a single saliency value for each pixel in the image using the saliency cue function, wherein one of the saliency cue functions is based on whether the pixel is in a region of the image whose colors contrast with the region's background and another of the saliency cue functions is based on foreground and background color models of the image. Each image is segmented in the set of images into two or more segments (704). For example, the image engine204can segment each image in the set of images into two or more segments. For each segment, a diverse density saliency value is calculated for the segment indicating how similar the segment is to the other segments in each image in the set of images (706). For example, the image engine204can, for each segment, a diverse density saliency value is calculated for the segment indicating how similar the segment is to the other segments in each image in the set of images. A linear combination is used to calculate a combined single saliency value for each pixel based on a combined single saliency value calculated based on the single saliency values for the pixel and the diverse density saliency value of the segment including the pixel (708). For example, the image engine204can use a linear combination to calculate a combined single saliency value for each pixel based on a combined single saliency value calculated based on the single saliency values for the pixel and the diverse density saliency value of the segment including the pixel. A salient region of the pixels of each image is determined with a subwindow search based on the combined single saliency values (710). For example, a salient region of the pixels of each image is determined with a subwindow search based on the combined single saliency values.