A METHOD AND APPARATUS FOR SEGMENTING IMAGES PRIOR TO CODING

Abstract: To segment moving foreground from background, where the moving foreground is of most interest to the viewer, this method uses three detection algorithms as the input to a neural network. The multiple cues used are focus, intensity, and motion. The neural network consists of a two-layered neural network. Focus and motion measurements are taken from high frequency data, edges; whereas, intensity measuremenets are taken from low frequency data, object interiors. Combined, these measurements are used to segment a complete object. Results indicate that moving foreground can be segmented from stationary foreground and moving or stationary background. The neural network segments the entire object, both interior and exterior, in this integrated approach. Results also demonstrate that combining cues allows flexibility in both type and complexity of scenes. Integration of cues improves accuracy in segmenting complex scenes containing both moving foreground and background. Good segmentation yields bit rate savings when coding the object of interest, also called the video object in MPEG4. This method combines simple measurements to increase segmentation robustness.

Description: A METHOD AND APPARATUS FOR SEGMENTING IMAGES PRIOR TO CODING BACKGROUND OF THE INVENTION This application relates to Application No. 08/429,458 filed by the same inventors on April 25, 1995, which is hereby incorporated by reference as if repeated herein in its entirety. The present invention relates generally to video coding and more particularly to video coding in which the image is decomposed into objects prior to coding. Each of the individual objects is then coded separately. For many image transmission and storage applications, significant data compression may be achieved if the trajectories of moving objects in the images are successfully estimated. Traditionally, block-oriented motion estimation has been widely investigated due to its simplicity and effectiveness. However, block and object boundaries in a scene normally may not coincide because the blocks are not adapted to the image contents . This can lead to visible distortions in low bit rate-coders, known as blurring and mosquito effects. Object-oriented coding techniques were developed to overcome the disadvantages of block-oriented coding. In one type of object-oriented coding, the image sequence is segmented into moving objects. Large regions with homogeneous motion can be extracted, resulting in higher compression and reduced motion boundary visible distortions. As the foreground objects carry more new information relative to the slowly changing background, the background can be transmitted less frequently than the foreground. Consequently, the foreground objects must be correctly identified to achieve the desired compression levels without adding undue distortion. As a result, segmentation is an important intermediate step in object- oriented image processing. For this reason, many approaches to segmentation have been attempted, such as motion-based, focus-based, intensity-based, and disparity-based segmentation. The problem with each of these approaches is their feature specificity, which limits the scenes to which they are successfully applied. For example, the scene must contain motion for motion-based segmentation to be applicable. The scene must contain significant contrast to supply intensity-based segmentation. Similar features are required for the other approaches. In addition, the motion-based approach fails for scenes containing both foreground and background motion, such as moving foreground shadows cast onto the background. The focus-based approach also fails when the foreground is blurred. The intensity-based approach fails for textured objects because a single object erroneously segments into multiple objects. And the measurement of disparity in the disparity-based approach is complex and error- prone. One technique is to use a priori knowledge about the images to select the coding method, which overcomes this problem. However, this makes image coding inconvenient in that processing must include a determination of the type of image and then a selection of the most appropriate coding type for that image. This significantly increases preprocessing costs of the images prior to coding. Alternatively, a lower quality coding must be employed. Unfortunately, neither of these alternatives is acceptable as bandwidth remains limited for image transmission and consumers expect higher quality imagery with increased technology. The issue then becomes how to accentuate the strengths of these methods and attenuate their failings in foreground and background segmentation. Several possibilities have been examined. One approach combines motion and brightness information into a single segmentation procedure which determines the boundaries of moving objects. Again, this approach will not work well because the moving background will be segmented with the moving foreground and therefore classified and coded as foreground. Another approach uses a defocusing and a motion detection to segment a foreground portion of the image from a background portion of the image. This process is shown in FIGs 7-9. FIG 7 shows the process, FIG 8 shows the segmentation results over several frames, and FIG 9 shows the results of the defocus measurement. However, this approach requires a filling step to the process. Filling is a non-trivial problem, especially where the foreground image segment output by this process results in objects without closed boundaries. In this case, significant complexity is added to the overall process. Given the complexity inherent in video coding, the elimination of any complex step is significant in and of itself. The present invention is therefore directed to the problem of developing a method and apparatus for segmenting foreground from background in an image sequence prior to coding the image, which method and apparatus requires no a priori knowledge regarding the image to be segmented and yet is relatively simple to implement. SUMMARY OF THE INVENTION The present invention solves this problem by integrating multiple segmentation techniques by using a neural network to apply the appropriate weights to the segmentation mapping determined by each of the separate techniques. In this case, the neural network has been trained using images that were segmented by hand. Once trained, the neural network assigns the appropriate weights to the segmentation maps determined by the various techniques. One embodiment of the method according to the present invention calculates the motion, focus and intensity segmentation maps of the image, and passes each of these maps to a neural network, which calculates the final segmentation map, which is then used to outline the segmented foreground on the original image. In this embodiment, two consecutive images are acquired for use in detecting the various segmentation maps input to the neural network. The step of detecting motion includes detecting a difference between pixels in successive frames and determining that a pixel is in motion if the difference for that pixel exceeds a predetermined threshold. The step of detecting focus includes calculating the magnitude of the Sobel edge detection over an nxn pixel square and dividing the magnitude of the Sobel edge detection by the edge width. The step of detecting intensity comprises determining a gray level of the pixel. Another embodiment of the method of the present invention for processing an image sequence to segment the foreground from the background, includes acquiring successive images in the sequence, simultaneously measuring motion, focus and intensity of pixels within successive images, inputting the motion, focus and intensity measurements to a neural network, calculating foreground and background segments using the motion, focus, and intensity measurements with the neural network, and drawing a segment map based on the calculated foreground and background segments. In an advantageous implementation of the above methods according to the present invention, it is possible to speed the training of the neural network using an adaptive learning rate. One possible embodiment of the adaptive A w = I r * d p τ A b = I r * d learning rate is the following equation: where w is a layer's weights, b is a layer's bias, lr is the adaptive learning rate, d is the layer's delta vectors and p is the layer's input vector, and T indicates that vector p is first transposed before being multiplied. An apparatus for segmenting the foreground and background from a sequence of images according to the present invention includes a motion detector, a focus detector, an intensity detector and a neural network. The motion detector detects motion of pixels within the image sequence and outputs a motion segmentation map. The focus detector detects pixels that are in focus and outputs a focus segmentation map. The intensity detector detects those pixels that have high intensity and those with low intensity and outputs an intensity segmentation map. The neural network is coupled to the motion detector, the focus detector and the intensity detector, and weighs the outputs from these detectors and outputs a final segmentation map. One advantageous implementation of the neural network used in the present invention includes a two layer neural network. In this case, the neural network has a hidden layer with two neurons and an output layer with one neuron. In this implementation, the intensity map is input to a first neuron in the hidden layer using a first weight and a second neuron in the hidden layer using a second weight, the focus map is input to the first neuron in the hidden layer using a third weight and the second neuron in the hidden layer using a fourth weight, the motion map is input to the first neuron in the hidden layer using a fifth weight and the second neuron in the hidden layer using a sixth weight. Bias information is input to the first and second neurons using a seventh weight and an eighth weight, respectively. Yet another advantageous embodiment for implementing the method of the present invention includes a means for digitizing the image sequence to obtain a sequence of digitized images, a means for segmenting an image based on motion of an object within the image, the motion segmenting means being coupled to the means for digitizing and outputting a motion segmentation map, a means for segmenting an image using focus measurements, the focus segmenting means being coupled to the means for digitizing and outputting a focus segmentation map, a means for segmenting an image using brightness measurements, the brightness segmenting means being coupled to the means for digitizing and outputting a brightness segmentation map, and a neural network that calculates a segmentation map using segmentation maps output by the motion segmenting means, the brightness segmenting means and the focus segmenting means. BRIEF DESCRIPTION OF THE DRAWINGS FIG 1 depicts a two-layer neural network used in the apparatus of the present invention, with one embodiment of weights for the different paths in the network. FIG 2 depicts the neural net training algorithm for foreground/background segmentation. FIG 3 depicts the foreground/background segmentation algorithm of the present invention. FIG 4 depicts the training plot of the neural network showing sum- squared error versus epochs. FIGs 5(a)-(c) depict the segmentation results of the present invention, in which 5(a) is the original frame, 5(b) is the neural network segmented output, and 5(c) is the segmented foreground outlined. FIG 6 depicts one possible embodiment of the apparatus for employing the method of the present invention FIG 7 shows a prior art process using a fill segmenting procedure. FIG 8 shows the segmentation results of the process of FIG 7 over several frames. FIG 9 shows the results of the defocus measurement used in the process of FIG 7. DETAILED DESCRIPTION The present invention provides an approach for segmenting foreground from background based on integrated cues. This approach integrates three measurements, focus, intensity, and motion, using a two-layered neural network, to segment complex scenes. Its advantage is that it combines simple segmentation measurements to increase robustness for segmenting a variety of scenes. By forming three separate segment maps of the image sequence, the present invention then chooses the best map based on the training of a neural network. The neural network used in the present invention is shown in FIG 1 , along with the optimum weights determined from the training of this network using a variety of images. Each map is an N x M image consisting of N x M pixels. Input to the neural network is corresponding pixels, I(i, j), m(i,j), f(i,j), where i= 1, ..., N and j=l, ..., M, one at a time in a left-to-right top-to-bottom order. The pixel values for the motion map are either 0 or 255 (where 0 indicates no motion and 255 indicates motion). The pixels values for the focus map and intensity map range from 0 to 255, inclusive. Now, once each pixel is input to the neural network, the network calculates an output value, o(i,j) for the (i,j) inputs. The final output result is an N x M image where 0 =background and 255=foreground. So, we can think of the processing of one image as a loop that runs N x M times, i.e., the neural network is accessed N x M times. Similarly, for a sequence of images, if one image loops N x M times, then for K images the neural network is accessed K x N x M times. According to the present invention, a two-layered neural network integrates three measurements for segmentation: focus, intensity, and motion. It is worthy to note that any technique for detecting focus, intensity or motion, respectively, will suffice, as long as it provides a segmentation map based on the same information. The training of the neural network will then determine the appropriate weights to apply to the various inputs using the different segmentation techniques. Two assumptions are made about the scene. First, it is assumed that the scene foreground is focused and the background blurred, i.e. closer objects are focused. Second it is assumed that objects to be segmented are in motion. -o- Segmentation measurements Focus Detector The focus detection technique used in the present invention is a known technique, therefore a full detailed description is not necessary to describe the present invention. A brief description, however, will be helpful. Focus is a function of depth. The farther away an edge is from the point of focus, the more blurred it becomes. This measurement indicates different depths. If an object point E is not in focus, the resulting image is a blurred image e called a blur circle. The blur circle size, hence the amount of focus, is a function of the depth u of point _V. Image focus is easily measured from high frequency components, such as image edges. The less blurred an edge, the higher the image focus, measured from edge strength. The focus measurement d over an n x n neighborhood in an image is where |S(-t,j>)| 2 is me magnitude of Sobel edge detection on image g(x,y) and w is the edge width in g(x,y). Then, within the n x n neighborhood, f(x + i, y + j) - d , where fix.y) is the focus measurement image, / = 0, ..., n, and j = 0, ..., n. The output of this detector is a map showing the pixels in the current image that are in focus and those that are blurred, i.e., the pixels that are part of the foreground and the pixels that are part of the background. This map is then input to the neural network as discussed below. Motion Detector As in the focus detection, the motion detection technique used in the present invention is a known technique, thus a detailed description of this technique is not necessary to describe the present invention. A brief description, however, will be helpful. md (x, y) - g l + 7x, y) - g, (x, y) Motion is detected using a subtraction method, where md(x,y) is the motion detected image and gj and gj+] are the z ' th and (i+l)-th frame in the sequence. Motion between successive frames is indicated by pixel differences greater than threshold T. If the pixel difference is greater than the threshold, the pixel in the current image is set to a gray level of 255, otherwise it is set to a gray level of 0. In this case, a gray level of 255 represents black and a gray level of 0 represents white. This threshold is determined experimentally in a known way. If the object has not moved, then the result is a blank image. _ J 255 ifmd(x, y) > T,) [ 0 otherwise J where τn(x,y) is the motion segmented image. The output from this motion detector is a motion map indicating the pixels that are in motion and those that are not, which represent the pixels that are part of the foreground and the pixels that are part of the background, respectively. Intensity Detector As in the focus and motion detection, the intensity detection technique used in the present invention is a known technique, thus a detailed description of this technique is not necessary to describe the present invention. A brief description, however, will be helpful. Intensity I(x,y) is simply gray level from 0 to 255. The importance of foreground intensity data is that it assists the neural network in segmenting object interiors. Focus and motion are measured from object edges. Therefore, a third measurement is needed for object interiors. In our work, this measurement is intensity, where large regions are input to the neural network. The output of this detector is an intensity map, which indicates those pixels belonging to the foreground and those to the background. Neural network A two-layered back propagation network is trained to segment a sequence. FIG 1 shows the network architecture. The neural network 10 includes a hidden layer 1 1 and an output layer 12. The hidden layer 11 contains two neurons 13, 14, and the output layer contains one neuron 15. The neurons 13-15 use sigmoid functions with weighted inputs. Essentially, these are summing amplifiers with weighted inputs. The inputs to the network are the motion, focus, and intensity measurements, or segmentation maps. The output is the segmented foreground image o(x,y), f 255 ifforeground, j 0 otherwise j The network is trained using the initial two frames of a sequence and its hand- segmented result. It is possible to speed the training with an adaptive learning rate, according to the rule, Aw - Ir * dp where w is a layer's weights, b is its bias, Ir is the adaptive learning rate, d is the Ab = Ir * d layer's delta vectors, andp is its input vector and T indicates that vector p is first transposed before being multiplied. METHODOLOGY The present invention provides an integrated segmentation approach to coding of images. Foreground and background features are segmented and background features discarded. The network is first trained using the first two frames of a sequence to get focus, motion, intensity, and segmented data. See FIG 2, which shows the four step training algorithm 20 for training the neural network. In the first step of the process, the first images in the sequence are acquired 21. Next, the images are segmented 22 by hand. Next, motion, focus and intensity are calculated 23. Finally, the neural network is trained 24 using the speed up process discussed above. FIG 3 also shows the four-step segmentation algorithm 30. First, two successive images are acquired 31. Next, focus, motion, and intensity are measured 32. The measurements are input to the trained neural network 33. The network outputs the segmented foreground. The segmented foreground is then outlined on the original image 34, which indicates the capability of the process of the present invention. As can be seen in FIG 5(c), the output of the process resulted in properly segmenting the man from the background. The segmentation map is used as a mask for separating the foreground from the background in the image coding process. The neural network applies the weights in Table 1 below to calculate the following equation: -12- w [ v,, J(x,y) + v 2 ,f(x,y) + v 3 ιm(x,y) + v 4 ,b(x,y) ] o(x,y) = + w 2 [ v, 2 I(x,y) + v 22 f(x,y) + v 32 m(x,y) + v i2 b(x,y) j + w 3 b(x,y) where o(x,y) is the segmentation map, I(x,y) is the intensity segmentation map, m(x,y) is the motion segmentation map, f(x,y) is the focus segmentation map, b(x,y) is the bias information, and vl 1, v21, v31, v41, vl2, v22, v32, v42, wl, w2, and w3 are the weights indicated in Table 1. These weights have been determined to work over some particular images. Modifications to the exact weights will occur depending upon the exact images being used. These weights are merely indicative of those determined by the inventors. TABLE 1 RESULTS Neural network training FIG 4 shows a plot 40 of the error rate (sum-squared error) 41 versus epochs (i.e., training cycles, which for an NxM image is NxM bytes of processing) 42 during training of a test sequence (see FIG 5). With good training, error reduces as training time increases, until a minimum error is reached. In our training session, the sum squared error reached a minimum at 4000. This translates into an average intensity difference between the neural network-generated segmentation map and the actual segmentation map for our 176x144 images of 0.0025/pixel. An advantage of the present invention is that it segments without any post-processing operation to fill the segmented object interior. Prior techniques required a fill operation to create the segmentation mask shown in FIG 5(b). This filling operation is non-trivial, especially with regard to an image without line segments that are closed. As a result of the present invention, the shape of the object is preserved by the intensity measurement in the neural network. As the focus and motion detectors operate on edge effects, which are high frequency components, they provide little information regarding the interior of the image. Thus, without the intensity measurement, a filling operation is necessary. Since the intensity measurement provides information regarding the interior of the image, using this information in the neural network eliminates the need for filling the interior of the image, thus making the post-processing filling step unnecessary. In addition, the intensity measurements are easily calculated. Segmentation FIG 5 shows the segmentation results for a frame in an image sequence. As shown, the neural network segmentation is accurate for the fiftieth frame of this sequence, which was trained on the first and second frames of the sequence. FIG 5(a) depicts the output from the camera 61, which is input to the three detectors. FIG 5(b) shows the final segmentation map output from the neural network, which as is evident corresponds well to the outlined figure. FIG 5(c) shows the segmentation foreground outlined, which shows the boundary of the foreground and background. This is shown to indicate the success of the segmentation approach, but is never actually created for the next step in the coding process. FIG 6 shows the apparatus 60 for implementing the method of the present invention. Two successive images are first acquired using a digital camera 61, for example. Next, the digitized images are input to three detectors 63, 64, 65, which calculate motion segmentation maps, focus segmentation maps and intensity segmentation maps, respectively. These maps are then input to the neural network 66, which outputs the final segmentation map, which is used to outline the foreground from the background. Thus, the present invention discloses an approach to foreground and background segmentation using integrated measurements. This approach is advantageous for two reasons. One, it is computationally simple. Two, combined measurements increase robustness in segmenting complex scenes. Other possible modifications include comparing the use of intensity versus color measurements as a basis for segmentation. While a neural network is used to perform the integration of the multiple maps and the assignment of weight, a fuzzy logic circuit could also be employed. This invention could also be implemented on a Sun Sparc workstation with an image acquisition device, such as a digital camera and a video board. One could also modify the method of the application and use a known disparity detector as an additional input to the neural network or as a replacement for one of the focus or intensity measurements. This is accomplished by simply by replacing one of the focus or intensity detectors with the disparity detector, which outputs its version of the segmentation map, which is then weighted by the neural network.

