A Comparison of Deterministic and Stochastic Logic for Image Processing Applications
description
Transcript of A Comparison of Deterministic and Stochastic Logic for Image Processing Applications
A Comparison of Deterministic and Stochastic Logic for Image Processing Applications
Under the guidance ofDr. Kewal Saluja
Presented ByRakesh Roshan Amalraj
Rasika JoshiGayatri Vishwanathan
University of Wisconsin - MadisonDept. of Electrical & Computer Engineering
ECE 753 PROJECT
1
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
Motivation
3
Progressive scalingNecessity 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
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
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
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
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
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
Stochastic Architecture
RANDOMIZE
R
PROCESSING UNIT
DERANDOMIZER
Generate input Stochastic bit stream using LFSRs
9
Schematic Diagram
10
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
Gamma Correction• A popular image processing Technique used to
apply contrast to images.• The operation applied: Vout=A*Vin^(ϒ). Factor
used is usually 0.45• Generally Complex floating point number
Crunching Involved• Hefty N-bit adders, Multipliers, Subtractors
shown in Fig.(b)
12
Results for Gamma Correction
• 4-BIT IMAGE (Bird)
• 8-BIT IMAGE (Lena)
A1 A2 B1 B2
A1 and B1 are deterministic gamma corrected ImagesA2 and B2 are Stochastic Gamma Corrected Images
13
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
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
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
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.
Deterministic Implementation
18
Synthesis shows that stochastic design has less area-delay and power dissipation.
Stochastic design Provides maximum parallelism .
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
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 beforeCases 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 neighboursSelect Lines:A=B=C=0.5
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
Fault Injection
GA MMA CO RRE CT ION
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
Fault Injection (contd.)
Edge Detection and Mean Filtering
Salt and Pepper noises
5%
10%
23
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
25
Results and Discussion (contd.)
GAMMA SSIM PSNRBird (4-bit) Deterministic Stochastic Deterministic Stochasticno fault 0.8797 0.7229 69.8069 66.57786.25% fault 0.8564 0.6783 63.411 64.252512.5% fault 0.8564 0.6891 63.411 63.429820% fault 0.7678 0.6574 60.2854 62.132625% fault 0.7377 0.6574 59.6453 62.1326
Gamma Correction
(c) (d) (e) (f)
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
GAMMA SSIM PSNR LENA (8-bit) Deterministic Stochastic Deterministic Stochasticno fault 0.9897 0.9605 71.5971 75.77346.25% fault 0.9396 0.9619 66.8139 76.307412.5% fault 0.8544 0.9443 63.311 71.693120% fault 0.8458 0.8949 63.0776 68.585525% fault 0.8099 0.8428 62.2828 69.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.
Results and Discussion (contd.)
b) 8-bit Image
27
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
Edge Detection
28
Results and Discussion (contd.)
(a) No Fault (b) 5% Error (c) 10% Error
Mean Filter SSIM PSNRLena Deterministic Stochastic Deterministic Stochasticno fault 0.9956 0.9684 86.3756 73.59255% fault 0.6826 0.6361 75.226 71.278110% fault 0.4849 0.5324 69.7837 72.297815% fault 0.384 0.4288 68.4122 70.2399
Stochastic Mean Filter
Deterministic Mean Filter
Mean Filtering
29
Results and Discussion (contd.)
ApplicationStochastic Deterministic
AreaPower (mW)
Timing (Slack:
2ns Clk) Delay AreaPower (mW)
Timing (Slack:
2ns Clk) Delay
GAMMA 113.95 7.22e-02 0.8 2^N 505.91 0.5368 -0.18 0
EdgeDetection 66.856 2.5559e-02 1.52 2^N 396.37 0.2093 0 0Mean Filtering 12.348 2.1283e-05 1.13 2^N 230.73 8.9428e-02 0.87 0
*N=BitDepth
Hardware Statistics
30
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
Take Away
Table : Overall Comparison of Deterministic and Stochastic Implementation Logic
DETERMINISTIC LOGIC STOCHASTIC LOGIC
More hardware, Greater area Lesser hardware, Lesser Area, enabling parallelism
Not power efficient Power 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
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
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
THANK YOU!
35