# Two-dimensional Image Filter Design for Multiplierless Implementation Using Genetic Algorithms

Τεχνίτη Νοημοσύνη και Ρομποτική

23 Οκτ 2013 (πριν από 4 χρόνια και 6 μήνες)

88 εμφανίσεις

Two
-
dimensional Image Filter
Design for Multiplierless
Implementation Using Genetic
Algorithms

Senior Capstone Design Project

Spring, 2003:

Douglas Lockett & Christopher Roblee

Objective Statement

To devise an improved methodology for
the performance enhancement of
hardware
-
based image filters through the
use of genetic optimization techniques.

Agenda

Image Filtering, IIR Systems

Multiplierless approach for performance
enhancement

Genetic optimization for multiplierless filter
design

Genetic Algorithm (GA) design process

GA and filter output results

Proposed hardware model

Conclusion

Image Filtering

Inherently two
-
dimensional.

Performed in spatial domain.

Many real
-
world applications.

Filters are either finite impulse response
(FIR) or infinite impulse response (IIR).

Defined by a series of filter coefficients.

IIR Filters

Motivations:

Require fewer coefficients (lower order) than FIR
filters for a given response.

Allow for more precise and sharper approximations of
the ideal frequency response.

Issues in stability.

Issues with phase response linearity.

Multiplierless Approach

Power
-
of
-
two coefficients (
2
n
, where n is whole number
)

A single arithmetic shift left (ASL) corresponds to a
multiplication by two. Likewise, an n
-
bit shift left or right
(ASR) corresponds to a multiplication or division by 2
n
,
respectively.

Computationally intensive and logically complex
multiplication operations within a filtering algorithm can be
reduced to fast and efficient binary shifts.

Highly beneficial for real
-
time image processing systems.

Much more difficult to obtain suitable coefficients, however.

13

x5

65

00001101

x 00000101

00001101

00000000

00001101

0001000001
2

=
65
10

13

x8

104

00001101 x 00001000

01101000
2

Shift left 3

=
104
10

Example: Real multiplication

Example: Power
-
of
-
two multiplication

Genetic Algorithms (GAs)

Used to optimize systems through evolutionary
breeding (crossover).

Based on Darwinian genetic theory of fittest
member (system) survival.

Random search, as opposed to exhaustive search
approach.

Many generations (iterations) to improve overall
population fitness.

Decided on GA to realize multiplierless enhancement:

Classical filter design techniques (Chebyshev,
Butterworth, Elliptical, Bilinear Transform) are
incapable of satisfying criteria imposed by
multiplierless systems.

Innovative application.

Execution Flow of a Basic Genetic
Algorithm

Begin with random initial
population of possible outcomes.

Evaluate fitness of each member in
the population.

Probability of crossover assigned
to each member based upon
fitness.

Members selected to crossover
pseudo
-
randomly, with fitter
members having higher
probabilities of being chosen to
crossover. Corresponds to an
exchange of “genetic material”
between parents such that
subsequent generations become
fitter over time.

Offspring from the crossover
process are subject to a random
mutation.

Above steps are repeated until
population converges to a single
(ideal) outcome representing the
fittest solution.

n

y

Fitness Evaluation

Initial
Population
of Members

Crossover Selection

Crossover of selected
members

Mutation inserted into
population

Random
Mutation

Converge
d
?

Fittest
Member

New
Population

Desired

Output

Characteristics of Designed
Genetic Algorithm

Population comprises possible sets of multiplierless (power
-
of
-
two) filter coefficients.

Filter (member) stability is initial criterion.

Member fitness inversely proportional to the squares of the
differences between the member magnitude frequency response
and that of a specified ideal filter.

Crossover procedure defined by randomly selected crossover
points, corresponding to ranges of coefficients exchanged
between crossover pairs (breeding).

A specific number of fittest parent members are set aside and
inserted into the subsequent generation to prevent regression.

Coefficients within each member have a random chance of
mutation based upon a pre
-
defined mutation probability.

Process repeated for a specified number of iterations.

Fittest member after evolution cycle determined to be the optimal
multiplierless filter representation.

Y

N

More
Iterations?

Fittest
Member

New Population

Initial Population of
power
-
of
-
2
coefficients.

Desired
Response

Remove Unstable
Coefficient Sets

Parameters:

-
Number of Iterations

-
Filter Order

-
Mutation probability

-
Word length

-
Sampling frequency

Fitness Evaluation

-
Crossover Member Selection

-
Crossover Point Selection

Crossover of selected
coefficients

Mutation inserted into
population

Random
Mutation

Selected
Fittest
Members

Remove Unstable
Coefficient Sets

Newly
-
generated
power
-
of
-
2
coefficients.

Population replenished with
new members to maintain
original size

Multiplierless GA

For IIR Filters

Crossover Example

A coefficients

B coefficients

Member 1

Member 2

Current Population

Crossover Example

Two coefficient sets (members) selected to cross over

A coefficients

B coefficients

Member 1

Member 2

Current Population

Crossover Example

Random crossover points selected for A and B coefficients

A coefficients

B coefficients

Member 1

Member 2

Crossover Example

Range of coefficients to be exchanged between members

A coefficients

B coefficients

Member 1

Member 2

Crossover Example

Coefficients exchanged

A coefficients

B coefficients

Member 1

Member 2

Crossover Example

Offspring as a result of crossover

A coefficients

B coefficients

Member 1’

Member 2’

Crossover Example

Offspring join new population

New Population

A coefficients

B coefficients

Member 1’

Member 2’

Major Differences in Designed GA

