The Effect of Lossy Image Compression on Image Classification

15
NASA-CR-199550 Research Institute for Advanced Computer Science NASA Ames Research Center The Effect of Lossy Image Compression on Image Classification Justin D. Paola Robert A. Schowengerdt (NASA-CR-199550) THE EFFECT OF LCSSY IPAGE COMPRESSION CN IHAGF CLASSIFICATION (Research Inst. for Advanced Corrputer Science) 14 p N96-13371 UncI as G3/43 0073753 RIACS Technical Report 95.18 August 16,1995 Appeared in Proceedings, 15th Annual IEEE International Geoscience and Remote Sensing Symposium, Florence, Italy, July 20-14,1995, pp. 118-120.

Transcript of The Effect of Lossy Image Compression on Image Classification

Page 1: The Effect of Lossy Image Compression on Image Classification

NASA-CR-199550

Research Institute for Advanced Computer ScienceNASA Ames Research Center

The Effect of Lossy Image Compressionon Image Classification

Justin D. Paola

Robert A. Schowengerdt

(NASA-CR-199550) THE EFFECT OFLCSSY IPAGE COMPRESSION CN IHAGFCLASSIFICATION (Research Inst. forAdvanced Corrputer Science) 14 p

N96-13371

UncI as

G3/43 0073753

RIACS Technical Report 95.18August 16,1995

Appeared in Proceedings, 15th Annual IEEE International Geoscience and Remote SensingSymposium, Florence, Italy, July 20-14,1995, pp. 118-120.

Page 2: The Effect of Lossy Image Compression on Image Classification

The Effect of Lossy Image Compressionon Image Classification

Justin D. Paola

Robert A. Schowengerdt

The Research Institute for Advanced Computer Scienceis operated by Universities Space Research Association,

The American City Building, Suite 212, Columbia, MD 21044, (410) 730-2656

Work reported herein was partially supported by the National Aeronautics and Space Administration underContract NAS 2-13721 to the Universities Space Research Association (USRA) and under Grant NAG 5-2198 to the University of Arizona Department of Electrical and Computer Engineering. Work performed atthe Research Institute for Advanced Computer Science (RIACS), NASA Ames Research Center, MoffetField, CA 94035-1000

Page 3: The Effect of Lossy Image Compression on Image Classification

ABSTRACT

We have classified four different images, under various levels of JPEG compression,using the following classification algorithms: minimum-distance, maximum-likelihood,and neural network. The training site accuracy and percent difference from the originalclassification were tabulated for each image compression level, with maximum-likelihoodshowing the poorest results. In general, as compression ratio increased, theclassification retained its overall appearance, but much of the pixel-to-pixel detail waseliminated. We also examined the effect of compression on spatial pattern detectionusing a neural network.

INTRODUCTION

With remote sensing studies becoming more global in nature, and computer processingpower increasing, many scientists have been turning to larger and larger data sets.Unfortunately, storage of enormous data sets can be costly, thus making imagecompression an important consideration in the remote sensing field. For typical earthscience imagery, lossless compression will result in about a 2:1 reduction. Lossycompression methods, however, commonly provide 10:1, 20:1, or even higher ratios,while maintaining the visual integrity of the image. The effect of these algorithms onsupervised classification is important to consider before any data is archived with lossycompression.

JPEG IMAGE COMPRESSION

A common industry standard lossy compression method is JPEG (Joint PhotographicExperts Group), which uses the discrete cosine transform. This algorithm is both fast andprovides excellent energy compaction for highly correlated data [1].

JPEG makes use of the discrete cosine transform (DCT) for 8x8 contiguous sub-blocksof the image. The transform matrix C = (c(k,n)} is defined as:

1k=0, OSn<7

"° (1)1 7t(2n+l)k ,^, „ ̂ „ V '-cos—i '— , l£k£7, 0£n£7.2 16

Most of the energy is packed into the first few transform coefficients. Varying levels ofcompression can be achieved by using variable quantization of these coefficients. Othercompression algorithms, such as improved quantization of the DCT [2] and wavelettransform compression [3], are much superior both visually and in terms of mean squareerror, but are not yet image processing standards like JPEG.

