C. J. Wu and A.H. Sung

Department of Computer Science

New Mexico Tech

Socorro, NM 87801

Abstract: A simple and efficient fuzzy controller for image compression using the JPEG lossy model is proposed. A new defuzzification method, the MOI (mean-of-inversion) method, is also proposed. The performance of the MOI method is compared with that of the COA (center-of-area) method with respect to convergence speed. Unlike the COA method, the MOI method defuzzifies each fired rule separately instead of superimposing fired rules before defuzzification. Consequently, the MOI method is less sensitive (than the COA method) to the contents of decision tables (or rule bases). Simulation results based on 15 pictures and 4 groups of fuzzy subsets also indicate that, under certain conditions, the MOI method competes favorably with the COA method in convergence speed.

Index terms: MOI, COA, JPEG, Fuzzy Controller, Defuzzification.


The lossy JPEG model is one of the most widely used digital image compression techniques for both grayscale and color still images [1]. However, that compression results are not predictable in advance is a common problem shared by such lossy image data compression techniques due to the large variety of image data. For a picture of M x N pixels with P grayscale levels, the possible combinations are up to . With this kind of variety, it is very difficult for any lossy compression model to predicate the relation of its parameters and compression results, such as mean square error. In other words, the compression and distortion ratios may depend heavily on the source image data.

The following ratio AGE (average grayscale error) is used in this work.


where G is the maximum grayscale value of pictures. MAE is the mean absolute error defined as


where and are the corresponding frames in the original and reconstructed pictures, respectively, N is the dimension of the input vector I (or frame M), and F is the total number of frames.

The rest of paper is organized as follows. Section II describes the structure of the designed fuzzy controller. The various experimental results are given in section III. Lastly, conclusions are given in section IV.


In this work, we propose a fuzzy controller to be used in conjunction with the JPEG model to achieve the automatic control during compression process on source side. The relation of JPEG (including coder and decoder) on source side is depicted in Figure 1.

The two inputs, and , to the fuzzy controller at the time t are defined as



The universal set of , E, is the interval of real numbers, while the universal set of , Q, is the interval of integer numbers.

Seven fuzzy subsets are used--PB (positive big), PM (positive medium), PS (positive small), ZE (zero), NS (negative small), NM (negative medium), and NB (negative big)--for those inputs and the output of fuzzy controller. For an input crisp value, the membership value of fuzzy subset A is decided by




where C, L, and R are the central value, the left boundary, and the right boundary, respectively, and A={NM, NS, ZE, PS, PM}. For example, the fuzzy subsets of the form (L, C, R) used for the input and the entries of decision tables are

Group 0:

NB(-100, -50, -25), NM(-40, -25, -10), NS(-20, -10, 0), ZE(-5, 0, 5), PS(0, 10, 20), PM(10, 25, 40), PB(25, 50, 100)

As for the input , Four fuzzy subsets used are

Group 1:

NB(-100, -6, -3), NM(-5, -3, -1), NS(-2, -1, 0),

ZE(-0.5, 0, 0.5),

PS(0, 1, 2), PM(1, 3, 5), PB(3, 6, 100)

Group 2:

NB(-100, -3, -1.5), NM(-2.5, -1.5, -0.5), NS(-1, -0.5, 0), ZE(-0.25, 0, 0.25), PS(0, 0.5, 1), PM(0.5, 1.5, 2.5), PB(1.5, 3, 100).

Group 3:

NB(-100, -12, -6), NM(-10, -6, -2), NS(-4, -2, 0), ZE(-1, 0, 1), PS(0, 2, 4), PM(2, 6, 10), PB(6, 12, 100)

Group 4:

NB(-100, -1.5, -0.75), NM(-1.25, -0.75, -0.25), NS(-0.5, -0.25, 0), ZE(-0.125, 0, 0.125), PS(0, 0.25, 0.5), PM(0.25, 0.75, 1.25), PB(0.75, 1.5, 100).

