International Conference on Information, System and Convergence Applications June 24-27, 2015 in Kuala Lumpur, Malaysia
Hand Gesture Recognition Using Ternary Content Addressable Memory Based on Pattern Matching Technique T. Nagakarthik1 and Jun Rim Choi* School of Electronics Engineering, Kyungpook National University, Daegu, 702-701, South Korea. 1
[email protected] *
[email protected] Abstract—Hand gesture recognition system has received a great attention in the recent few years because of its application and ability to interact with machine effectively by the user. In this paper, we present a hand gesture recognition system using ternary content addressable memory (TCAM) based on pattern matching technique. TCAM is a prominent device in designing network routers, network switches, high-performance processors such as 3D vision processors used in smart phones, portable and multimedia devices which have high demand in the market. Based on this advancement, numerous applications on image processing came into progress. Of all the image processing techniques, gesture detection using image processing is given high priority. Simulations using 65 nm CMOS logic shows TCAM one cell characteristics with its timing analysis and right hand gesture simulation using 4 X 8 TCAM array in which the maximum voltage to which match line (ML) is charged for match and mismatch shows 752 mV and 614 mV respectively. Therefore, we proposed a method using TCAM for pattern matching that can be incorporated for image processing where device characteristics have potential importance.
Keywords-ternary content addressable memory; pattern matching; match line sense amplifier; hand gesture recognition. I.
INTRODUCTION
In General, the memory which can be accessed by its content and not by its address is called as content addressable memory (CAM) which is an outgrowth of random access memory (RAM). CAM is attractive for its critical and shorter search time which is used for many applications. In order to access the content in memories, search data is compared with the stored data in parallel to find the exact match. Binary CAM (BCAM) and ternary CAM (TCAM) are two types of CAM. BCAM is a simple type of CAM in which it can store only two states logic ‘0’ and ‘1’. Whereas, TCAM is a special type of CAM which allows storing and searching ternary states logic ‘0’, ‘1’ and don't care (represented as X). The additional don't care state is used for the partial matching either for logic ‘0’ or ‘1’ [1].
TCAM consists of 2 SRAM cells and a comparator. Search data is given through the search line pair namely search line and search line bar (SL, SLB) [3]. SEARCH DATA REGISTER
WLk
SL
SLB
Vdd
Vdd
P
P
N
P
P
P
P
Vdd
Vdd
P
P
N
MLSOk
TCAM CELL
TCAM CELL
TCAM CELL
TCAM CELL
WL3
MLSO2
TCAM CELL
TCAM CELL
TCAM CELL
TCAM CELL
WL2
E N C O D E R
MLSO
MLSO1 TCAM CELL 1
TCAM CELL 2
TCAM CELL 3
TCAM CELL n
BL2
Figure 2. Block diagram of k-word x n-bit TCAM array.
N N
BLB1
TCAM CELL
Storage Part
N
WL
TCAM CELL
WRITE AND READ REGISTER
ML
N N
TCAM CELL
MLSO3
WL1
Storage Part
TCAM CELL
N
WL
BLB2
Comparison Logic
Figure 1. Schematic of 16T conventional ternary CAM
TCAM is a specialized type of high speed associative memory that searches its entire content against the preloaded stored data in single clock cycle at a wire speed. It is capable of high speed parallel search operation, large storage capacity and low power consumption due to its fast parallel processing capability [2]. A typical TCAM design can execute the following operations: read, write, compare, masked write and masked compare. Figure 1 shows the schematic of 16T conventional TCAM with storage memories and comparator circuit. A conventional
Figure 2 shows the conceptual view of TCAM array. A typical TCAM cell array consists of ‘k’ words. Each word contains of ‘n’ bits and a mask bit which indicates whether the match signal of the particular word is valid or invalid. All the TCAMs in a row share a match line (ML), word line (WL), and in column it shares search lines (SLs) and bit lines (BLs). Partial matching in TCAM results in multiple match and mismatch detections. In search operation, search data is given to all the SLs and each cell of TCAM compares its stored data against the search data. ML remains at high state if the data gets match or else ML discharges to ground for mismatch [4]. The rest of the paper is organized as follows: Section 2 represents background of the pattern matching and Section 3 shows the proposed work for hand gesture recognition, Section 4 shows the performance analysis of TCAM one cell and hand gesture based pattern matching.
International Conference on Information, System and Convergence Applications June 24-27, 2015 in Kuala Lumpur, Malaysia II.
RELATED WORK
The evolution of computer technology has enabled many practical applications based on pattern matching (PM) which is a crucial technique in digital image processing. It requires high scan rate in order of gigabytes to scan the entire image by evaluating the distance between the patterns [5]. By employing TCAM, we can improve the performance of the system and it also supports motion detection, long patterns, short patterns and pattern correlation which requires high scan rate up to multi gigabytes. Generally PM is divided into categories like software and hardware based pattern matching. The most prominent software based PM techniques only in algorithms are Aho-Corasick (AC) and Commentz-Walter (CW) designed for multiple PM and Knuth-Morris-Pratt(KMP) and Boyer-Moore (BM) designed for single PM [6]. All these algorithms build a finite mechanism which can process the incoming patterns and also increases the performance of pattern scan. Although both the algorithms are fast they suffer from exponential state explosion which cost too much of area [7]. Hardware based PM technique resolves the performance issue of the software based PM. Research in hardware based has been directed in two directions: firstly design of efficient data structures for fast memory access, secondly design of high throughput algorithms [7]. In hardware based PM technique, CAM or TCAM and bloom filter with co-processor as a main hardware component are used. We adopt TCAM and SRAM to implement our proposed pattern matching technique for hand gesture recognition. TCAM is used to scan the existing stored pattern with the incoming pattern at a wire speed. It scans the entire pattern at multi gigabyte rates and returns the required information to SRAM and FPGA. It also increases the performance of the PM due to its parallel processing capability. III.
TCAM BASED PATTERN MATCHING
In general, memories like DRAM, Flash memory and SRAM search their data with address but CAM or TCAM search with data not by address. TCAM is a special type of memory which performs parallel search operation at high speeds. The don't care state in TCAM can be used for matching variable prefix in IP address which is used in IP lookups [8]. Several systems use TCAM based PM because they are scalable, have high throughput and easy to implement. TCAM based PM also suffers from high power consumption, low speed and high cost. TCAM arrays have been designed for high speed pattern recognition machines and also have extensive memories which can able to search information in one clock cycle. A set of patterns has been stored as data in the array and the input pattern is used as a search data as shown in Fig 3. The input pattern compares with all the existing stored pattern in parallel and if any exact match is obtained with the input pattern then corresponding outline is activated and the result is displayed as match.
Figure 3. TCAM based pattern matching technique.
A. Working Suppose let the width of the TCAM be ‘n’ bytes. The width ‘n’ of the pattern can be different from one pattern to other pattern. If the pattern length is shorter then we store it with don't care state (represented as X) bits. Patterns are arranged in array according to their lengths because to identify all the multiple matching patterns. If we arrange the patterns in reverse order, then we may miss some of the matching results. The process for finding the patterns is as follows: the ‘n’ bytes are mapped into TCAM array as shown in Fig.3. If the input pattern gets matched with stored pattern then it will report as match otherwise mismatch. This process is repeated until the input pattern search the entire stored pattern.
B. Hand Gesture Recognition
Figure 4. Hand gesture detection based on pattern matching
Now a days touch screen devices are increasing the popularity that demands the better image processing techniques of which hand gesture recognition is critical. In Fig. 4, for each pixel an address is assigned for the entire hand gesture. So, when the sensor on the device recognize the hand gesture then it search the entire pixels for the matching gesture. Based on this application, we implement different hand motions using TCAM based on PM technique. In our work, the implementation of TCAM based pattern matching technique for hand gesture recognitions is as follows: when a hand gesture is recognized by the sensor on a particular device, it scans the entire array at a wire speed for the matching pattern. If the pattern gets matched then output is activated and result is displayed on the device. Similarly, if the input pattern gets mismatch then output is deactivated and no result is displayed on the device. Figure 5 represents some of the various types of hand gestures like swipe right, swipe left, swipe up, swipe down, zoom in, zoom out, rotate left, rotate right which can be applicable for various applications.
In our work, we simulated swipe right hand gesture detection using 4 x 8 TCAM array. We also simulated TCAM one cell to figure out the characteristics and its timing analysis using 65 nm 1.2 V CMOS logic. Since our TCAM size is different we performed comprehensive simulations to evaluate various aspects of the TCAM. The simulation results for TCAM one cell and hand gesture recognition using 4 X 8 TCAM array are simulated in cadence spectra. This work also focuses on enhancing the performance of search speed, search power for fast detection of hand gesture and low power consumption. A. TCAM Characteristics The performance of the TCAM one cell is evaluated by characterizing all the analysis of the cell. We simulated TCAM one cell to find various characteristics of the cell like area, noise tolerance, match time and power consumption which are tabulated in the Table 1. Noise tolerance is defined as the difference between the match and mismatch voltages. TCAM is a special type of memory that can able to search multiple patterns at a high speed rate simultaneously. Timing analysis is done in three phases: precharge phase, test-charge phase and selective charging phase which is represented as 1st, 2nd and 3rd phases respectively as shown in Fig 6. Firstly in precharge phase, match lines are precharge to Vdd. Secondly in test-charge phase MLs are charged to Vdd until the ML approaches the sensing transistor and power consumption in this phase is low. Finally in selective charging phase, charging to all match lines except the fully matched ML and the matched ML is charged to Vdd. So the time taken in selective charging phase by the MLSO is 1.2 ns and mismatched ML discharges to ground. TABLE I. TCAM ONE CELL CHARACTERISTICS FEATURES
VALUE/RESULT
Process Technology
65 nm
Configuration
TCAM one cell
Supply Voltage
1.2 V
Nosie Tolerance
165 mV
Power Consumption
392 µW
Match Time
1.2 ns
Area
15 X 16 µm2
1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0
T1X (V) T2X (V)
1
Stored pattern 0
1st phase
SL1 (V)
3rd phase
2nd phase
SLB1 (V)
MLSO1 (V) ML1X (V)
Match Mismatch
MLRST (V)
Matchtime 0
2
4 Time (ns)
6
8
Figure 6. Simulations of TCAM one cell.
B. Hand Gesture simulation TCAM based PM technique for hand gesture detection mainly depends on two scenarios, timing and the pattern stored for a particular gesture. Timing analysis is described in previous section. Figure 7 represents the pattern stored for swipe right hand gesture in the TCAM array. If the input pattern gets matched with existing stored pattern in the TCAM array then ML charges to maximum voltage and output is activated at match line sense output (MLSO). Similarly, if the input pattern gets mismatch then ML discharges to ground and output is deactivated. When there are multiple matches for the given input pattern, then TCAM reports only the first match. Since, we use ternary states of the TCAM for memory optimization, the order in which the pattern has stored in TCAM executes the multiple matches. Figure 8 shows the simulations of swipe right hand gesture. When the hand is swiped from left to right on the device it checks the entire stored pattern for the matching pattern. Based on the simulation results it clarifies that input pattern gets matched at MLSO3 by charging the ML to maximum voltage according to our PML. Remaining all the MLSOs discharges to ground due to mismatch with the input pattern. The maximum voltage to which ML is charged for match and mismatch is 752 mV and 614 mV respectively. Table II represents the analysis of swipe right hand gesture. INPUT PATTERN
10011001 STORED PATTERN
SIMULATION RESULTS
Voltage (V)
IV.
Voltage (V)
Figure 5. Different types of hand gestures.
Voltage (V)
Voltage (V)
Voltage (V)
International Conference on Information, System and Convergence Applications June 24-27, 2015 in Kuala Lumpur, Malaysia
01111110 00101000 10011001
MATCH
10001000
Figure 7. Pattern stored in the TCAM array
Voltage (V)
Voltage (V)
Voltage (V)
Voltage (V)
International Conference on Information, System and Convergence Applications June 24-27, 2015 in Kuala Lumpur, Malaysia 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 30
MLSO1 (V) net0161(V)
Mismatch
ML-Mismatch
MLSO2(V) net0159 (V)
Match
MLSO3 (V) net0157 (V)
ML-Match
MLSO4 (V) net0147 (V)
35
40
45
CONCLUSION In this paper, we presented a hand gesture using TCAM based on pattern matching technique with high operating frequency search operation and also verified TCAM one cell characteristics and its timing analysis. Implementation of TCAM one cell using prominent 6T SRAM cells and 4 x 8 TCAM array for swipe right hand gesture using PM technique is done. Simulations using Samsung 65 nm CMOS technology shows, for swipe left hand gesture the input pattern gets matched with stored pattern at MLSO3 by charging ML to the maximum voltage and remaining all the MLSOs gets mismatched by discharging ML to ground. The proposed work offers an excellent performance to the important parameters like speed, power and area. The recognition of hand gesture based on pattern matching technique can be used in many applications like smart phones, multimedia, portable devices and also in high performance processors with some minor modifications. TCAM continues to be a prominent choice for many intensive applications.
50
ACKNOWLEDGMENT
Time (ns)
Figure 8. Simulation result for swipe right hand gesture. TABLE II. ANALYSIS OF SWIPE RIGHT HAND GESTURE
MLSO1
Stored Pattern 01111110
-
614 mV
MLSO2
00101000
-
614 mV
MLSO3
10011001
MATCH
752 mV
MLSO4
10001000
MLSO
Input Pattern 10011001
Match
Voltage
614 mV
This work was supported by the Korea Science and Engineering Foundation (KOSEF) grant funded by the Korean Government (MOST) (No. 2013R1A1A4A0102624) and Kyungpook National University Research Fund 2012. REFERENCES [1]
[2]
C. Layout In order to substantiate the above mentioned simulation results, we implementaed TCAM one cell and TCAM array of size 4 X 8 on a test chip (5mm X 5mm). TCAM array consists of 4 words, which contains 8 bits. The 8 bit portion of each word is arranged in an array of 4 X 8 cells and all the words are connected to each of the MLSA shown in Fig. 9. One cell TCAM is also implemented in this chip for testing the various characteristics of the TCAM cell. The test chip was fabricated in samsung 65 nm CMOS technology. Table 4 represents the overview of the chip.
[3]
[4]
[5]
[6] [7]
TCAM ONE CELL
Figure 9. Layout of TCAM array with TCAM one cell.
[8]
K.Pagiamtiz and A.Sheikholeslami, “ Content-Addressable Memory (CAM) Circuits and Architecture: A Tutorial and Survey,” IEEE J. Solid-State Circuits, vol. 41, pp. 712–727, 2006. N.Mohan, W.Fung, D.Wright, and M.Sachdev, “Design Techniques Test Methodology for Low-power TCAMs,” IEEE Trans. Very Large Scale Integr. (VLSI) Syst, vol. 14, pp. 573– 586, 2006. N.Mohan and M.Sachdev, “Low-Leakage Storage Cells for Ternary Content Addressable Memories,” IEEE Trans. Very Large Scale Integr. (VLSI) Syst, vol. 17, pp. 604–612, 2009. I.Hayashi, T.Amano, N.Watanabe, Y.Yano, Y.Kuroda, M.Shirata, K.Dosaka, N.Noda and H.Kawai, “A 250-MHz 18-Mb Full Ternary CAM With Low-Voltage Match line Sensing Scheme in 65nm CMOS,” IEEE J. Solid-State Circuits, vol. 48, pp. 2671–2680, 2013. Hoang Le and Viktor K. Prasanna, “A Memory-Efficient and Modular Approach for Large-Scale String Pattern Matching,” IEEE Trans. Computers, vol. 62, pp. 844–857, 2013. G.A Stephen, “String searching Algorithms Amplifier,” Lectures Notes Series on Computing, vol. 3, 1994. F.Yu, R.H.Katz and T.V.Lakshman, “Gigabit Rate Packet Pattern Matching Using TCAM,” Proceedings of the 12th IEEE International Conference on Network Protocols (ICNP-04), pp. 174–183, 2004. M.Fish and G.Varghese, “Fast Content-Based Packet Handling for Intrusion Detection,” UCSD technical report CS2001-0670, 2001.