EXPERIMENT

Recent studies have been reported on the effect of particular compression algorithms onsubsequent multispectral analysis such as principal components and vegetation indexes[4] and on supervised and unsupervised classification [5].

In this experiment we have compressed four remotely-sensed multispectral images tovarying degrees and have investigated the resulting supervised classifications obtained bythe minimum-distance (MD), maximum-likelihood (ML), and three-layer

Page 4: The Effect of Lossy Image Compression on Image Classification

backpropagation neural network classifiers. We have also looked at the effect ofcompression on spatial pattern detection using a neural network.

The four classifications are:• An urban land-use classification of Landsat Thematic Mapper (TM) satellite imagery

of Tucson, Arizona, obtained April 1st, 1987.

• An urban land-use classification of TM imagery of Oakland, California, obtainedAugust 1st, 1984.

• A geologic classification of Airborne Visible Near Infrared Imaging Spectrometer(AVIRIS) aircraft imagery of the Lunar Lake Volcanic Field in central Nevada, obtainedSeptember 29,1989 [6].

• A combined temporal AVHRR NDVI (11 bi-weekly composites), spectral AVHRR,and DEM land cover classification of central California, using imagery from January toJuly, 1992.

For the first two images, the classifications were done two ways: 1) training on theoriginal image with classification on the compressed imagery, and 2) both training andclassification on the compressed imagery. For the second two images, all training wasdone on the original image. Both of the training methods are valid scenarios. In the firstcase, the user may have a few high quality (uncompressed) images to use for training, butdesires to browse a compressed database. In the second case, the user is starting off withthe compressed imagery.

The spatial data set is a series of synthetic aperture radar images from the Magellanspacecraft of the surface of Venus. A previous experiment on spatial pattern detection ofimpact craters [7] was reexamined after compression of the imagery.

RESULTS

Three different measures of classifier accuracy are presented in the tables. For eachcase, the accuracy of the training sites is given. If training was done on the original(uncompressed) image, this measure gives an indication of how much the compressionhas distorted the class exemplar regions. If training was done on the compressed image,this measure shows how well the classifier was able to describe the distorted trainingdata.

The second measure is the accuracy of test sites that are independent of the trainingdata. This is given for the Tucson image and helps show the generalization of theclassification.

The third measure is the percentage of pixels in the classification of the compressedimage (whether trained on die compressed image or not) that match the classification ofthe original image. It is safe to assume that the classification of the compressed data willbe no more accurate than that of the original data. Thus, this measure gives a maximumbound on classification accuracy.

All of the classifications performed well for moderate compression ratios. In general,the maximum-likelihood and neural network classifications were more accurate on theoriginal images than minimum-distance. The ML classifier, however, tended todeteriorate the most with increased compression. For the Tucson image, both the trainingand independent test sites degraded much more rapidly for ML than for the other twoclassifiers, as did the % match measure. Fig. 1 shows how the classifiers performed, afterbeing trained on the original Oakland image, on a 28.5:1 compressed image.

It is intuitive that the MD classifier would not degrade as quickly as a parametricclassifier. While individual pixel values can become quite distorted, and the class

Page 5: The Effect of Lossy Image Compression on Image Classification

distributions can change significantly with high JPEG compression (the classes tend tolose their spectral correlation, see [8]), the class means, on which the MD classifierdepends, remain relatively constant.

Meanwhile, the assumption of a Gaussian class distribution, shaky to begin with inthese types of classifications [9], causes the ML classifier significant problems as thepixel values change. The neural network, which derives a class distribution non-parametrically from the training data, suffers if the pixel values change significantly, butoften starts off with a better description of these distributions and has more leeway forerror.

As the compression ratio increases, the 8x8 image blocks become more homogeneous.The elimination of high frequency detail leads to a loss of detail in the resultingclassification. Thus, while the overall classification remains fairly accurate, with large-scale spatial regions generally maintaining the correct classes, much of the finer detail iseliminated.

For the spatial pattern detection, the neural network windows were expanded to 25x25and only one image band (Magellan SAR) was used. The compression in this caseseemed to have little effect on the detection of impact craters.

