A Comparison of Deterministic and Stochastic Logic for Image
Processing Applications Under the guidance of Dr. Kewal Saluja
Presented By Rakesh Roshan Amalraj Rasika Joshi Gayatri
Vishwanathan University of Wisconsin - Madison Dept. of Electrical
& Computer Engineering ECE 753 PROJECT 1
Slide 2
Outline Motivation Introduction to Stochastic Logic Relevance
in Real Time Signal Processing Stochastic Architecture Analysis for
Gamma Correction Analysis for Edge detection Architecture for Mean
filter Fault Injection Methods Results and Discussion Conclusion
and Future Work 2
Slide 3
Motivation 3 Progressive scaling Necessity for Fault tolerance
especially in Real-Time applications Continuing downscaling of IC
design calls for power efficiency Need for hardware with smaller
area Increasing need to meet timing requirements at a high rate of
accuracy Existing methods -> ECC and hardware redundancy
Slide 4
Why Stochastic Computing??? Randomness->valuable resource
Convert probability values into another - statistical bit stream
Compared to Deterministic computing, lacks place value -> no MSB
and LSB Computation is robust 4
Slide 5
SC and real time image processing can handle image intensities
and probabilities with good noise tolerance. SC supports massive
parallelism. Hardware cost is less Outperforms binary computing in
processing tasks involving stored images. High fault tolerance 5
Stochastic for Image Processing Applications
Slide 6
How does it work really? 6 The interpretation of Digital logic
Blocks is considered differently: Egs- A mux can be a scaled adder,
an AND gate can be a multiplier, OR gate an adder and so on
Slide 7
Not every input can be represented in a probabilistic bit
sequence The range of inputs should be within [0,1] and the outputs
should fall in same interval To accommodate inputs greater than 1,
they are generally scaled by a factor to bring them within [0,1]
interval. Any polynomial function can be represented in Stochastic
logic-only if coefficients lie between [0,1] or else they are
converted to Bernstein Polynomials: 7
Slide 8
Continued Non polynomial functions such as trigonometric
functions etc. can be converted using the Bernstein Approximation:
But for our designs we merely use approximated versions of the
Bernstein Coefficients to suit the application. 8
Slide 9
Stochastic Architecture RANDOMIZERPROCESSING UNIT Processing in
SPE- Stochastic Processing Element DERANDOMIZER Mapping bit
sequence to output Generate input Stochastic bit stream using LFSRs
9
Slide 10
Schematic Diagram 10
Slide 11
Modus operandi: MATLAB Image procured was converted into N*N
matrix Values were converted to Binary,scaled and bit- widths
adjusted VERILOG Design of Stochastic and Deterministic Modules
Implementation of TestBench for input extraction and feeding
through Processing units MATLAB Processing output file and
converting it to Image Derive results based on PSNR and SSIM
11
Slide 12
Gamma Correction A popular image processing Technique used to
apply contrast to images. The operation applied: V out =A*V in ^(
). Factor used is usually 0.45 Generally Complex floating point
number Crunching Involved Hefty N-bit adders, Multipliers,
Subtractors shown in Fig.(b) 12
Slide 13
Results for Gamma Correction 4-BIT IMAGE (Bird) 8-BIT IMAGE
(Lena) A1 A2 B1B2 A1 and B1 are deterministic gamma corrected
Images A2 and B2 are Stochastic Gamma Corrected Images 13
Slide 14
Edge Detection An edge in an image is a significant local
change in the image intensity. Typically occurs on the boundary
between two regions in an image. 14
Slide 15
What Causes Intensity Changes? Geometric events Surface
orientation (boundary) discontinuities Depth discontinuities Color
and texture discontinuities Non-geometric events Illumination
changes Specularities Shadows Inter-reflections 15
Slide 16
Image to Edge map Important features can be extracted from the
edges of an image (e.g., corners, lines, curves). These features
are used by higher-level computer vision algorithms (e.g.,
recognition). 16
Slide 17
Stochastic Implementation 17 The edge detection implementation
is based on the Robert Cross Algorithm. Uses Parallel Processing to
deal with the every pixel of the input matrix.
Slide 18
Deterministic Implementation 18 Synthesis shows that stochastic
design has less area-delay and power dissipation. Stochastic design
Provides maximum parallelism.
Slide 19
Mean Filter or Smoothing Filter MEAN filter computes the
average of the neighboring pixels of every pixel in the image
matrix and performs a smoothing effect that would render certain
types of noises ineffective. 19
Slide 20
Mean Filter Architecture 20 Deterministic Implementation would
require many adders and a multiplier In stochastic domain MUXes can
function as a scaled adders as shown before Cases to be considered:
a) Image pixels in the four corners were given only 3 neighbors. b)
Image pixels in the last row were given an accommodation of
4neighbors. c) Image pixels well into the matrix were given a
maximum of 8 neighbors. d) Image pixels in the last column of each
row of the matrix were assigned 4 neighbors. Inputs would be 8
pixel neighbours Select Lines: A=B=C=0.5
Slide 21
21 Fault Injection Methods Fault injection was done for all
three applications Gamma Correction, Edge Detection and Mean
Filtering to compare the fault tolerance capabilities of the
Deterministic and Stochastic logic Two types of Faults were
introduced: Soft Errors (Random Bit Flips ) Salt & Pepper Noise
in Images
Slide 22
Fault Injection GAMMA CORRECTION Deterministic Logic Bit flips
in the pixel using XOR 6.25% 12.5% 25% Stochastic Logic Bit flips
introduced in the randomized bit sequence 6.25% 12.5% 25% 22
Slide 23
Fault Injection (contd.) Edge Detection and Mean Filtering 5%
10% Salt and Pepper noises 23
Slide 24
Problems faced IMPLEMENTATION DETAILS: Implemented of hardware
modules : Verilog HDL Simulations and Introduction of Bit Flip
Faults : ModelSim Synthesis : DesignVision Pre-processing of input
images, Processing of the simulation outputs to Images, Salt &
Pepper fault-injection and obtaining PSNR and SSIM Index : MATLAB
METRICS USED TO ASSESS FAULT-TOLERANCE : PSNR: Peak Signal to Noise
Ratio value is in dB and a PSNR of 50-70dB is considered a good
image. SSIM: Structural SIMilarity index measures the similarity
between two images. It is a quality measure of one of the images
being compared, with the other image as reference. An SSIM index of
1 implies the two images are equal and any value above 0.7 is
considered a decent quality image. 24 Results and Discussion
Problems faced 26 Results and Discussion (contd.) a) Original
Lena (8 bit Image) and b) Gamma Corrected through Matlab (c) (d)
(e) (f) (g) Stochastic Gamma Correction Deterministic Gamma
Correction (a) (b) Figure 10: 4bit Bird Image Gamma Corrected: (c)
No Fault (d) 6.25% fault (e) 12.5% fault (f) 20% fault (g) 25%
fault GAMMASSIMPSNR LENA
(8-bit)DeterministicStochasticDeterministicStochastic no
fault0.98970.960571.597175.7734 6.25%
fault0.93960.961966.813976.3074 12.5%
fault0.85440.944363.31171.6931 20% fault0.84580.894963.077668.5855
25% fault0.80990.842862.282869.1365 Table 2: Comparison of SSIM and
PSNR for Stochastic and Deterministic Implementations of Gamma
Correction for 8bit Image and below, graphs representing the data
given above.
Slide 27
Results and Discussion (contd.) b) 8-bit Image 27
Slide 28
Results and Discussion (contd.) Stochastic Edge Detection
Deterministic Edge Detection (a) No Fault (b) 5% Salt&Pepper
(c) 10% Salt&Pepper Figure 12: Edge Detection for Lena 8bit
Image 28
Slide 29
Results and Discussion (contd.) (a) No Fault (b) 5% Error (c)
10% Error Mean FilterSSIMPSNR
LenaDeterministicStochasticDeterministicStochastic no
fault0.99560.968486.375673.5925 5% fault0.68260.636175.22671.2781
10% fault0.48490.532469.783772.2978 15%
fault0.3840.428868.412270.2399 Stochastic Mean Filter Deterministic
Mean Filter 29
Slide 30
Results and Discussion (contd.) Application
StochasticDeterministic Area Power (mW) Timing (Slack: 2ns
Clk)DelayArea Power (mW) Timing (Slack: 2ns Clk)Delay
GAMMA113.957.22e-020.82^N505.910.5368-0.180
EdgeDetection66.8562.5559e-021.522^N396.370.209300 Mean
Filtering12.3482.1283e-051.132^N230.738.9428e-020.870 *N=BitDepth
30
Slide 31
Conclusion (Summary) We have studied the functioning,
advantages and disadvantages of Stochastic Logic versus
Deterministic Logic Carried out hardware implementation of Image
Processing applications, such as Gamma Correction, and Edge
Detection in Stochastic and Deterministic Logic Proposed a simple
yet effective design for implementing an Averaging or Smoothing
Filter in Stochastic Logic and compared its performance Injected
Faults and compared the Fault tolerance capabilities for Image
Processing applications using the SSIM and PSNR metrics 31
Slide 32
Take Away Table : Overall Comparison of Deterministic and
Stochastic Implementation Logic DETERMINISTIC LOGICSTOCHASTIC LOGIC
More hardware, Greater areaLesser hardware, Lesser Area, enabling
parallelism Not power efficientPower reduction is by the thousands
Clock and reset signals for combinational logic not required Clock
and Reset required for every logic block (due to Randomizer and
Derandomizer (R&D)) Hence, susceptible to clock jitter and skew
Comparatively slower Can be clocked at very high frequencies
(critical path is very small), but Delay due to R&D Widely
used, easy to implement any functionality and well tested Best
suited for limited applications with bounded input -output
ranges.Application to real time signal processing Speech/Control
signals not yet explored 32
Slide 33
Future Work Tackle the overhead of delay introduced by
randomizing and derandomizing the input and output signals
Efficient use of the randomizer and derandomizer modules to further
reduce area are of top priority. Explore more critical applications
such as control signals or avenues such as audio signal / speech
processing, apart from Image Processing applications. Expand the
possible range of functions that can be implemented through
Stochastic Logic Stochastic Logic can offer a paradigm shift in
digital circuit design and if not escape the power wall, at least
delay it 33
Slide 34
References Main References Weikang Qian; Xin Li; Riedel, M.D.;
Bazargan, K.; Lilja, D.J., "An Architecture for Fault-Tolerant
Computation with Stochastic Logic," Computers, IEEE Transactions
on, vol.60, no.1, pp.93,105, Jan. 2011 Alaghi, A.; Cheng Li; Hayes,
J.P., "Stochastic Circuits for Real-Time Image-Processing
Applications," Design Automation Conference (DAC), 2013 50th ACM /
EDAC / IEEE, vol., no., pp.1,6, May 29 2013-June 7 2013 Li, Peng,
and David J. Lilja. "Using Stochastic Computing to Implement
Digital Image Processing Algorithms." Computer Design (ICCD), 2011
IEEE 29th International Conference on. IEEE, 2011. 34