Two decision tables are used in this work, Table 1 for the MOI method (defined in Eq. 10 below) and Table 2 for the COA method (defined in Eq. 9 below). The confidence value of decision table entry ij, , is calculated using the fuzzy-min (or intersection) operator


where is membership functions defined in Eqs. 5-7.

In the literature [2, 3], the center-of-area (COA) method is one of the most commonly used defuzzification methods. For the COA method, the crisp output is the center of gravity of distribution of membership function . In the case of the discrete universal set W, the COA method is defined by [4]

(COA) (9)

where n is the number of quantization levels of the fuzzy set C, and .

The MOI method for (the feedback from the controller to JPEG) is calculated as

(MOI) (10)

where K and L are the number of rows and columns in the decision table, respectively. is decided by the following algorithm:

Step 1. Calculate the corresponding crisp values T of fuzzy membership value .


where is the inverse function of and A is the corresponding fuzzy subset of . Note that there might be more than one value generated by .

Step 2. Adjust each inverse value T for guaranteed convergence.


Step 3. Pick the largest absolute value of . If , ; otherwise, .

For guaranteed convergence, will be no larger than . In addition, in the case of overshooting, will be smaller than . The proof of guaranteed convergence can be seen in [5].


Experiments were performed on 15 USC images which include eight 256x256 images and seven 512x512 images with 256 grayscales. The eight 256x256 pictures are Girl-I, Couple, Lady, Girl-II, House, Tree, Ball-I, and Ball-II. The seven 512x512 pictures are Splash, Girl-III, Baboon, Lena, F16, Park, and Pepper. The JPEG model is developed by Independent JPEG Group with the fuzzy controller created by the authors [6]. In addition, ten random initial values, 38, 58, 13, 15, 51, 27, 10, 19, 12, and 86, of q generated by C's rand() are used to test the performance of the designed fuzzy controller. The performance comparison of the MOI and the COA methods in terms of accuracy under these four groups can be seen in [5].

The simulation results are given in Tables 3 and 4 for the cases of tolerance 0 and 0.025, respectively. As seen in Tables 3 and 4 , the convergence speed is affected by the groups of fuzzy subsets used and tolerance significantly.


Unlike the COA methods, the MOI method defuzzifies each fired rule individually. As shown in Eq. 11, the result of defuzzification for each rule is the corresponding inverse value of fired membership grade with respect to the membership function.

As observed in Tables 3 and 4, for the MOI method, the convergence speed is greatly improved when a small nonzero tolerance is used. Usually, the COA method converges faster than the MOI method when tolerance 0 is used, as indicated in Table 3. However, as Table 4 shows, the MOI method could outperform the COA method when a small amount of tolerance, e.g., 0.025 of AGE, is used. Also note that the convergence speed depends heavily on images and initial input values, as can be seen in Tables 3 and 4.


[1] G. K. Wallace, "The JPEG still Picture Compression Standard," Communications of the ACM, vol. 34, no. 4, 1991, pp. 30-44.

[2] R.M. Tong, "A Control Engineering Review of Fuzzy Systems, " Automatica, vol. 13, 1977, pp. 559-568.

[3] C.C. Lee, "Fuzzy Logic in Control Systems: Fuzzy Logic Controller," IEEE Trans. Syst. Man. Cybern., vol. 20, no. 2, 1990, pp. 404-435.

[4] H.R. Berenji, "Fuzzy Logic Controllers," in An Introduction to Fuzzy Logic Applicatons in Intelligent Systems, R.R. Yager and L.A. Zadeh, Boston: Kluwer Academic Publishers, 1992, pp. 69-96.

[5] C.J. Wu, "A General Purpose Fuzzy Controller for JPEG and Monotone functions," PH.D. Thesis, New Mexico Tech., Socorro, New Mexico.

[6] C.J. Wu and A.H. Sung, "The Application of Fuzzy Logic to JPEG," IEEE Trans. Consumer Electronics, vol. 40, no. 4, 1994, pp. 976-984.