CONCLUSION

Overall, it was found that high quality classifications could be obtained with any of theclassifiers for JPEG compression ratios approaching 10:1 or even higher. Qualitatively,the classification retains its overall appearance, but the smoothing effect of highcompression tends to eliminate much of the pixel-to-pixel detail. As expected, trainingon the compressed imagery could raise the training site accuracy, but did not raise thepercentage of pixels matching the original classification. For the spatial pattern detectionexample presented, even severe image compression had little effect on detection ability.

Page 6: The Effect of Lossy Image Compression on Image Classification

REFERENCES

[1] A. K. Jain, Fundamentals of Digital Image Processing, Prentice-Hall, EnglewoodCliffs, NJ., 1989.

[2] M. W. Marcellin, P. Sriram, and K.-L. Tong, "Transform coding of monochromeand color images using trellis coded quantization", IEEE Transactions on Circuitsand Systems for Video Technology, pp. 270-276, Aug. 1993.

[3] J. M. Shapiro, "Embedded image coding using zerotrees of wavelet coefficients",IEEE Transactions on Signal Processing, pp. 3445-3462, Dec. 1993.

[4] S. S. Shen, J. E. Lindgren, and P. M. Payton, "Effects of MultispectralCompression on Machine Exploitation", Proceedings, 27thAsilomar Conferenceon Signals, Systems and Computers, IEEE 1058-6393/93, pp. 1352-1356, PacificGrove, Ca., Nov. 1993.

[5] A. Habibi, B. Blyth, and C. Andrews, "Classification Consistency for BandwidthCompressed Multispectral Imagery", Proceedings, 27thAsilomar Conf. onSignals, Systems and Computers, IEEE 1058-6393/93, pp. 1347-1351, PacificGrove, Ca., Nov. 1993.

[6] E. Mer6nyi, R. B. Singer, and W. H. Farrand, "Classification of the LCVFAVTRIS Test Site With a Kohonen Artificial Neural Network", Contribution tothe 4th Airborne Geoscience Workshop, pp. 117-120, Washington, D.C., Oct. 25-29,1993.

