The present systems and methods relate generally to classification of video data, files, or streams, and more particularly to semantic classification of shots or sequences in videos based on video content for purposes of content-based video indexing and retrieval, as well as optimizing efficiency of further video analysis.
Image classification systems (i.e. systems in which the content of a single image or photograph is analyzed to determine an appropriate label or descriptor for the image) are known in the art. Such systems are generally used to label or classify images according to predefined textual descriptors. Typically, an image classification system analyzes an image via the use of one or more “classifier” algorithms (described in greater detail below) that identify a predefined label that matches or partially matches an image based on the image content and associate the identified label with the image. For example, an image of a horse on a farm may be labeled “horse,” or “farm,” or both. In some systems, an image or photo may be labeled according to broad categories of image content (e.g. indoor or outdoor, city or landscape, etc.), whereas other systems utilize more narrow categories (e.g. desert, ocean, forest, car, person, etc.). Some systems even classify images based on identified persons in the image (e.g. celebrities, political figures, etc.), objects in the image, etc. These labels or classifications are useful for a variety of purposes, such as association with metadata tags or other identification mechanisms for use in image indexing and retrieval systems, surveillance and security systems, and other similar image recognition purposes.
Such image classification systems utilize a variety of methods to classify images, with varying results. One such technique involves examining the power spectrum of an image in conjunction with Principal Components Analysis (PCA) to identify the type of content in the image, as described in A. Torralba and A. Oliva, Statistics of Natural Image Categories, Network: Computation in Neural Systems, vol. 14, pp. 391-412 (2003). Other approaches include using a “bag of words” with Scale Invariant Feature Transform (SIFT) descriptors (see P. Quelhas and J. Odobez, Natural Scene Image Modeling Using Color and Texture Visterms, Conference on Image and Video Retrieval (CIVR), Phoenix Ariz. (2006)) in combination with Latent Dirichlet Allocation (see L. Fei-Fei and P. Perona, A Bayesian Hierarchical Model for Learning Natural Scene Categories, IEEE Conference on Computer Vision and Pattern Recognition (2005)), probabilistic Latent Semantic Analysis (see A. Bosch et al., Scene Classification Via pLSA, ECCV (4), pp. 517-30 (2006)), or a spatial pyramid (see S. Lazebnik et al., Beyond Bags of Features: Spatial Pyramid Matching for Recognizing Natural Scene Categories, IEEE Conference on Computer Vision and Pattern Recognition, vol. 2, pp. 2169-78 (2006)).
Additional approaches to image classification include using a Two-Dimensional (2D) hidden Markov model (see J. Li and J. Z. Wang, Automatic Linguistic Indexing of Pictures by a Statistical Model Approach, IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 25, no. 10 (2003)), as well as a wavelet coefficients representation of features with hierarchical Dirichlet process hidden Markov trees (see J. J. Kivinen et al., Learning Multiscale Representations of Natural Scenes Using Dirichlet Processes, IEEE 11th International Conference on Computer Vision (2007)). Still further image classification systems divide an image into a rectangular grid and classify the proportion of “material” (i.e. category of content) in each grid cell (see, e.g., J. Shotton et al., Semantic Texton Forests for Image Categorization and Segmentation, IEEE Computer Vision and Pattern Recognition (2008); J. Vogel and B. Schiele, Natural Scene Retrieval Based on a Semantic Modeling Step, Conference on Image and Video Retrieval (CIVR) (2004); etc.). In these systems, the occurrence of each material over the image is computed and the image is classified based on the resulting material occurrence vector.
Regardless of the specific approach, conventional image classification systems are ill-equipped to classify videos or portions of videos. Conventional systems are designed to analyze individual images in which care is taken to carefully frame the subject of the image (i.e. the scene) in a clear manner, whereas videos typically include a variety of types of images or frames, many of which are blurry or contain occluded portions. Additionally, the features used in single-image classification systems are often designed for narrow and particular purposes, and are unable to identify and classify the wide array of content present in most videos. Further, even if conventional systems were able to classify images from a video, these systems include no defined mechanism to account for the presence of a multitude of scene types across a video or portion of video (i.e. identification or classification of a single image or frame in a video does not necessarily indicate that the entire shot within the video from which the frame was extracted corresponds to the identified image class). As used herein, a “shot” defines a unit of action in a video filmed without interruption and comprising a single camera view.
In addition to those mentioned, classification of video, or shots within video, presents further challenges because of the variations and quality of images present in most videos. In most video sequences, only part of the scene is visible in most frames. As used herein, “scene” refers to the setting or content of the image or video desirous of classification (i.e. the context or environment of a video shot) (e.g. desert, mountainous, sky, ocean, etc.). In many videos, wide-angle shots are interspersed with close-up shots. During the close-up shots, the camera is typically focused on the subject of interest, often resulting in a blurred background, thus confusing any part of the scene type that is visible. Most videos also include shots in which either the camera or objects within the scene are moving, again causing blurring of the images within the shot.
Additionally, scene content in videos often varies immensely in appearance, resulting in difficulty in identification of such content. For example, images of buildings vary in size, color, shape, materials from which they are made, etc.; trees change appearance depending on the season (i.e. leaves change color in the fall, branches become bare during the winter, etc.); snow may be present in any type of outdoor scene; etc. In addition, the subject of a video shot may be filmed from different angles within the shot, causing the subject to appear differently across frames in the shot. Thus, because video often represents wide varieties of content and subjects, even within a particular content type, identification of that content is exceedingly difficult.
Further, use of raw or basic features, which are sufficient for some conventional image classification systems, are insufficient for a video classification system because videos typically include a multiplicity of image types. For example, the color distribution may be the same for a beach shot with white sand as for a snow-covered prairie, or an ocean shot compared to a sky shot, etc. Additionally, the mere detection or identification of a color or type of material in a scene does not necessarily enable classification of the scene. For example, a snow-tipped mountain covered with forest has a similar distribution of materials and colors as a close-up view of evergreen trees emerging from a snow-blanketed base. Accordingly, the use of strong features, as well as the spatial arrangement of materials identified by those features, is helpful in labeling the wide variety of images in video to enable accurate classification of shots within video.
One system that attempts to overcome the previously-described hurdles in order to classify videos is the “Vicar” system, described in M. Israel et al., Automating the Construction of Scene Classifiers for Content-Based Video Retrieval, MDM/KDD'04 (2004). The Vicar system selects one or more representative or “key” frames from a video, and divides each of the key frames into a grid. Each grid cell is further divided into rectangular “patches,” and each patch is classified into a general category (e.g. sky, grass, tree, sand, building, etc.) using color and texture features and a k-Nearest Neighbor classifier. The frequency of occurrence of each category in each grid cell is computed and used to classify the overall image. This system infers that if a representative frame or frames comprise a certain type of image, then the entire shot or video likely corresponds to the same type, and is thus labeled accordingly.
The Vicar system, however, has many drawbacks that produce inconsistent results. For example, selection of key frames is a relatively arbitrary process, and an easily-classifiable frame (i.e. clear, non-occluded, etc.) is not necessarily representative of the scene type(s) associated with a shot or video from which the frame was selected. Further, the key frames are partitioned based on a predetermined grid, such that resulting grid cells may (and often do) contain more than one category, thus leading to confusion of scene types. Also, the color and texture features used in the system are relatively weak features which are inadequate for classifying many categories of images. Additionally, the inference that a key frame or frames adequately and accurately represents an entire sequence of frames does not take into account variations in shots, especially for long or extended shots in videos.
Video classification has many practical uses. For example, accurate and efficient classification of video, or shots within video, enables content-based video indexing and retrieval. Such indexing and retrieval is useful for cataloguing and searching large databases of videos and video clips for use in promotional advertisements, movie and television trailers, newscasts, etc. Additionally, by classifying videos and thus narrowing the scope of videos that contain certain subject matter, processing times and accuracy of other, related image or video analysis algorithms is improved. Further, identification and classification of disparate shots within a video enables shot boundary detection and indexing associated with the video.
For these and many other reasons, there is a continuing need for a system or method that accurately and efficiently classifies shots in video based on a plurality of images or frames associated with the shot. There is a further need for a system that is able to classify shots as belonging to multiple classes of scene types, and identify particular timecodes within the video shot at which scene classes vary.
Briefly described, and according to one embodiment, the present disclosure is directed to a system for classifying videos based on video content, comprising a processor, one or more software modules including one or more classifiers, and a computer program product. The computer program product includes a computer-readable medium that is usable by the processor, the medium having stored thereon a sequence of instructions associated with the one or more software modules that when executed by the processor causes the execution of the steps of receiving a video file, the video file including a plurality of frames; extracting a subset of frames from the video file; if one or more frames in the extracted subset of frames comprises a dark frame, discarding the one or more dark frames from the subset; and determining whether each frame in the extracted subset includes content associated with a general content category. The processor causes further execution of the steps of, for each frame in the extracted subset that includes content associated with the general content category, generating a scene classification score vector for the frame via one or more scene classifiers, the scene classification score vector including one or more scene classification scores associated with one or more predefined scene categories within the general content category; determining a representative scene classification score vector for the video file based on the generated scene classification score vectors for each extracted frame in the subset that includes content associated with the general content category; and associating the video file with the one or more predefined scene categories based on the representative scene classification score vector.
According to one aspect of the present system, the one or more software modules are selected from the group comprising: an intensity classification module, an indoor/outdoor classification module, an outdoor classification module, a segmentation module, a material arrangement module, and a video file classification module.
According to another aspect, the step of generating the scene classification score vector for each frame in the extracted subset of frames that includes content associated with the general content category further comprises the steps of dividing the frame into one or more segments based on image content in each segment; generating a material classification score vector for each segment, each material classification score vector including one or more material values associated with one or more predefined material content types, wherein each material value represents a probability that the respective segment includes that type of material content; assigning the material classification score vector for each segment to each respective pixel in the segment; generating a material arrangement vector for the frame based on the material classification score vectors assigned to each pixel; and classifying the material arrangement vector via the one or more scene classifiers to generate the scene classification score vector for the frame.
According to a further aspect, the adjacent segments are combined based on similar content properties of the segments. In one aspect, the one or more predefined material content types are selected from the group comprising: building, grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous. According to another aspect, the material arrangement vector represents the spatial arrangement of material content in the frame.
According to an additional aspect, a dark frame comprises a frame shot in low or no light. According to another aspect, the processor causes execution of the further step of determining whether any of the frames in the extracted subset of frames comprises a dark frame. In one aspect, the step of determining whether any of the frames in the extracted subset of frames comprises a dark frame further comprises the steps of, for each frame, dividing the frame into a plurality of grid cells; calculating an intensity value for each pixel in each cell; calculating an average intensity value across all pixels in each cell; concatenating the average intensity values for each cell in the frame to form an intensity feature vector for the frame; and classifying the intensity feature vector via an intensity classifier to determine if the frame comprises a dark frame.
According to yet another aspect, the step of determining whether each frame in the extracted subset includes content associated with the general content category further comprises the steps of extracting a plurality of features from each frame; generating a feature vector for each frame, wherein each feature vector includes the extracted features for the respective frame; and classifying the feature vector for each frame via a general category classifier to determine whether each frame includes content associated with the general content category.
According to still another aspect, the general content category comprises outdoor content. In one aspect, the one or more predefined scene categories are selected from the group comprising: coast/beach, desert, forest, grassland, highway, indoor, lake/river, mountainous, open water, outdoor, sky, snow, and urban.
According to a further aspect, each of the one or more scene classification scores represents the probability that a frame includes content associated with each of the respective predefined scene categories. In one aspect, each of the one or more scene classification scores comprises a value greater than or equal to zero and less than or equal to one.
According to an additional aspect, the representative scene classification score vector comprises a statistical property of the generated scene classification score vectors. In one aspect, the statistical property is selected from the group comprising: average, median, maximum, and minimum.
According to a yet further aspect, the step of associating the video file with the one or more scene categories further comprises the steps of identifying representative scene classification scores in the representative scene classification score vector that exceed a predetermined threshold value; and, for each representative scene classification score that exceeds the threshold value, associating the video file with the one or more predefined scene categories associated with the classification scores that exceeded the threshold value.
According to one aspect, the video file comprises a shot of video.
According to a still another aspect, the processor causes further execution of the step of generating a report including the one or more predefined scene categories associated with the video file.
According to an additional aspect, the one or more scene categories associated with the video file are used for indexing and retrieval of the video file.
According to another embodiment, the present disclosure is directed to a method for classifying videos based on video content, comprising the steps of receiving a video file, the video file including a plurality of frames; extracting a subset of frames from the video file; if one or more frames in the extracted subset of frames comprises a dark frame, discarding the one or more dark frames from the subset; and determining whether each frame in the extracted subset includes content associated with a general content category. The method further comprises the steps of, for each frame in the extracted subset that includes content associated with the general content category, generating a scene classification score vector for the frame via one or more scene classifiers, the scene classification score vector including one or more scene classification scores associated with one or more predefined scene categories within the general content category; determining a representative scene classification score vector for the video file based on the generated scene classification score vectors for each extracted frame in the subset that includes content associated with the general content category; and labeling the video file according to the one or more predefined scene categories based on the representative scene classification score vector.
According to one aspect of the present method, the step of generating the scene classification score vector for each frame in the extracted subset of frames that includes content associated with the general content category further comprises the steps of dividing the frame into one or more segments based on image content in each segment; generating a material classification score vector for each segment, each material classification score vector including one or more material values associated with one or more predefined material content types, wherein each material value represents a probability that the respective segment includes that type of material content; assigning the material classification score vector for each segment to each respective pixel in the segment; generating a material arrangement vector for the frame based on the material classification score vectors assigned to each pixel; and classifying the material arrangement vector via the one or more scene classifiers to generate the scene classification score vector for the frame.
According to a further aspect, the adjacent segments are combined based on similar content properties of the segments. In one aspect, the one or more predefined material content types are selected from the group comprising: building, grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous. According to another aspect, the material arrangement vector represents the spatial arrangement of material content in the frame.
According to an additional aspect, a dark frame comprises a frame shot in low or no light. According to another aspect, the method comprises the further step of determining whether any of the frames in the extracted subset of frames comprises a dark frame. In one aspect, the step of determining whether any of the frames in the extracted subset of frames comprises a dark frame further comprises the steps of, for each frame, dividing the frame into a plurality of grid cells; calculating an intensity value for each pixel in each cell; calculating an average intensity value across all pixels in each cell; concatenating the average intensity values for each cell in the frame to form an intensity feature vector for the frame; and classifying the intensity feature vector via an intensity classifier to determine if the frame comprises a dark frame.
According to yet another aspect, the step of determining whether each frame in the extracted subset includes content associated with the general content category further comprises the steps of extracting a plurality of features from each frame; generating a feature vector for each frame, wherein each feature vector includes the extracted features for the respective frame; and classifying the feature vector for each frame via a general category classifier to determine whether each frame includes content associated with the general content category.
According to still another aspect, the general content category comprises outdoor content. In one aspect, the one or more predefined scene categories are selected from the group comprising: coast/beach, desert, forest, grassland, highway, indoor, lake/river, mountainous, open water, outdoor, sky, snow, and urban.
According to a further aspect, each of the one or more scene classification scores represents the probability that a frame includes content associated with each of the respective predefined scene categories. In one aspect, each of the one or more scene classification scores comprises a value greater than or equal to zero and less than or equal to one.
According to an additional aspect, the representative scene classification score vector comprises a statistical property of the generated scene classification score vectors. In one aspect, the statistical property is selected from the group comprising: average, median, maximum, and minimum.
According to a yet further aspect, the step of labeling the video file further comprises the steps of identifying representative scene classification scores in the representative scene classification score vector that exceed a predetermined threshold value; and, for each representative scene classification score that exceeds the threshold value, associating the video file with the one or more predefined scene categories associated with the classification scores that exceeded the threshold value.
According to one aspect, the video file comprises a shot of video.
According to still another aspect, the method further comprises the step of generating a report based on the labeled video file.
According to an additional aspect, the labeled one or more scene categories are used for indexing and retrieval of the video file.
According to a further embodiment, the present disclosure is directed to a method for classifying videos based on video content, comprising the steps of receiving a video file, the video file including a plurality of frames, wherein each frame includes a plurality of pixels; and extracting a set of frames from the video file. The method further comprises the steps of, for each frame in the extracted set of frames, determining whether the frame comprises a poor classification frame; if one or more frames in the extracted set of frames comprises a poor classification frame, removing the one or more poor classification frames from the set; dividing each frame in the set of frames into one or more segments, wherein each segment includes relatively uniform image content; and extracting image features from each segment to form a feature vector associated with each segment. The method comprises the additional steps of generating a material classification score vector for each segment via one or more material classifiers based on the feature vector associated with each segment, wherein each material classification score vector includes one or more material classification scores associated with one or more predefined material content categories; and assigning each material classification score vector associated with its respective segment to each pixel in each respective segment for each respective frame in the set of frames.
According to one aspect, the method further comprises the step of storing the material classification score vectors assigned to each pixel in a database for subsequent use in video file classification.
According to another aspect, the method further comprises the step of combining adjacent segments based on similar image content features extracted from the segments.
According to an additional aspect, poor classification frames are determined via one or more classifiers. In one aspect, a poor classification frame comprises a frame associated with at least one of the following frame types: a frame shot in low light, a frame shot at night, a blurry frame, and an undetermined frame.
According to a further aspect, image features comprise one or more features selected from the group comprising: color features, edge features, line features, texture features, and shape features. In one aspect, image features comprise data associated with image content.
According to yet another aspect, the one or more material classifiers are hierarchically related.
According to still another aspect, the one or more predefined material content categories are selected from the group comprising: building, grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous.
According to an additional aspect, each of the one or more material classification scores represents the probability that a frame includes content associated with each of the respective predefined material content categories.
According to one aspect, the video file comprises a shot of video.
According to an additional embodiment, the present disclosure is directed to a method for classifying a video file according to one or more scene classes, the video file including a plurality of frames, wherein each frame includes a plurality of pixels, and wherein each pixel is associated with a vector of material classification scores describing the material content in its respective frame. The method comprises the steps of: (a) dividing each frame into a plurality of grid cells; (b) for each frame, retrieving the vector of material classification scores for each pixel in each cell; (c) for each grid cell, averaging the material classification scores across each pixel in the cell to form a material occurrence vector for the cell; (d) concatenating the material occurrence vectors for the plurality of grid cells in each frame to generate a material arrangement vector for each frame; (e) generating a scene classification score associated with each of the one or more scene classes for each frame in the video file via one or more scene classifiers based on the material arrangement vectors generated for each frame; (f) generating a representative scene classification score for the video file for each of the one or more scene classes based on the scene classification scores generated for each frame; and (g) if one or more of the representative scene classification scores is above a predetermined threshold value, labeling the video file according to the respective scene classes associated with the one or more scene classification scores that are above the predetermined threshold value.
According to one aspect, the method further comprises the step of repeating steps (a)-(e) one or more times using varying numbers of grid cells. In one aspect, the one or more scene classifiers comprise a spatial pyramid of classifiers, and wherein varying weights are associated with the scene classification scores.
According to another aspect, the material content is selected from the group comprising: building, grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous.
According to a further aspect, the material occurrence vector represents the proportion of each type of material content included in the cell. In one aspect, the material occurrence vectors are concatenated in an ordered manner.
According to an additional aspect, each of the material classification scores represents the probability that a frame includes content associated with each of the respective types of material content. In one aspect, each of the one or more scene classification scores represents the probability that a frame includes content associated with each of the respective one or more scene classes.
According to yet another aspect, the material arrangement vector generated for each frame represents the spatial arrangement of material content in the frame.
According to still another aspect, the one or more scene classes are selected from the group comprising: coast/beach, desert, forest, grassland, highway, indoor, lake/river, mountainous, open water, outdoor, sky, snow, and urban.
According to another aspect, the representative scene classification score for each of the one or more scene classes comprises a statistical property of the generated scene classification scores. In one aspect, the statistical property is selected from the group comprising: average, median, maximum, and minimum.
According to a yet further aspect, the video file comprises a shot of video.
According to an additional aspect, the method further comprises the step of generating a report based on the labeled video file.
According to one aspect, the labeled one or more scene classes are used for indexing and retrieval of the video file.
According to still another embodiment, the present disclosure is directed to a method for labeling videos based on video content, comprising the steps of receiving a video file, wherein the video file includes a plurality of frames; extracting a set of frames from the plurality of frames in the video file; for each frame in the extracted set of frames, calculating a probability that the frame includes content associated with a predefined scene category; determining a representative probability for the set of frames based on the calculated probabilities for each frame; and if the representative probability exceeds a predetermined threshold, associating the scene category with the video file.
According to one aspect of the present method, the representative probability comprises a statistical property of the calculated probabilities for each frame. In one aspect, the statistical property is selected from the group comprising: average, median, maximum, and minimum.
According to another aspect, the method further comprises the step of indexing the video file according to the associated scene category for search and retrieval purposes.
According to an additional aspect, the scene category is selected from the list comprising: coast/beach, desert, forest, grassland, highway, indoor, lake/river, mountainous, open water, outdoor, sky, snow, and urban.
According to a further aspect, the calculated probability for each frame is calculated via a classifier.
The accompanying drawings illustrate one or more embodiments of the disclosure and, together with the written description, serve to explain the principles of the disclosure. Wherever possible, the same reference numbers are used throughout the drawings to refer to the same or like elements of an embodiment, and wherein:
For the purpose of promoting an understanding of the principles of the present disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same. It will, nevertheless, be understood that no limitation of the scope of the disclosure is thereby intended; any alterations and further modifications of the described or illustrated embodiments, and any further applications of the principles of the disclosure as illustrated therein are contemplated as would normally occur to one skilled in the art to which the disclosure relates.
Aspects of the present disclosure generally relate to systems and methods for semantically classifying shots of video based on video content. Generally, embodiments of the present system analyze video files and associate predefined textual descriptors to the video files. The textual descriptors relate to predefined scene classes or categories describing content in the files, such as mountain, coast, indoor, urban, forest, and the like. Typically, a video file comprises a shot of video (as defined previously), or a sequence of frames from a video, or an entire video itself. Once classified, the video file may be used for a variety of purposes, including content-based indexing and retrieval, shot boundary detection and identification, and other similar purposes.
Referring now to
As shown in the embodiment of
Upon receipt of a video file 22, the classification system 10 processes the file (as described in detail below) to identify and classify the file or shots within the file according to zero or more predefined scene categories. In some circumstances, based on the nature of the content of the video file, no predefined scene category applies to the video. In other circumstances, multiple classes apply to the given video file. Examples of scene categories include coast/beach, desert, forest, grassland, highway, indoor, lake/river, mountainous, open water, outdoor, sky, snow, urban, and other similar categories as will occur to one of ordinary skill in the art. As will be appreciated, however, embodiments of the present system are not limited to the specific scene categories mentioned, and other categories are possible according to various embodiments and aspects of the present system.
Once processed, the video classification system 10 generates an output 26 corresponding to the particular video file 22. Representative outputs 26a, 26b are presented for exemplary purposes. Output 26a comprises a data table listing the resulting classification score for each scene category for a given video shot. As shown, the table 26a includes two data categories or fields: scene class 30 and classification score 32. As will be understood, however, the data categories or files are not limited to the fields shown, and other embodiments include additional fields as will occur to one of ordinary skill in the art. As will also be understood, although a representative listing of scene classes is shown, actual data tables constructed in accordance with embodiments of the present system may include other scene classes not specifically mentioned herein.
According to one embodiment of output 26a, the classification score 32 is a value between 0 and 1 indicating the probability that a particular shot includes content associated with a predefined scene class 30. As will be understood, the classification score is represented in a variety of ways according to various embodiments, such as a percentage, a ratio (as compared to the other scene categories), and other similar ways. As shown, exemplary table 26a indicates a hypothetical set of classification scores for the mountain shot associated with video file 22 and shown in frames 24. The classification scores indicate a high probability that the scene includes content associated with (and therefore classified by) mountains (i.e. “mountainous”), “sky,” and a “lake/river” (shown by classification scores 0.91, 0.78, and 0.73, respectively). These scores are as expected, considering the exemplary images 24 include mountains, sky, and a lake. Scene category “snow” received a significant score as well (i.e. 0.41), indicating that the shot contains some portion of this type of content.
Once the classification scores are calculated, a threshold value is applied to the scores to identify the scene classes that likely apply to the given shot. For example, a system operator may define a threshold value of 0.4, and thus any scene category receiving a classification score above the threshold is associated with the shot. Thus, if 0.4 were used as a threshold, then the shot would be associated with categories “mountainous,” “sky,” “lake/river,” and “snow.” If a higher threshold were used, say 0.7, then the shot would be classified as “mountainous,” “sky,” and “lake/river”. A higher threshold might be used, for example, if a system operator desires to label shots only according to content that is prominent in the shots. According to one embodiment, the threshold is varied on a per-class basis. As will be appreciated, the threshold can be varied at a system operator's discretion to produce more accurate or focused results, include more or fewer classes per shot, etc.
As shown in
According to various embodiments, table 26b is used as a subsequent output in conjunction with table 26a after the values in 26a have been thresholded for many shots. Or, output 26b comprises an output associated with a shot boundary detection embodiment, in which a video file 22 comprises many, undetected shots, and these shots are identified by the video classification system 10 based on variations in scene classes. As shown in table 26b, for example, the system 10 classified the frames associated with hypothetical shot 1 as including “sky” content until 13.12 seconds into the video. At the 13.13 second mark, the classification system 10 identified and classified the shot frames as pertaining to “sky,” “snow,” and “forest.” Thus, the system determined that, based on the change in scene classes, a shot boundary had occurred (again, based on some predefined classification score threshold value). As will be understood and appreciated, the exemplary outputs 26a, 26b are presented for illustrative purposes only, and other outputs are possible according to various embodiments of the present system.
As shown in
Although the classified video content user 12 is illustrated in the embodiment of
For purposes of example throughout this document, exemplary categories of scene classes and material classes are given, such as indoor, outdoor, urban, mountainous, highway, vehicle, forest, etc. Additionally, the exemplary embodiment described herein is primarily couched in terms of a classification system that identifies specific categories of “outdoor” scenes. It should be understood, however, that the present systems and methods are in no way limited to outdoor scenes, and the present systems and methods may be applied to indoor scenes or other types of scenes based on variations in training data, image features, etc. Accordingly, outdoor video classification systems are often described herein for illustrative purposes only, but are in no way intended to limit the scope of the present systems.
Regardless of the type of video file received, the system 10 extracts an initial frame from the video file for processing (step 210). Embodiments of the present system analyze and classify single frames, and then combine the results for each analyzed frame to produce an overall classification or classifications for the shot (described below). Preferably, to reduce overall processing time and increase efficiency, the system only extracts and analyzes a subset of frames in the video, such as one frame from the video file for every ⅓ second of recorded time. Typically, videos are recorded at a rate of 24 frames/second (or, 8 frames per ⅓ second). Thus, a preferred embodiment only analyzes 1 out of 8 frames in a recorded video file. For most applications, a sampling rate of one frame for every ⅓ second of recording time produces satisfactory results, and significantly reduces overall computation time. As will be understood by one of ordinary skill in the art, however, other sampling rates are possible. In fact, each frame in a video file 22 may be analyzed if so desired by a system operator.
After a frame has been extracted, the frame is analyzed by an intensity classification process 400 to determine if the frame is a good candidate for overall classification. “Dark” frames (i.e. those shot in poor lighting or at night, etc.) are difficult to classify, and thus tend to produce inconsistent results. Accordingly, if the intensity classification process 400 determines that a frame is too dark for processing (step 215), then the frame is discarded (i.e. not analyzed further) (step 220), and a new frame is selected for processing. If, however, the frame is not a dark frame, then the frame is passed through the indoor/outdoor classification process 500 to determine whether the frame includes content associated with an indoor scene or outdoor scene. If the frame is not an outdoor frame (as determined by the indoor/outdoor classification process), then the frame is labeled (i.e. classified) as indoor or undetermined, assigned a classification score of “0” for all outdoor categories or scene classes (discussed below), and stored in a database 14 (steps 225, 230, 235).
If, however, the frame is in fact an outdoor frame, then the frame is analyzed by the outdoor classification process 600 to determine which category or categories of material classes apply to the frame. As used herein, “material” refers to the type or category of content shown in a frame (e.g. sand, grass, rock, building, vehicle, etc.). For example,
Still referring to
Within embodiments of the present system, “features” are used to identify content in images/frames, train classifiers to recognize such image content, etc. As will be understood and appreciated by those of ordinary skill in the art, a “feature” refers to an individual, measurable heuristic property of an image used in pattern recognition and classification of the image. Essentially, features are data extracted from an image region and used to characterize its appearance.
Various types of features are used in image classification systems, such as color, texture, etc. Features vary in complexity and accuracy (i.e. strong v. weak), producing varying results. Typically, “weak” features, such as raw pixel values, average RGB values in an image region, edge strength associated with individual pixels, etc., require less computation, but are less accurate as compared to strong features. “Strong” features, such as texture, shape, etc., are typically more descriptive and better characterize the appearance of an image (i.e. are more accurate), but usually require more computation and are more difficult to develop. Preferably, embodiments of the present system use strong features, but other features are used in various embodiments as will occur to one of ordinary skill in the art. The preferred embodiment of the present system uses strong color, edge, line, texture, and shape features, as described in further detail below.
Color
According to a preferred embodiment, the color features comprise a histogram in CIELAB colorspace. As will be understood, a traditional “Lab” colorspace is a color-opponent space with dimension L for brightness and a and b for the color-opponent dimensions, based on nonlinearly-compressed CIE XYZ color space coordinates. The CIELAB colorspace actually uses the L*, a*, and b* coordinates (as opposed to L, a, and b). Preferably, a three-dimensional (3D) color histogram is formed from the 3-channel color for each pixel in an image using 4 bins for each channel, resulting in a 64-dimensional histogram. As will be understood, while the CIELAB colorspace is preferred, other similar colorspaces are used for color features according to various embodiments of the present system.
Edges
According to one embodiment, the edge features comprise edge strength and edge direction histograms. Preferably, edge strength in each of the x and y directions is computed using the Sobel transform. The computed edge strengths are used to form an edge strength histogram with 8 bins. Additionally, edge direction is computed at each pixel in the image to form a 16-bin histogram of these direction measures.
Lines
According to one embodiment, the line features comprise a line length histogram. Preferably, an edge image is formed using the Sobel transform. Preferably, lines are detected via application of the Hough transform. Generally, the quantity of lines of different lengths is enumerated into a histogram with bins representing line lengths of 1 to 3, 4 to 7, 8 to 15, 16 to 31, 32 to 64, and 64+ pixels.
Texture
According to one embodiment, the texture features comprise a “texton” histogram and statistics of a Gray-level Co-occurrence Matrix (GLCM). Preferably, the Leung-Malik filter bank is used, as described in T. Leung and J. Malik, Representing and Recognizing the Visual Appearance of Materials Using Three Dimensional Textons, International Journal of Computer Vision, 43:29-44 (2001), which is incorporated herein by reference as if set forth herein in its entirety, which consists of edge, bar, and spot filters at different sizes and orientations. Generally, each filter is convolved with a given image, producing a response vector for each pixel in the image region. To form a set of textons, these response vectors are clustered with k-means over a set of “training” images to produce clusters, with each cluster center representing a texton, as described in M. Varma and A. Zisserman, A Statistical Approach to Texture Classification from Single Images, International Journal of Computer Vision: Special Issue on Texture Analysis and Synthesis, 62(1-2):61-81 (2005), which is incorporated herein by reference as if set forth herein in its entirety. As used herein, “training” images, frames, or data are those that are used to train classifiers (i.e. establish patterns and standards in classifiers), such that classifiers are able to subsequently identify and classify like image features (described in greater detail below).
Given a new image (i.e. a non-training image), the response vectors are computed and the Euclidean distance to each texton is computed to find the closest match for each pixel in the image, thus assigning each pixel to a texton. Accordingly, a texton histogram is computed to provide the distribution of textons within a given image region.
In one embodiment of the present system, the statistics of the GLCM are also used as measures of texture. Generally, the GLCM is formed, and the statistics comprising contrast, correlation, energy, entropy, and homogeneity are computed, as described in C. C. Gotlieb and H. E. Kreyszig, Texture Descriptors Based on Co-Occurrence Matrices, Computer Vision, Graphics and Image Processing, 51:76-80 (1990); L. Lepistõ et al., Comparison of Some Content-Based Image Retrieval Systems with Rock Texture Images, In Proceedings of 10th Finnish AI Conference, pp. 156-63 (2002); and M. Partio et al., Rock Texture Retrieval Using Gray Level Co-Occurrence Matrix, In 5th Nordic Signal Processing Symposium (2002), all of which are incorporated herein by reference as if set forth herein in their entirety.
Shape
According to one embodiment, the shape features comprise circularity, convexity, polygon, and angularity features that characterize the boundary of an image region. Generally, circularity is defined as the ratio of the area of a given image region to the area of a circle having the same perimeter, as represented by the following ratio:
and as described in V. Mikli et al., Characterization of Powder Particle Morphology, In Proceedings of Estonian Academy of Sciences, Engineering, vol. 7, pp. 22-34 (2001), which is incorporated herein by reference as if set forth herein in its entirety. Convexity is generally computed using the convex hull of an image region, as defined by the ratios:
and as described in M. Peura and J. Iivarinen, Efficiency of Simple Shape Descriptors, In Proceedings of the Third International Workshop on Visual Form, pp. 443-51 (1997), which is incorporated herein by reference as if set forth herein in its entirety. Typically, the boundary of an image region is fit to a polygon (i.e. a polygon is determined that best approximates the boundary of the image region to a specified approximation accuracy), and the mean, standard deviation, and maximum edge length of the polygon comprise another set of shape features. Generally, angularity is computed as the standard deviation of the curvature at each boundary point, as described in J. Fox et al., Onboard Autonomous Rock Shape Analysis for Mars Rovers, In IEEE Aerospace Conference Proceedings (2002), which is incorporated herein by reference as if set forth in its entirety.
Given a region in a frame or image, either to be used as training data (described below) or desirous of classification, the results for each of the features (i.e. color, edges, lines, texture, shape, etc.) are concatenated together to form a feature vector representation of the image region. As used herein, a “feature vector” describes an N-dimensional vector of numerical features that represent the content shown in an image or region of an image. As will be understood and appreciated by one of ordinary skill in the art, creation and use of feature vectors facilitates processing, analysis, and classification of images.
According to one embodiment, before the features are calculated on an image, the image is blurred with a Gaussian kernel of, preferably, size 5×5 to reduce pixel noise within the image. As will be appreciated, while a size of 5×5 is preferred, other embodiments of the present system use other sizes as will occur to one of ordinary skill in the art. Generally, both training images and images desirous of classification are blurred before calculating and forming feature vectors for the image. Additionally, in one embodiment, each feature in the feature vector over a set of training data is normalized to fall between 0 and 1 by computing the maximum and minimum values of each feature and resealing the data. The same resealing is then used on any further computed feature vectors.
As will be described below, several different classifiers are used in association with embodiments of the present system 10. As used herein, a “classifier” refers to an algorithm that, based on a set of human-labeled training data, assigns classification scores to images or regions of images indentifying the probability that a given image contains a particular type of content. Classifiers are trained with sets of feature vectors extracted from training images that have been hand-labeled as including a certain type of content. For example, hypothetical image region 320 shown in
Generally, two main types of known classifiers are preferred according to various embodiments of the present system: Support Vector Machine (SVM) classifiers and Random Forest classifiers. The preferred SVM training library is libSVM, as described in C.-C. Chang and C.-J. Lin, LIBSVM: A Library for Support Vector Machines, 2001, available at http://www.csie.ntu.edu.tw/˜cjlin/libsvm, which is incorporated herein by reference as if set forth herein in its entirety, although other libraries and training data are possible. Generally, the higher the quantity of training data used (i.e. the more training images used), the more accurate the results of a classifier become. Thus, preferably, a large library of training images are used for each classifier discussed herein. For example, the training library used in one test of an embodiment of the present system (described below in the “Experimental Results” section) includes over 10,000 training images. Further, both linear and radial basis function kernels are used in association with various SVM classifiers as identified below. According to one embodiment, Random Forests are used in a similar manner as that described in Shotten (2008) (cited previously), which is incorporated herein by reference as if set forth herein in its entirety. As will be understood, while SVM and Random Forests classifiers are preferred, other types of classifiers are incorporated and used according to various embodiments of the present system.
Generally, the processes and functions described below presuppose that one or more classifiers have been trained for each discrete process, and the processes as described operate on a new image/frame (i.e. an image desirous of classification). Generally, a classifier is trained according to the same procedures and processes as are used to identify and classify new images. Accordingly, unless otherwise indicated, it is assumed that the procedures for training classifiers are similar to procedures used for classification of new images, as described in detail below.
As described in reference to
After all cells in the given frame have been processed (i.e. the average intensity value has been calculated for each cell), the average intensity values are concatenated to form an intensity feature vector of N2 values for the frame (step 435). For example, if the preferred 4×4 grid size is used, then the resulting intensity feature vector will include 16 elements/values. Once the intensity feature vector is formed, the vector is classified via an intensity classifier to determine if the corresponding image is “dark” or not (step 440). Generally, a predefined threshold value is selected by a system operator depending on the level of darkness the operator is willing to accept, and the classification score produced during classification (step 440) is compared to the threshold. If the classification score exceeds the threshold, then the frame is deemed a “dark” frame, and is discarded. If the frame is not a dark frame, then the frame is processed further (see
For purposes of training a classifier used for intensity classification, steps 405-435 are repeated for each training image. Each training image is hand-labeled by a system operator as “dark” or “not dark,” and the resulting intensity feature vectors are associated with these labels. The labels and associated feature vectors are used to train a SVM classifier with a linear kernel (typically, a linear kernel is preferable when the classification problem is approximately linearly separable, as is the case here). Thus, given a new image, intensity classification process 400 is able to classify the image accordingly as “dark” or “not dark.”
Once it has been determined that a given frame is not a dark frame, and is in fact an acceptable frame for classification purposes, the frame is further analyzed via the indoor/outdoor classification process 500 to determine if the frame is an “outdoor” frame, an “indoor” frame, or an “undetermined” frame. According to one embodiment of the present system, shots and/or frames including content of indoor or undetermined scenes are classified as such, but no further analysis or sub-classification is performed on the frames. Thus, if a given frame is classified as an outdoor frame, the frame is further classified (as described below) based on distinct categories of outdoor scenes (i.e. scene classes). As will be understood and appreciated, however, embodiments of the present system are not limited to outdoor scenes, and are capable of identifying and classifying varying types of indoor scenes depending on types of training data and features used. For purposes of illustration, however, an exemplary embodiment for classifying categories of outdoor scenes is described, but is not intended to limit the present system in any way.
Starting at step 505, a frame is received for classification. The frame is then divided into N×N grid cells such that classification is achieved for smaller image regions, typically leading to more accurate classification results (step 510). Preferably, each frame is divided into a 4×4 grid, but various grid sizes are used according to various embodiments of the present system 10. At steps 515 and 520, a first grid cell of the frame is selected for processing, and the color, edge, line, and texture features (described previously) are calculated for the given cell to form a feature vector for the cell. Because each grid cell is a rectangular portion of the frame, the shape features are not calculated (i.e. the rectangular shape is already known). As will be understood, other features in addition to those described are used in various embodiments of the present system as will occur to one of ordinary skill in the art.
At step 525, the feature vector for the selected cell is classified via a classifier to determine the corresponding class for the cell (i.e. indoor, outdoor, or undetermined). For purposes of training this classifier, steps 505-520 are repeated for each cell in each training image. Each cell in each training image is hand-labeled by a system operator as “indoor,” “outdoor,” or “undetermined,” and the resulting feature vectors for each cell are associated with these labels. The labels and associated feature vectors are used to train a SVM classifier with a radial basis function kernel. Typically, a radial basis function kernel is preferable for this classifier because a more complex model generally produces more accurate classification results. The resulting classification vector for the cell generally comprises a 3×1-dimensional vector, wherein the 3 values/elements in each vector comprise the classification scores (between 0 and 1) for each of the three possible classes (i.e. indoor, outdoor, or undetermined). At step 530, the system determines whether any unclassified cells are remaining in the frame. If cells are remaining, then the next cell is selected (step 515), and steps 520-530 are repeated for the new cell.
After the classification vectors for all cells in the given frame have been calculated (via step 525), the classification vectors are concatenated to form an indoor/outdoor feature vector for the overall frame that includes the classification scores for each cell (step 535). Once this indoor/outdoor feature vector is formed, the vector is classified via an indoor/outdoor classifier to determine if the corresponding frame is an indoor, outdoor, or undetermined frame (step 540). The classifier used in step 540 is trained based on indoor/outdoor feature vectors associated with training images that are labeled by a system operator as indoor, outdoor, or undetermined frames. Just as with the classifier associated with step 525, the classifier used in step 540 is a SVM classifier; however, in this case, a linear kernel is selected because the data is approximately linearly separable, and the selection of a linear kernel prevents over-fitting as could occur with the use of a radial basis function kernel. Generally, for a new image (i.e. non-training image), a classification score is calculated during step 540 for each of the three classes associated with the classifier (i.e. indoor, outdoor, and undetermined). Typically, the highest classification score of the three is the type of content most likely associated with the frame, and the frame is labeled accordingly. According to the presently-described embodiment, if the frame is labeled an “outdoor” frame, then it is processed further via the outdoor classification process 600. Otherwise, the frame is assigned an overall classification score of “0” for all outdoor classes and stored in a database 14 for subsequent processing (see step 235 in
Still referring to the embodiment of the indoor/outdoor classification process 500 described in
After a frame has been labeled as an outdoor frame, the frame is analyzed by the outdoor classification process 600 to determine which category or categories of material class(es) (if any) apply to the frame. As described previously and as used herein, “material” or “material class” refers to the type of physical content shown in a frame. According to one embodiment of the present system, materials include building (i.e. the outside of a structure), grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous. As will be understood, however, embodiments of the present system are not limited to the particular material classes described, and other similar classes are used according to various embodiments of the present system. As mentioned previously, once each frame in a given video file 22 or portion of a video file has been classified, the material class results are aggregated and averaged via the video file classification process 1000, 1001 to identify one or more scene classes for each video file or portion thereof.
Referring now to
As shown in
Because segmentation algorithms tend to produce varying results based on the parameters used, multiple segmentations are calculated for each frame according to one embodiment, as suggested in D. Hoiem et al., Geometric Context from a Single Image, International Conference of Computer Vision (ICCV), IEEE, vol. 1, pp. 654-61 (2005); and G. Mori et al., Recovering Human Body Configurations: Combining Segmentation and Recognition, In IEEE Computer Vision and Pattern Recognition (2004), both of which are incorporated herein by reference as if set forth herein in their entirety. Preferably, three different segmentations are computed for each frame. Thus, according to a preferred embodiment, for each frame extracted from a video file, three different parameter sets are used in the Efficient Graph-Based Segmentation algorithm, namely σ=0.325, k=500; σ=0.4, k=180; and σ=0.5, k=160, with a minimum segment size of 500 pixels, wherein u is used to smooth the image before segmenting it, and k comprises a value for the threshold function. As will be understood, however, embodiments of the present system are not limited by these particular parameters, nor by use of only three segmentations, and other parameters and multiples of segmentations are used according to various embodiments.
As will be appreciated, some of the segments produced via the segmentation algorithm (step 610) are small, or may comprise only part of a larger object or region of material. Accordingly, in one embodiment, in order to achieve higher accuracy and faster computation speeds during subsequent material classification, segments including similar classes of materials are merged together.
Starting at step 705, the features are extracted/calculated from each segment to form a feature vector for each segment. According to a preferred embodiment, the extracted features correspond to those mentioned previously (i.e. color, edge, line, texture, and shape), but other features are used in other embodiments. The extracted features are concatenated into a feature vector for the segment. At step 710, an affinity score is calculated for each pair of adjacent segments. As used herein, an “affinity score” is the result/score from an adjacency classifier predicting whether two adjacent segments comprise or belong to the same material class. According to one embodiment, the adjacency classifier comprises a Random Forest classifier that operates on the absolute value of the difference between feature vectors of adjacent segments. Preferably, a Random Forest classifier is used (as opposed to a SVM) classifier to improve computation speed. Generally, in order to train the classifier, the feature vectors of a plurality of adjacent segments in a plurality of training images are compared, and the absolute value of the difference is calculated for each and used as the training feature set for the classifier. Each absolute value vector is labeled by a system operator as a positive result (i.e. the adjacent segments correspond to the same material class) or a negative result (i.e. the adjacent segments correspond to different material classes). Thus, given a pair of adjacent segments from a new frame (i.e. a frame desirous of classification), the affinity score produced by the adjacency classifier of step 710 represents the probability that the two segments include content associated with the same class.
Still referring to
According to one embodiment, to determine an appropriate affinity score threshold value, the adjacency classifier is calibrated with a validation set of images/frames to produce a desired accuracy. As will be understood, a “validation set” refers to a set of images used to test a classifier that have been labeled by a system operator such that the actual class of each image is known. To determine an appropriate threshold value, a system operator selects an arbitrary value and performs process 700 on a set of validation frames. Because the actual class of each segment is known, the precision value of correct segment combinations can be calculated (i.e. the proportion of combined segments that actually belong to the same class as compared to all combined segments). If the precision is less than the desired precision (e.g. 97%), then the affinity score threshold should be increased (and vice versa). This process should be repeated until a desired precision is reached.
Again, as will be understood, segment combination/merging process 700 is completed for each separate segmentation for each frame. Thus, for example, if a given frame is segmented three times, process 700 is repeated for each of the three segmentations, and the results of each are stored in a database 14.
Referring again to
According to one embodiment, libSVM (mentioned previously) is used to form a one-to-one classifier for each pair of material classes and produce a classification result as a combination of these classifiers. Generally, each one-to-one classifier comprises a SVM classifier with a radial basis function kernel. Use of such a combination of one-to-one classifiers is conventional for a multi-class problem (i.e. when multiple classes potentially apply to a single image region). For N classes, the number of classifiers required is defined by:
For example, for an embodiment that includes 12 material classes (e.g. building, grass, person, road/sidewalk, rock, sand/gravel/soil, sky/clouds, snow/ice, trees/plants, vehicle, water, and miscellaneous), 66 classifiers are used to accurately classify each region (i.e. 12(12−1)/2=66). This large number of classifiers is required because each class must be compared against every other class to achieve a complete result.
According to a preferred embodiment, however, rather than a conventional one-to-one classifier arrangement, a hierarchy of classifiers is used. The hierarchy utilizes one-to-one classifiers, but based on predetermined knowledge about the classes (i.e. they are explicitly predefined to correspond to materials), a more effective arrangement of one-to-one classifiers is constructed.
According to the hierarchical type of arrangement shown in
For a hierarchy or tree of classifiers 800 (such as that shown in
For non-leaf nodes (i.e. those nodes with child nodes extending therefrom, such as “man-made,” “vegetation,” etc.), the classifier result is defined by:
where cx({right arrow over (f)}) represents the result of the SVM classifier for given node x, and cx({right arrow over (f)})y is the result for given class y. For example, given a segment to be classified, the classification score for the segment for the “building” class comprises the result of the material classifier for “man-made” multiplied by the result of the man-made classifier for “building.”
For a new frame (i.e. a frame desirous of classification), the previously-calculated segment feature vectors associated with the frame are retrieved from a database 14 (see
Again referring to
Referring now to
Regardless of the grid size used, at step 910, a cell is selected for processing. At step 915, the material scores (i.e. vector of material scores) for each pixel in the selected cell are retrieved from a database 14. The vectors of material scores for each pixel in the cell are averaged to produce a material occurrence vector for the cell (step 920). As described, the material occurrence vector identifies the type(s) of material likely contained in the cell based on the material score for each class of material in the vector. At step 925, the system determines whether any unprocessed cells are remaining in the frame. If so, steps 910-925 are repeated for the next cell. Once the material occurrence vectors have been calculated for all cells in the frame, the occurrence vectors are concatenated to form the material arrangement vector for the frame (step 930). According to one embodiment, material arrangement vector generation process 900 is repeated for a given frame using many different grid sizes, and the resulting material arrangement vectors are used to train varying classifiers, whereby the classification results are averaged to produce more accurate scene classifications.
Referring again to
According to one embodiment of the present system 10, a proportional classifier operates on material occurrence vectors (i.e. material arrangement vectors associated with 1×1 grid sizes). For a plurality of training images/frames, the material arrangement vectors are calculated for a 1×1 grid size according to process 900. These vectors are labeled by a system operator according to the scene class(es) associated with the corresponding frames (based on content). According to one embodiment, more than one scene class may apply to a given frame. Alternatively, some frames include no defined scene classes, and are labeled as such. In one embodiment, each training image is flipped horizontally and the material arrangement vector is recalculated to provide additional training data to each classifier. For each scene type (e.g. coast/beach, desert, etc.), a SVM classifier with a radial basis function kernel is trained based on material arrangement vectors associated with that scene type. Given a new frame, each scene classifier classifies the material arrangement vector associated with the frame to determine a classification score (between 0 and 1) for the frame (i.e. the higher the score, the more likely it is the frame includes that class of content). These classification scores are collected into a scene classification score vector and stored in a database 14 for further video file classification (step 235, see
Spatial Pyramid Classifiers
According to a preferred embodiment, a spatial pyramid classifier is used to classify frames according to scene types. Examples of spatial pyramids are described in Lazebnik (2006) (cited previously), which is incorporated herein by reference as if set forth herein in its entirety. The spatial pyramid classifiers operate in much the same way as the proportional classifiers (described above), except that each type (i.e. scene class) of classifier is trained using material arrangement vectors associated with varying grid sizes, and the results are combined for each type. Specifically, material arrangement vectors are calculated for each training frame according to process 900 for multiple grid sizes (e.g. 1×1, 2×2, 4×4, etc.). For each grid size, a separate classifier is trained using the resultant material arrangement vectors from the training images for that grid size for each scene type. Accordingly, each scene type includes not one, but a multiple number of classifiers corresponding to multiple grid sizes. For example, if three grid sizes are used for each frame (e.g. 1×1, 2×2, and 4×4), then each scene type includes three classifiers. Again, each material arrangement vector for each training frame is labeled by hand by a system operator. Also, according to one embodiment, each training image is flipped horizontally and the material arrangement vector is recalculated to provide additional training data to each classifier.
For a new frame (i.e. a frame desirous of classification), a material arrangement vector is calculated for each grid size in which the classifiers have been trained. Thus, during scene classification (step 630), a scene classification score vector is generated for each grid size for each frame. According to one embodiment, a weighted sum of the scene classification score vectors is produced to define a scene classification score vector for the frame. For example, if three different grid sizes are used corresponding to 1×1, 2×2, and 4×4 grid cells, the results for each size are weighted and combined (e.g. weighting of 0.25 for 1×1, 0.25 for 2×2, and 0.5 for 4×4). Thus, the scene classification score values for the 1×1 grid size are multiplied by 0.25, the values for the 2×2 grid size are multiplied by 0.25, and the values for the 4×4 grid size are multiplied by 0.5, whereby the resulting weighted values are added together to produce a scene classification score vector for the given frame. Generally, a higher weight is associated with higher grid sizes because those sizes are typically more accurate (although this is not always the case). As will be understood and appreciated by one of ordinary skill in the art, a variety of multiples of grid sizes, number of grid cells used, and weights associated with the grid sizes are used according to various embodiments of the present system.
Referring again to
Predefined Shot
Starting at step 1005, the scene classification score vectors for each frame in the video file, shot, or other discrete unit of video are retrieved from the database 14. For frames that were classified as “indoor” or “undetermined,” the classification score of “0” for outdoor classes (i.e. a vector of zero values corresponding to each outdoor scene class) is retrieved for those frames. At step 1010, the classification scores for each scene class for each frame are averaged across all frames in the given unit of video (i.e. shot). For “indoor” or “undetermined” frames, the “0” value is used in the average calculation for each outdoor scene class for that particular frame, thus lowering the overall average for the shot. The average scene class scores produce a final classification score for each scene class for the shot (an example of which is shown in table 26a in
Generally, a predefined threshold value is set by a system operator for each scene class, and any class with a classification score exceeding that threshold is deemed as applying to the shot (step 1015). According to one embodiment, the threshold value is determined on a per-class basis (because different classes often perform differently based on the type of classified content), and such thresholds are determined as a function of precision and recall accuracy experiments using validation data. Once the class(es) with classification scores exceeding the threshold are identified, the shot is labeled according to the identified scene classes (step 1020). If none of the classification scores exceed a threshold, then no defined scene classes are associated with the shot (likely indicating the shot comprises some other undetermined content). The classification results are then stored in a database 14 for subsequent purposes (step 1025), including generating reports (step 245, see
Shot Detection
According to one embodiment, rather than labeling predefined shots or sequences of video, the video classification process 1001 is used to detect shot breaks in a video file or sequence of frames. Accordingly,
At step 1021, the absolute value of the difference between the scene class scores in the two selected classification score vectors are calculated. For example, if the vector for the first selected frame includes a classification score for class “forest” of 0.11, and the vector for the second selected frame includes a classification score for class “forest” of 0.13, then the absolute value of the difference would be 0.02. If this difference is above a predetermined threshold, then a shot break is identified between the two frames (step 1026, 1031). The absolute value of the difference is calculated for each scene class for each vector, and each difference is compared to a predefined threshold. Typically, a large difference in classification scores between two frames indicates a change in content between the two frames, and accordingly, a shot break. If the difference is below a predefined threshold value, then no shot break is identified, and the system determines whether any frames remain in the video file (step 1036). If frames are remaining, then a classification score vector associated with a subsequent frame in the video file sequence is selected and compared to a vector for a previously-selected frame that precedes it. Accordingly, steps 1016, 1021, 1026, 1031, and 1036 are repeated until all scene classification score vectors associated with a given video file have been analyzed. Once all frames have been analyzed, all identified shot breaks (if any) are stored in a database 14 for further reporting (e.g. table 26b) and processing purposes.
As will be understood and as mentioned previously, the particular scene classes identified in output 26a and listed herein are presented for illustrative purposes only, and are in no way intended to limit the scope of the present systems and methods. Additionally, the exemplary outputs 26a, 26b are presented for purposes of illustration only, and other types and formats of outputs and reports are generated according to various embodiments of the present system.
Referring now to
To demonstrate functional capability, an embodiment of the present system was tested to determine its classification performance and accuracy. The embodiment tested was configured to detect and classify video content according to outdoor material and scene classes as described above. The video content and associated images used to test the embodiment were obtained from the LabelMe database, as described in B. C. Russell et al., LabelMe: A Database and Web-Based Tool for Image Annotation, International Journal of Computer Vision, vol. 77, pp. 157-73 (2008), which is incorporated herein by reference as if set forth in its entirety, as well as from Google™ Images, Flickr®, movies such as Along Came Polly, Babel, Cheaper by the Dozen, Tears of the Sun, and Wild Hogs, and an episode of the television program Lost.
For the test, 1019 images (i.e. frames) were extracted from the above-referenced image and video databases, movies, and television program. Five-fold cross-validation was used to test the images, in which 80% of the images are used as training data and 20% are used as validation data (i.e. used to test the results). This process was performed five times until all images had been used as validation data, and the results were averaged over the five tests. The images were processed and segmented as described above (see
The confusion matrix 1200 demonstrates the percentage of time that a region labeled by the tested embodiment of the system as a given material was correctly labeled as that material as compared to the hand-labeled region, as well as the percentage of time the tested embodiment incorrectly classified a region as another material. For example, as shown in the confusion matrix, the tested embodiment correctly labeled image regions/segments that included content of buildings as “buildings” 69% of the time. As shown, the most accurately classified material was “sky/clouds” (i.e. correctly classified 95% of the time), and the most common misclassification was “snow/ice,” which was incorrectly classified as “water” 25% of the time. By analyzing a confusion matrix and adjusting threshold values, a system operator is able to customize the results based on his or her performance requirements.
For the test, 10017 images (i.e. frames) were extracted from the above-referenced image and video databases, movies, and television program. Five-fold cross-validation was again used to test the images, in which 80% of the images are used as training data and 20% are used as validation data (i.e. used to test the results). This process was performed five times until all images had been used as validation data, and the results were averaged over the five tests. The images were processed as described above (see
As used herein, “precision” represents the percentage of correctly classified images from all classified images (i.e. the fraction of detections that are true positives rather than false positives). As used herein, “recall” represents the percentage of correctly classified images from all images (i.e. the fraction of true labels that are detected rather than missed). The precision-recall curve 1300 shown in
As shown in
The foregoing description of the exemplary embodiments has been presented only for the purposes of illustration and description and is not intended to be exhaustive or to limit the inventions to the precise forms disclosed. Many modifications and variations are possible in light of the above teaching.
The embodiments were chosen and described in order to explain the principles of the inventions and their practical application so as to enable others skilled in the art to utilize the inventions and various embodiments and with various modifications as are suited to the particular use contemplated. Alternative embodiments will become apparent to those skilled in the art to which the present inventions pertain without departing from their spirit and scope. Accordingly, the scope of the present inventions is defined by the appended claims rather than the foregoing description and the exemplary embodiments described therein.
This application claims the benefit under 35 U.S.C. § 119(e) of U.S. Provisional Patent Application No. 61/029,042, filed Feb. 15, 2008, and entitled “Scene Classification on Video Data with a Material Modeling Step,” which is incorporated herein by reference as if set forth herein in its entirety.
Number | Date | Country | |
---|---|---|---|
61029042 | Feb 2008 | US |