Much more specific in order to accommodate multiplierless criteria.

Members represented as power
-
of
-
two decimal numbers as
opposed to binary strings.

Pre
-
emptive removal of unstable members before fitness evaluation
& pervasive stability checking throughout.

Crossover of entire coefficient values as opposed to fractions of
binary strings.

Specified number of fittest members held over to subsequent
generation to prevent fitness regression.

Subdivision of members into numerator and denominator coefficient
subsets (B and A coefficients, respectively).

GA Output
-

Generic

Ideal High
-
pass filter:

2000 Iterations

10
th
-
Order

Mutation Probability = 0.001

Magnitude Frequency Response

Relative Error of Fittest
Member vs. Iteration

GA Output
-

Generic

Ideal High
-
pass filter:

15000 Iterations

50
th
-
Order

Mutation Probability = 0.001

GA Output
-

Blurring

Blurring (Low
-
Pass) Filter Parameters:

2000 Iterations

15
th
-
Order

Mutation Probability = 0.001

Magnitude Frequency Response

Relative Error of Fittest
Member vs. Iteration

Magnitude Frequency Response Analysis

Image Analysis
-

Blurring

Blurring (Low
-
Pass) Filter Parameters:

15
th
-
Order

Input bitmap image

Filtered bitmap image

GA Output
-

Canny Edge Detection

Canny Edge Detection (Gaussian) Filter Parameters:

1000 Iterations

10
th
-
Order

σ = 1

Mutation Probability = 0.001

Magnitude Frequency Response,
Gaussian

Relative Error of Fittest
Member vs. Iteration

Magnitude Frequency Response,
Derivative Gaussian

Canny:

An established method for detecting edges in images. Described
by a high
-
pass filter, Gaussian impulse response.

Magnitude Frequency Response Analysis

GA Output
-

Canny Edge Detection

Canny Edge Detection (Gaussian) Filter Parameters:

300 Iterations

10
th
-
Order

σ = 2

Mutation Probability = 0.001

Magnitude Frequency Response, Gaussian

Relative Error of Fittest
Member vs. Iteration

Magnitude Frequency Response Analysis

Image Analysis
-
Canny Edge
Detection

Canny Edge Detection Filter Characteristics:

10
th
-
Order

σ = 1

Input bitmap image

Filtered bitmap image

Image Analysis
-
Canny Edge
Detection

Canny Edge Detection Filter Characteristics:

10
th
-
Order

σ = 1

Ideal Impulse Response, Gaussian

Input bitmap image

Filtered bitmap image

Image Analysis
-

Canny Edge
Detection

Canny Edge Detection Filter Characteristics:

10
th
-
Order

σ = 1

Ideal Impulse Response, Gaussian

Input bitmap image

Filtered bitmap image

Proposed Multiplierless Model

Block Diagram for functional block implementing an IIR difference equation
:

Hardware Implications:
FPGA

Macro
-
cell oriented

Hardware cost is function of word length (n)

Hardware costs (in macro cell counts) for different implementations of 10
th
-
order IIR system.

Word
Length

Multiplier
-
based

Multiplierless

Total Multiplier Cost

Total Cost

Total Shifter Cost

Total Cost

3
rd

Order

10
th

Order

3
rd

Order

10
th

Order

10
th

Order

n = 8

640

2,432

708

2,738

152

458

n = 16

2,560

9,728

2,689

10,322

304

898

n = 24

5,760

21,888

5,892

22,770

456

1,338

Operator

Required Number of Macro Cells

Shifter

n

Multiplier

2n
2

2n

Unit Delay

n

Hardware Implications: ASIC

Application specific design.

Can optimize logic at the gate or transistor
level, as opposed to the macrocell level

Can hard
-
code the coefficients into circuitry
to completely eliminate the need for any
gate logic to perform multiplications.

Multiplier
-
based, fixed ASIC implementation
require a series of shifts and additions to
perform multiplications (equal to # of 1s in
binary coefficient,
J(i)
).

Cost
multiplier
=

+ (18
delay registers
)

Cost
multiplierless
= 18

+ 18
delay registers

10
th

Order ASIC Functional Block Cost:

Hardware Implications: ASIC

Power of 2 coefficient = 0.125

Shift Right 3

.

0

0

1

0

0

0

0

0

1

1

1

0

1

1

0

0

Multiplicand = 234

x(n), 8 bits

.

0

1

0

0

0

0

0

0

0

0

0

1

1

1

0

1

Product/output register: product = 29.25

y(n),16 bits

Wired shift
-
by
-
3 logic.

Wired shift in fixed coefficient ASIC configuration.

Multiplications are constant shifts, so the bit signals of the multiplicand
(input) can be rerouted to effectively realize a wired shift by the amount
specified in the static coefficient.

Rerouted (shifted) input can be sent directly to the output register without
any shift logic or additional clock cycles.

Conclusions

Developed a genetic algorithm with several unique,
application
-
oriented attributes capable of optimizing filter
coefficients such that the corresponding filter

s frequency
response matches that of an ideal system with the constraint
that all coefficients are powers
-
of
-
two and the resulting filter
is stable.

Genetically optimized multiplierless filters consistently yield
comparable image results as their ideal counterparts.

In many cases the multiplierless systems have a definite
advantage in terms of their efficiency while maintaining a
desired response.

In all cases, the multiplierless approach allows for substantial
reductions in hardware cost and computational intensity.

Multiplierless
-
based systems are a viable alternative for
implementing image filters.

Acknowledgements

Professor Michael Rudko

Professor Fran
ç
ois Cabestaing

Professor Cherrice Traver