[7] J. D. Paola and R. A. Schowengerdt, "Comparisons of Neural Networks toStandard Techniques for Image Classification and Correlation", Proceedings,14th Annual IEEE International Geoscience and Remote Sensing Symposium(IGARSS '94), pp. 1404-1406, Pasadena, Ca., Aug. 1994.

[8] R. A. Schowengerdt and J. D. Paola, "Parallel Computing and Data Compressionfor Pattern Matching in Remote Sensing Image Databases", Proceedings,Conference on Recent Advances in Remote Sensing, The European Symposium onSatellite Remote Sensing, Rome, Italy, Sept. 26-30,1994.

[9] J. D. Paola and R. A. Schowengerdt, "A Detailed Comparison of BackpropagationNeural Network and Maximum-Likelihood Classifiers for Urban Land UseClassification", to appear in IEEE Transactions on Geoscience and RemoteSensing, July 1995.

Page 7: The Effect of Lossy Image Compression on Image Classification

Figure 1: Classification of 28.5:1JPEG compressed TMOakland image.

Band 5 of thecompressed image.

Note: The 8x8 DCT blocking is apparent.

Note: The diagonal feature is a lake.White represents 'forest'. Otherclasses include 'grassland' and'residential'. The class occupyingmuch of the lake area in the MLmap is 'urban'.

Minimum-distanceclassification

Maximum-likelihoodclassification

Neural network classification.

Page 8: The Effect of Lossy Image Compression on Image Classification

Table 1: Tucson TM image. Classifier performance on the compressed images whentrained on the original data. Percent classification accuracies given for both thetraining sites and independent test sites. See Figure 2.

Image

Orig.

1.95:1

3.8:1

7.1:1

16.9:1

25.3:1

Minimum-distanceclassifieraccur. %Trn: 69.7Test: 67.0Trn: 69.5Test: 67.2Trn: 70.3Test: 67.1Trn: 69.2Test: 67.4Trn: 68.3Test: 69.0Trn: 69.2

Test: 69.4

MD%matchto orig.

97.1

90.3

83.9

76.2

72.4

Maximum-likelihoodclassifieraccur. %Trn: 96.9Test: 89.5Tm: 96.1Test: 87.1Trn: 86.3Test: 77.9Tm: 79.2Test: 7 1.0Tm: 65.4Test: 61.3Trn: 57.3Test: 49.8

ML%matchto orig.

87.2

71.9

65.0

54.6

50.0

Neuralnetworkclassifieraccur. %Trn: 96.1Test: 94.0Trn: 95.5Test: 93.6Trn: 94.6Test: 93.1Trn: 93.9Test: 92.3Tm: 92.7Test: 91.9Trn: 92.4Test: 91.0

Net%match

toorig.

95.3

87.5

82.3

75.4

71.8

Table 2: Tucson TM image. Classifier performance when both training and classificationare carried out on the compressed images. See Figure 3.

Image

1.95:1

3.8:1

7.1:1

16.9:1

25.3:1

Minimum-distanceclassifieraccur. %Trn: 69.3Test: 67.2Trn: 70.4Test: 67.2Trn: 69.4Test: 67.5Trn: 68.0Test: 68.1Trn: 70.5Test: 69.9

MD%matchto orig.

97.1

90.2

83.9

76.1

72.2

Maximum-likelihoodclassifieraccur. %Trn: 96.4Test: 91.6Trn: 95.5Test: 87.7Trn: 96.2Test: 85.8Tm: 97.6Test: 80.7Tm: 96.4Test: 72.6

ML%match

to orig.

86.3

74.8

65.1

52.7

46.7

Neuralnetworkclassifieraccur. %Trn: 95.6Test: 92.2Trn: 95.1Test: 91.3Trn: 94.6Test: 91.8Trn: 95.7Test: 91.6Trn: 94.4Test: 90.9

Net%match

toorig.90.9

84.9

80.7

73.3

70.1

Page 9: The Effect of Lossy Image Compression on Image Classification

Table 3: Oakland TM image. Classifier performance on the compressed images whentrained on the original data. Percent classification accuracies are given for thetraining sites. See Figure 4.

Image

Orig.1.65:13.1:15.3:1

13.45:128.5:1

Minimum-distanceclassifieraccur. %

89.189.188.988.491.293.9

MD%matchto orig.

—99.494.790.582.976.0

Maximum-likelihoodclassifieraccur. %

97.197.195.193.690.983.9

ML%matchto orig.

—98.991.386.476.466.8

Neuralnetworkclassifieraccur. %

95.395.294.593.994.693.8

Net%match

toorig.—

99.495.191.285.178.8

Table 4: Oakland TM image. Classifier performance when both training andclassification are carried out on the compressed images.

Image

1.65:13.1:15.3:1

13.45:128.5:1

Minimum-distanceclassifieraccur. %

89.188.788.191.793.6

MD%matchto orig.

99.394.790.582.875.7

Maximum-likelihoodclassifieraccur. %

97.197.0———

ML%matchto orig.

97.990.6———

Neuralnetworkclassifieraccur. %

94.995.294.695.4—

Net%match

toorig.94.791.188.683.0—

Table 5: Lunar Lake AVIRIS image. Training done on the original data only.Classification accuracies are given for the training sites. See Figure 5.

Image

Orig.1.45:12.45:13.5:17:1

12.5:1

Minimum-distanceclassifieraccur. %

88.683.780.774.828.327.2

MD%matchto orig.

—91.281.772.435.425.1

Maximum-likelihoodclassifieraccur. %

10088.372.866.111.713.5

ML%matchto orig.

—84.966.051.815.613.9

Neuralnetworkclassifieraccur. %

98.189.679.373.413.110.1

Net%match

toorig.—

88.375.863.85.310.1

Page 10: The Effect of Lossy Image Compression on Image Classification

Table 6: AVHRR NDVI time series/spectral/DEM image. Training done on the originaldata only. Classification accuracies are given for the training sites. See Figure6.

Image

Orig.1.9:13.9:16.9:119.1:138.3:1

Minimum-distanceclassifieraccur. %

95.195.195.295.196.496.9

MD%matchto orig.

—99.898.797.795.894.0

Maximum-likelihoodclassifieraccur. %

100100

99.497.694.985.9

ML%matchto orig.

—98.992.788.083.176.4

Neuralnetworkclassifieraccur. %

99.899.899.899.899.899.8

Net%match

toorig.—

99.798.397.295.393.6

Table 7: Number of true (out of 11) and false crater detections in Magellan imagery ofVenus using a neural network with 25x25 input nodes and 2 hidden layer nodesfor various threshold levels (net output ranges from 0 to 1).

Thr = 0.9Thr = 0.82Thr = 0.77

Uncompressedimage

5/1 1,0 false7/1 1,2 false11/1 1,4 false

5.9:1compression5/1 1,0 false8/11, 1 false11/1 1,3 false

25.5 : 1compression5/1 1,0 false8/1 1,0 false9/1 1,4 false

Table 8: Same as above with training done on 14.5:1 compressed image.

Thr = 0.9Thr = 0.82Thr = 0.77

5.9: 1compression6/1 1,0 false9/1 1,2 false11/1 1,7 false

25.5 : 1compression5/1 1,0 false9/11, 2 false9/11, 8 false

8

Page 11: The Effect of Lossy Image Compression on Image Classification

§8

Tucson TM image:Training on original with classification on compressed

1UU

90

80

70

60

50

40

i . i .

\

1 *"

:oo o

:

:

— e — '"

, , , ,

"" • • - •

, , , ,

. . , ,

, , , ,

1 1 1 1

, , , ,

, , , , _

» -

k ... .

, , , , :

— 0 — Minimum-Distance--- •X-- - - Maximum-Likelihood— *- - Neural Network

5 10 15 20

Compression Ratio25 30

Figure 2: Tucson TM image. Classifier performance on the compressed images whentrained on the original data. Classification accuracy is given for test sitesindependent of the training data. This data is from Table 1.

Page 12: The Effect of Lossy Image Compression on Image Classification

>*1I

•i.c uas

Tucson TM image:Both training and classification on compressed imagery

100L' . . • i . i . i i • i i . I i . . i i i . i i i . i i

90

80

70

60

50

40

100

90

80

70

60

50

40

X-- * X---. .

o—e-

I

—O Minimum-Distance-• - -X-- - - Maximum-Likelihood— *- - Neural Network

0 5 10 15 20

Compression Ratio25 30

Figure 3: Tucson TM image. Classifier performance on the compressed images whentrained on the compressed data. Classification accuracy is given for test sitesindependent of the training data. This data is from Table 2.

10

Page 13: The Effect of Lossy Image Compression on Image Classification

*

&CO00aI

100

95

90

85

80

Oakland TM image:Training on original with classification on compressed

-0— Minimum-Distance-X---- Maximum-Likelihood4- - Neural Network

10 15 20

Compression Ratio

25 30

Figure 4: Oakland TM image. Classifier performance on the compressed images whentrained on the original data. Classification accuracy is given for training sites.This data is from Table 3.

11

Page 14: The Effect of Lossy Image Compression on Image Classification

•1JS U

0-5O Cog.s

100

80

60

40

20

Lunar Lake AVIRIS image

_L-6— Minimum-Distance-X---- Maximum-Likelihood

— 4- - Neural Network

4 6 8 10

Compression Ratio

12 14

Figure 5: Lunar Lake AVIRIS image classifier performance. The data is from table 5.

2 1

SI

100

95

90

85

80

750

Central California AVHRRNDVI time series/spectral/DEM image

\

X

^v~=-

'

*-.

"=^-=-

. ._

3^~~S.! — — — ~- — =3

— 9 — Minimum-Distance— X---- Maximum-Likelihood— *- - Neural Network

"X -...._

. f ....10 15 20 25

Compression Ratio

30 35 40

Figure 6: Northern California NDVI time series/spectral/DEM image classifierperformance. The data is from table 6.

12

Page 15: The Effect of Lossy Image Compression on Image Classification

RIACSMail StopT041-5

NASA Ames Research CenterMoffett Field, CA 94035