Chapter 4 CNN-Based Texture Boundary Detection
4.4 CNN-Based Distance and Threshold Algorithm
4.4.2 Threshold Processing
CNN-based threshold processing is based on original threshold processing, but has a little difference as shown in Fig. 15. The CNN-based threshold processing will pull down the value as shown in Fig. 15 (b). The original value which is larger than Ith will subtract Ith, and the original value which is smaller then Ith will be pulled down to zero.
The first step of CNN-based threshold processing is set the following parameters, and we can shift the image down to cut off what we don’t want of image and retain what we want.
A = [0]; B = [1]; I= -(1+Ith); INPUT = input; output1 = OUTPUT And then by setting the following parameters, we can shift up the minimum value of image to zero.
A = [0]; B = [1]; I= 1; INPUT = output1; output2 = OUTPUT Finally, the difference between two threshold processing is not a large effect because we can enhance the image and the images will be very similar to each other.
The modified TBD is somewhat different from the original TBD. We modify the threshold processing and ignore the local maximum detection after threshold processing of original algorithm proposed in Chapter 3 because these functions are difficult to be implemented by the current-mode CNN circuit.
Fig. 15: The relation of image value changing between before and after threshold processing on (a) original algorithm and (b) CNN-based algorithm.
Ith Ith
before threshold processing
after after
before threshold processing
Slope = 1 Slope = 1
(a) (b)
Chapter 5
Design of Application-Driven CNN Circuits
We shall implement CNN-based TBD algorithm proposed in Chapter 4 with analog current-mode circuits and simulate the designed circuit with HSPICE.
5.1 Architecture of CNN-Based Texture Boundary Detection
According to the proposed algorithm and based on the processing element in Fig. 18, the system architecture of the analog circuit for the CNN-based TBD is constructed here. The circuit system is a conceptual block diagram of an analog computer shown in Fig. 16. It consists of the 16×16 CNN array with templates, the analog absolute value circuit, and the summation unit. To reduce design complexity and die size for sophisticated process technology in our experiment, a programmable current-mode CNN array is designed, and every current-mode CNN array shown in Fig. 16 can be replace by the programmable current-mode CNN array with different template A, B and threshold I. Of course, the CNN size can be increases in real production depending on the tradeoff between required real-time rate and cost for various applications.
The activity of the system is divided into four main function, Gabor filter, Gaussian filter, distance, and threshold, as described in Fig. 16. At
first, a digital image is transferred by DAC function to currents and fed into the network as input values in CNN array. These currents are defined positive and assigned to the positive part of the CNN sigmoid function.
The network then performs the Gabor filters with four orientations (four kinds of template A). Here we will obtain the results with both positive and negative values in the steady state and the results are fed into the analog absolute value circuits. After that, the results become all positive values and fed into Gaussian filters with the same templates. The results of the Gaussian filters are all positive values and then fed into distance units with the same templates. We will feed results of distance units into analog absolute value circuits one more, and get positive results. The network then performs the summation units implemented by connecting results of five absolute value units pixel by pixel to new results of a new array (because of current-mode). Finally, the network feeds the results of summation units and a threshold value Ith which is the mean of these results to threshold units with the same templates.
To realize the whole analog circuit efficiently, we modify the Eq.
(2-1) to a new current-mode equation as following,
( ) ( )
, ; ,( )
, ; ,( )
,and design a single current-mode CNN neural cell in Fig. 17 which shows the schematic view of the modified single neural element (cell). The input current to the cell can be set continuously within the range limited by the unit current. This will result in the nonlinear function for iyij (t) shown in Fig. 17. The sigmoid function is realized by using two-level shifted current mirrors connected in series. The saturation levels of the sigmoid with slope set as 1 are determined by the current source IL. This piecewise approximation of symmetric current limiting with cascaded current mirrors has been used effectively in other implementations [6], but most
of implementations are applied for binary image processing only.
In addition, a single cell includes the neuron cell unit, the template A unit, and the template B unit shown in Fig. 17. The neural cell unit for the proposed algorithm must contain two input nodes. To obtain negative template coefficients in the current-mode design, both the template A and B units contain one current inverter in our design and the details will be described in following section. The correct cell activities are regulated by the switches within the single cell circuit, whose functionalities are listed in Table 2.
Table 2 : Functionalities of the switches in the schematic circuit in Fig. 17.
Logic Switch
High Voltage (3.3V)
Low Voltage (0V)
Vac Normal operation Initial phase
Vtap Choosing positive template A Choosing negative template A Vtbp Choosing positive template B Choosing negative template B
Fig. 16: The block diagram of the CNN-based TBD.
Fig. 17. Schematic circuit of a single CNN cell with fixed templates design.
5.2 Basic Processing Element (CNN Cell)
To achieve acceptable resolution with standard procedures, a current- mode CMOS realization of CNN has been proposed in [6]-[9], which was adapted from the implementation in [1]. Based on this design, a generic model of one CNN cell with the current-mode architecture is shown in Fig. 18, where xc, uc, zc, and yc are the cell state, input, bias and output variable in continuous time. Note that this circuit model is identical to the model given by Eq. (2-1). The model consists of the dynamic block, the nonlinear block, and the weighted block. The dynamic block is composed a continuous time integrator loaded with a bias shifted current mirror. The nonlinear block can determine the output transfer function using the current-mirror rate. A current-mode output characteristic is described in [6]. Note that weighted replication is performed at the output current of each cell. In other words, each cell generates a different output, with the specific weights as A and B indicating the template A and B, for each neighbor.
Fig. 18: Architecture of a generic current-mode CNN cell, where xc, yc, uc, and zc indicate the state, output, input, and bias.
The Simulated output currents of the current-mode sigmoid
6µA, and 4µA are shown in Fig. 19. The slope of simulated sigmoid functions is set to 1. Only positive coefficients are achieved due to the positive feedback network. The realization of negative coefficient values is obtained by connecting the current through a current inverter.
(a) (b) Fig. 19: Simulated sigmoid functions (slope=1) with HSPICE. (a) Positive and
(b) negative slopes in different current gains through a current inverter.
5.3 Templates Design
We now introduce the realization of required CNN templates in the current-mode design. Through a transistor ratio, a positive template value can be obtained as shown in Fig. 20 (a). To generate negative template values, a current inverter is cascaded to the transistor ratio as shown in Fig. 20 (b). To add image input with template A unit to become template B unit, the image input unit as shown in Fig. 20 (c) is needed. The position of a current source inspires the direction of output current. With these template units, we design a 5x5 large neighborhood CNN array with a neuron cell unit [15]-[17], 24 template A units, and 25 template B units per cell. In addition, the threshold I can be easily implemented by adding a single current source to the input of the neuron cell unit as shown in Fig.
17 and the implementation of initial state is like the threshold I. The
difference is that the initial state turns on just for a whole and can be different from other initial states of different cells.
Fig. 20 (d) shows a programmable current amplifier [18] with changing the Vvalue and Ibias. The architecture of the CNN-based TBD contains many CNN arrays with different parameters and to replace fixed templates with programmable templates to be a programmable CNN array is necessary.
(a) (b) (c)
(d)
Fig. 20: Template realization in the circuit of CNN-based TBD, where (a) is for positive output, (b) is for current inverter, (c) is for the image input unit, and (d) is for the programmable current amplifier.
5.4 Boundary Selection
The boundary conditions [19] are defined by the border cells which surround the active grid. Any virtual variable in i must be specified via
Mbin
iuij (t) Ai,j;k,l.iykl (t)
(1:1)
boundary conditions, of which the most commonly used are for 5×5 neighborhood. Excepting 16×16 cells, the central 8×8 cells are the real array of the image, and the others cells are the boundary cells. The boundary conditions in our design are like padding processing, but are the extending of the central 8×8 cells. The width of the boundary cells depends on the size of the Gaussian filters. The real boundary conditions outside the 16×16 cells can be considered as fixed, zero-flux, and dynamic boundary conditions, respectively [20]. However, the reasons why we choose the zero-flue condition as the boundary condition are due to no input in our algorithm and the natural definition ( no cells, no inputs).
Chapter 6
Experimental Results
6.1 CNN-Base Texture Boundary Detection
The parameters of CNN arrays for CNN-based Gaussian filters is described as following,
and the impulse response of these CNN arrays is shown in Fig. 21
Fig. 21: The impulse response of the CNN-based TBD
The impulse response is not exactly a Gaussian function, such that the results of the CNN-based TBD are different from the results of the modified TBD as shown in Fig. 22.
1 9 15 9 1
9 15 18 15 9 0 1 0
15 18 20 18 15 1 1 1 , I =0,
9 15 18 15 9 0 1 0
A = 1 289i
1 9 15 9 1
, B = 13 10 i
(a) (b)
Fig. 22: (a) Results of the modified Gaussian filters. (b) Results of the CNN-based Gaussian filters.
The results in Fig. 22 (a) are similar to Fig. 22 (b) but not exactly the same. Because the differences between (a) and (b) exist, the results of distance processing and threshold processing after modified Gaussian filters and CNN-based Gaussian filters will be much different as shown in Fig. 23. There are more results of different inputs shown in Fig. 24 and Fig. 25.
0°
45°
90°
135°
Fig. 23: This demonstrates the results of both modified and CNN-based TBD.(a)input;
(b) and (c) show the results before and after threshold processing of modified TBD. (d) and (e) show the results before and after threshold processing of CNN-based TBD.
Fig. 24: This demonstrates the results of both modified and CNN-based TBD.(a)input 2; (b) and (c) show the results before and after threshold processing of modified TBD.
(a)
(b) (d)
(c) (e)
(a)
(b) (d)
(c) (e)
TBD.
Fig. 25: This demonstrates the results of both modified and CNN-based TBD.(a)input 3; (b) and (c) show the results before and after threshold processing of modified TBD.
(d) and (e) show the results before and after threshold processing of CNN-based TBD.
6.2 Application-Driven CNN Circuit
Based on the analog circuit implementation described in Chapter 5, we design a 16×16 CNN array to simulate the CNN-based TBD on Hspice. This chapter will show the comparisons between simulation results of MatCNN and that of Hspice, but the image size is only 16×16 which is much smaller than image size using in original algorithm.
Therefore, new images with texture of 16×16 size is created and then fed into CNN-based TBD both on MatCNN and Hspice, and the parameters of CNN arrays for CNN-based TBD is designed to be the same as the parameters of CNN arrays for CNN circuit.
Because the size of Gaussian filters changes for 16×16 size, the (a)
(b) (d)
(c) (e)
parameters of the CNN-based Gaussian filters have to redesign, but the others parameters do not have to change. The parameters of the Gaussian filters for 16×16 size is described as following,
and the impulse response of CNN-based TBD is shown in Fig. 26.
(a) (b)
Fig. 26: 16×16 CNN array. (a) shows the 3-D impulse response and (b) shows the cut-plane of (a).
The impulse response is similar to a Gaussian function, and the results of the CNN-based TBD are shown in Fig. 27. The input in Fig. 27 (a) is 16×
16, and so are Fig. 27 (d) and (e). Because of the boundary cells, the real images after Gaussian filers are 8×8 as shown in Fig. 27 (f). The final result shown in Fig. 27 (c) is also 8×8.
CNN-based Gaussian filter for CNN circuit has to use the template A.
Based on the properties of template A, the dark current in CNN circuit has
1 9 15 9 1
9 15 18 15 9 0 1 0
15 18 20 18 15 1 1 1 , I =0,
9 15 18 15 9 0 1 0
A = 1 400i
1 9 15 9 1
, B = 1 20i
decrease the effect. The offset current can be replaced by the threshold I, and the optimal value of threshold I in this case is 0.2 µA.
(a)
(b)
(c) (d) (e) (f)
Fig. 27: This demonstrates the results of CNN-based TBD.(a)input; (b) and (c) show the results before and after threshold processing. (d) shows the results of Gabor filters, and (e) shows results of rectifier processing after (d). (e) shows the results of Gaussian filters
Except the threshold I (0.2µA), the other parameters for CNN circuits are the same. The results of channel one Gabor filter for CNN circuits are shown in Fig. 28, and are very similar to the results for CNN-based TBD as shown in Fig. 27. The results of channel five Gaussian filter for CNN circuits are shown in Fig. 29, and are very similar to the results for CNN-based TBD as shown in Fig. 27. The whole results of Gaussian filters for CNN circuits are shown in Fig. 30, and the results are not as good as shown in Fig. 27, but still clear and correct.
(a) (c)
(b) (d)
Fig. 28: This demonstrates the 16×16 results of channel one Gabor filter for CNN circuits with using the input as shown in Fig. 27 (a). The 3-D result of channel one after Gabor filter is shown in (a), and the cut-plane of (a) is shown in (b). (c) shows the image of (a). (d) shows the result after rectifier processing of (c).
(a) (c)
(b) (d)
Fig. 29: This demonstrates the 16×16 results of channel five Gaussian filter for CNN circuits with using the input as shown in Fig. 27 (a). The 3-D result of channel five after Gaussian filter is shown in (a), and the cut-plane of (a) is shown in (b). (c) shows the image of (a). (d) shows the central 8×8 image of (c).
(b)
(a) (c)
Fig. 30: This demonstrates the 16×16 results of Gaussian filter for CNN circuits with using the input as shown in Fig. 27 (a). The results of five channels after Gaussian filter is shown in (a), the result after distance processing is shown in (b), and the result is shown in (c).
Chapter 7
Conclusions and Future Works
In this thesis, a biological-inspired model for hybrid-order TBD algorithm, which mimics mechanism of early stage of human vision is proposed and experimental results are generally consistent to human visual sensation. Due to the parallel signal processing of Cellular Neural Networks (CNN), the computation time will greatly decrease. Contrary to the original biological-inspired model for hybrid-order TBD algorithm which has local maximum detection, the modified TBD algorithm can completely transfer to CNN-based TBD and be implemented on CNN-based analog circuits. Without local maximum detection, the boundaries of results for the CNN-based TBD are thick, but clear and exact. The CNN-based TBD implements a 51×51 or any size Gaussian filter with different template A and has the potential to extend the size of filters for any function to any size by using the CNN array with only template A and B. The size of the Gabor filters in this thesis is still 5×5 and to extend the size to a more suitable size will more match the frequency of input images. It will be one research of our future works for the CNN-based TBD.
We also designed an effective current-mode CMOS circuit using cascaded current mirrors with fixed or programmable templates to implement the CNN-based TBD. The programmable CNN circuit can implement each function with different templates in the CNN-based TBD.
The designed circuits are very suitable for CNN-based image processing in real-time. Simulation results with HSPICE based on the 0.35µm TSMC
2P4M process have demonstrated the superior functionalities of the designed circuit. In the future, many complex image processing algorithms will be implemented on CNN-based circuits in real-time and we can design an effective controller to integrate each block so that the usage of CNN circuits can be reduced.
References
[1] L. O. Chua and L. Yang, “Cellular neural networks: theory and application,”
IEEE Trans. on Circuits and Systems, vol. 35, no. 10, pp. 1257-1290, Oct. 1988.
[2] L. O. Chua and T. Roska, “The CNN paradigm,” IEEE Trans. Circuits and Systems – II, vol. 40, pp. 147-156, Mar. 1993.
[3] A. Passio, K. Halonen, V. Porra, and A. Dawidziuk, “Current mode cellular neural network with digitally adjustable template coefficients,” in Proc. of the Fourth Int. Conf. onMicroelectronics for Neural Networks and Fuzzy Systems, pp. 268-272, Sept. 1994.
[4] E. Y. Chou, B. J. Sheu, and R. C. Chang, “VLSI design of optimization and image processing cellular neural networks,” IEEE Trans. On Circuits and Systems – I, vol. 44, pp. 12-20, Jan. 1997.
[5] M. Salerno, F. Sargeni, and V. Bonaiuto, “A 6×6 cells interconnection-oriented programmable chip for CNN,” Analog Integrated Circuits and Signal Processing, pp. 239-250, 1998.
[6] J. E. Varrients, E. Sánchex-Sinencio, and J. Ramírez-Angulo, “A current-mode cellular neural network implementation,” IEEE Trans. on Circuits and Systems- II, vol. 40, no. 3, pp. 147-155, Mar. 1993.
[7] K. W. Current and J. E. Current, “CMOS current-mode circuits for neural networks,” IEEE Int. Symp. on Circuits and Systems, vol. 4, pp. 2971-2974, May 1990.
[8] S. Espejo, A. Rodríquez-Vázquez, R. Domínquez-Castro, and J. L. Huertas,
“Switched-current techniques for image processing cellular neural networks in MOS VLSI,” IEEE Int. Symp. onCircuits and Systems, vol. 3, pp. 1537-1540, May 1992.
[9] A. Rodríguez-Vázquez, S. Espejo, R. Domínquez-Castro, J.L. Huertas, and E.
Sánchez-Sinencio, “Current-mode techniques for the implementation of continuous- and discrete-time cellular neural networks,” IEEE Trans. on Circuits and Systems-II, vol. 40, no. 3, pp. 132-146, Mar. 1993.
[10] T. Roska and L. O. Chua, “Cellular neural networks with nonlinear and delay-type template elements,” in Proc. IEEE int. Workshop on Cellular Neural Networks and Their Applications, pp. 12-25, 1990 (extended version in Int. J.
[11] Chen, I. (1994) Texture Perception: A Linear System Approach. Ph. D.
Dissertation, University of California, Berkeley.
[12] J.G Daugman, “Uncertainty Relation for Resolution in Space, Spatial Frequency, and Orientation Optimised by Two-Dimensional Visual Cortical Filters”, Journal of the Optical Society of America, vol. 2, no.7, pp. 1160-1169, 1985.
[13] Anil K. Jain, Farshid Farrokhnia, “Unsupervised texture segmentation using Gabor filters,” Pattern Recognition, vol. 24,no.12, pp 1167-1186,1991.
[14] Rodriguez-Vazquez A., Espejo S., Dominguez-Castron R., Huertas J.L., and Sanchez-Sinencio E., “Current-mode techniques for the implementation of continuous- and discrete-time cellular neural networks,” IEEE Transactions on Circuits and Systems II: Analog and Digital Signal Processing, vol. 40, issue. 3, pp. 132-146, Mar. 1993.
[15] Chung-Yu Wu, Wen-Cheng Yen, ”A new compact neuron-bipolar junction transistor (νBJT) cellular neural network (CNN) structure with programmable large neighborhood symmetric templates for image processing,” IEEE Transactions on Circuits and Systems-I: Fundamental Theory and Applications, vol. 48, issue. 1, pp.12-27, Jan. 2001.
[16] Wen-Cheng Yen, Chung-Yu Wu, “A new compact neuron-bipolar cellular neural network structure with adjustable neighborhood layers and high integration level,” IEEE International Symposium on Circuits and Systems, vol. 6, pp.
505-508, Jun. 1999.
[17] Wen-Cheng Yen, Chung-Yu Wu, “A new compact programmable νBJT cellular neural network structure with adjustable neighborhood layers for image processing,” The 6th IEEE International Conference on Electronics, Circuits and Systems, vol. 2, pp. 713-716, Sep. 1999.
[18] Kinget P. and Steyaert M.S.J., “A programmable analog cellular neural network CMOS chip for high speed image processing,” in Solid-State Circuits, IEEE Journal of , vol. 30, issue. 3, pp. 235-243, Mar. 1995.
[19] Goras L. and Teodorescu T., “On CNN boundary conditions in Turing pattern formation,” 1998 5th IEEE International Workshop on Cellular Neural Networks and Their Applications Proceedings, pp. 112-117, Apr. 1998.
[20] T. Roska and Á. Rodríguez-Vázquez, Towards The Visual Microprocessor, John Wiley & Sons Inc., pp. 8-10, 2001, ch. 1.
[21] Crounse K.R. and Chua L.O., “Methods for image processing and pattern formation in Cellular Neural Networks: a tutorial,” IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, vol. 42, issue. 10, pp. 583-601, Oct. 1995.
[22] Shi B.E., “Gabor-type filtering in space and time with cellular neural networks,”
IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, vol. 45, issue. 2, pp. 121-132, Feb. 1998.
IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, vol. 45, issue. 2, pp. 121-132, Feb. 1998.