Claims: CLAIMS 1. A method for segmenting an image comprising integrating multiple segmentation techniques by using a neural network to apply appropriate weights to segmentation maps determined by each of the separate techniques. 2. A method for segmenting a sequence of images prior to coding the image sequence comprising the steps of: a) detecting motion within the image sequence; b) detecting focus within the image sequence; c) detecting intensity within the image sequence; and d) calculating segments using a neural network employing the results of the detection in steps a) through c).. 3. The method according to claim 2, further comprising the steps of: e) acquiring two consecutive images for use in the detecting steps. 4. The method according to claim 2, wherein the step of detecting motion comprises: (i) detecting a difference between pixels in successive frames; and (ii) determining that a pixel is in motion if the difference for that pixel exceeds a predetermined threshold. 5. The method according to claim 2, wherein the step of detecting focus comprises: (i) calculating the magnitude of the Sobel edge detection over an nxn pixel square; and (ii) dividing the magnitude of the Sobel edge detection by the edge width. 6. The method according to claim 2, wherein the step of detecting intensity comprises determining a gray level of the pixel. 7. A method for processing an image sequence to segment foreground from background, comprising the steps of: a) acquiring successive images in the sequence; b) simultaneously measuring motion, focus and intensity of pixels within successive images; c) inputting the motion, focus and intensity measurements to a neural network; d) calculating foreground and background segments using the motion, focus, and intensity measurements with the neural network; and e) drawing a segment map based on the calculated foreground and background segments. 8. The method according to claim 7, wherein the step of detecting motion comprises: (i) detecting a difference between pixels in successive images; and (ii) determining that a pixel is in motion if the difference for that pixel exceeds a predetermined threshold. 9. An apparatus for segmenting foreground and background from a sequence of images; a) a motion detector detecting motion of pixels within the image sequence and outputting a motion map; b) a focus detector detecting pixels that are in focus and outputting a focus map; c) an intensity detector detecting those pixels that have high intensity and those with low intensity and outputting an intensity map; d) a neural network being coupled to the motion detector, the focus detector and the intensity detector, weighing the outputs from these detectors and outputting a segmentation map. 10. The apparatus according to claim 9, wherein the neural network further comprises a hidden layer with two neurons and an output layer with one neuron, and each of the neurons employ sigmoid functions. 11. The apparatus according to claim 10, wherein: (i) the neural network applies a first weight to the intensity map, which is then input to a first neuron in the hidden layer, and the neural network also applies a second weight to the intensity map, which is then input to a second neuron in the hidden layer; (ii) the neural network applies a third weight to the focus map, which is then input to the first neuron in the hidden layer, and the neural network also applies a fourth weight to the focus map, which is then input to the second neuron in the hidden layer; and (iii) the neural network applies a fifth weight to the motion map, which is then input to the first neuron in the hidden layer, and the neural network also applies a sixth weight to the motion map, which is then input to the second neuron in the hidden layer. 12. The apparatus according to claim 10, wherein the two neurons in the hidden layer are coupled to the one neuron in the output layer using a ninth weight and a tenth weight, respectively. 13. The apparatus according to claim 12, wherein the one neuron in the output layer includes three inputs, one from each of the two neurons in the hidden layer and a bias input, having an eleventh weight.

Inventors: CHEN TSUHAN, SWAIN CASSANDRA TURNER, CHEN, TSUHAN, SWAIN, CASSANDRA, TURNER
Applicants: AT & T CORP, AT & T CORP.
Application year: 1998
Main classification: G06T7
IPC codes: G06N3, G06T7, H04N7