**An Application of Fuzzy Controller on JPEG
**

C.J. Wu and A.H. Sung, "Application
of Fuzzy Controller to JPEG," Electronics Letters, vol. 30,
no. 17, pp. 1375-1376, 1994.

C. J. Wu and A.H. Sung

P.O. Box 2825 c/s, Department of Computer Science, New Mexico Tech., Socorro, NM 87801, USA

*Index terms: Fuzzy Controller, JPEG*

Abstract - In this paper, An application of fuzzy controller on JPEG for (grayscale) image data compression is presented. The fuzzy controller conducts the search of a better compromise between compression ratio and image quality automatically on the JPEG model. Therefore, the fuzzy controller equipped JPEG is insensitive to the given initial quality on quantization table. Simulations are performed and the results indicate that this fuzzy-control-equipped JPEG is very promising.

*Introduction*:
The
JPEG
algorithm
is
currently
widely
in
use
for
image
data
compression
[1].
However,
since
compression
and
distortion
ratios
depend
heavily
on
the
source
pictures,
trial-and-error
might
need
be
used
to
search
for
the
optimal
tradeoff
between
distortion
and
compression
ratios.
Fuzzy
logic
has
been
successfully
used
in
many
applications
of
process
control
[2].
In
this
work,
the
incorporation
of
a
fuzzy
controller
in
the
JPEG
algorithm
is
investigated.
The
design
of
JPEG,
including
coder
and
decoder,
and
fuzzy
controller
on
source
side
is
depicted
in
Fig.
1.

*The mechanism of fuzzy controller*:
Since
image
quality
is
our
primary
concern,
we
use
the
AGE
(average
grayscale
error)
to
guide
the
adjustment
instead
of
BPP
(bits-per-pixel).

(1)

where
and are the corresponding pixels in the
original and reconstructed pictures respectively, *P*
is the total number of pixels in the picture, and
G
is
the
maximum
grayscale
value.
The
two
inputs,
and ,
of the fuzzy controller are defined as follows:

(2)

(3)

where TGE is the target grayscale error. In this paper, seven fuzzy sets are used--PB (positive big), PM (positive medium), PS (positive small), ZE (zero), NS (negative small), NM (negative medium), and NB (negative big), and their membership functions are characterized by three values--(left boundary, central value, right boundary) and the following equations:

(4)

* *
(5)

* *
(6)

where C, L, and R are the central value, left boundary,
and right boundary, respectively; and A={NM, NS, ZE, PS, PM}.
For input , the membership
functions of fuzzy sets are 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), and
PB(3, 6, 100). For input and output ,
the membership functions of fuzzy sets are NB(-1, -0.25, -0.1),
NM(-0.15, -0.1, -0.05), NS(-0.1, -0.05, 0), ZE(-0.025, 0, 0.025),
PS(0, 0.05, 0.1), PM(0.05, 0.1, 0.15), and PB(0.1, 0.25, 1). Table
1 is the decision table used by this fuzzy controller and the
value of its entry *ij*,
, is calculated as
follow:

(7)

The defuzzification equation for , the feedback from controller to JPEG, is modified from [3].

(8)

where K and L are the number of rows and columns in the decision table respectively. To guarantee that will not be bigger than in terms of crisp value, is decided by the following algorithm.

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

(9)

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

Step 2. Pick the largest *T,*
say
,*
* whose
absolute
value----is
no greater than , that is, ;
otherwise, . In addition,
will be smaller than in case of overshooting.

*Simulation results*:
Experiments
are
performed
on
Lena,
an
image
with
512x512
pixels
in
256
grayscales,
using
the
JPEG
software
package
developed
by
Independent
JPEG
Group
with
the
fuzzy
controller
implemented
by
the
authors.
Ten
random
initial
qualities
generated
by
C's
rand()
are
used
to
test
insensitivity
of
this
fuzzy-control-equipped
JPEG.
As
shown
in
Table
2,
this
version
of
JPEG
is
insensitive
to
the
given
initial
qualities,
and
the
final
AGEs
are
very
close
to
the
goal,
TGE.
The
measure
criterion
SNR
is
defined
as
follows:

(10)

where *G*
is
the
maximum
grayscale
value
of
picture.

*Conclusions and discussions*:
The
ordinary
fuzzy
controller
could
fail
to
converge
for
some
pictures
since
it
is
almost
impossible
to
know
the
relation
between
AGE
and
the
JPEG
parameter
'quality'
in
advance.
Additionally,
in
order
to
guarantee
both
convergence
and
good
performance
for
the
monotone
function
as
in
this
case,
the
present
adjustment
must
be
smaller
than
the
previous
adjustment
in
the
case
of
overshooting,
that
is,
. The effects of different types of membership
functions and their numbers on performance are topics for future
research.

References

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

[2]
Sugeno,
M.,
*Industrial Applications of Fuzzy Control*.
Amsterdam,
North
Holland,
1985.

[3]
Kosko,
B.,
*Neural Networks and Fuzzy
Systems: A Dynamical Systems Approach to machine Intelligence*,
Prentice-Hall,
Englewood
Cliffs,
NJ,
1992.

**Fig1**.
*The schematic diagram of JPEG with fuzzy controller
*