Open access peer-reviewed chapter

Charge-Controlled Memristor Grid for Edge Detection

Written By

Arturo Sarmiento-Reyes and Yojanes Rodríguez Velásquez

Submitted: 14 February 2018 Reviewed: 10 May 2018 Published: 03 October 2018

DOI: 10.5772/intechopen.78610

From the Edited Volume

Advances in Memristor Neural Networks - Modeling and Applications

Edited by Calin Ciufudean

Chapter metrics overview

983 Chapter Downloads

View Full Metrics


Nonlinear resistive grids have been extensively used in the past for achieving image filtering, focused on both smoothing and edge detection, by resorting to the nonlinear constitutive branch relationships of the elements in the array in order to carry out in fact a minimization algorithm. In this chapter, a specially tailored fully analytical charge-controlled memristor model is introduced and used in a memristive grid in order to handle the edge detection. The performance of the grid has been tested on a set of 500 images (clean and noisy) and shows an excellent agreement with the outcomes produced by humans.


  • memristor modeling
  • memristive grids
  • symbolic memristor modeling
  • edge-detection
  • image processing

1. Introduction

An indispensable preprocessing for image signal treatment is edge detection, which consists in decomposing the original image into a family of topographical curves that corresponds with measured depth levels of intensity. The main outcome of edge detection is an image that contains diminished information which allows further complex forms of image processing.

In plain words, an edge is regarded as a sharp change in brightness or when the image fence contains physical discontinuities. As a preprocessing step to edge detection, a smoothing filter, typically Gaussian smoothing, is widely applied; as a clear consequence, the edge-detection methods differ in function of the smoothing filter used [1].

In order to detect edges, several methods are reported in the study. In 1986, John Canny proposed a computational method for image edge detection. He introduced the notion of non-maximum suppression, which means that given the pre-smoothing filters, edge points are defined as points where the gradient magnitude assumes a local maximum in the gradient direction [2]. Although the method was developed in the early years of computer vision, it is still in the state of art.

Another method is based on anisotropic diffusion, which is a technique aiming at reducing the image noise without removing significant parts of the image such as edges, lines, or other details that are important for the interpretation of the image [3]. This method has evolved to nonlinear anisotropic diffusion, which consists in considering the original image as an initial state of a parabolic (diffusion-like) process and extracting filtered versions from its temporal evolution [4].

As a direct result, nonlinear resistive grids have been used to explicitly implement edge detection based on nonlinear anisotropic diffusion [5]. The nonlinear resistive grid and the elements of this processor are presented in Figure 1(a); the voltage sources represent each pixel of the image to be processed and the node voltages represent each pixel of the processed image. It is important to note that each branch in the grid is composed of a nonlinear resistive element called fuse.

Figure 1.

Structure and components of the (a) resistive grid and (b) memristive grid.

Because of the temporal evolution of the procedure, memristive grids naturally fit the features needed for achieving edge detection [6, 7]. A memristive grid has the same structure of its resistive counterpart, but the nonlinear resistors have been substituted by memristors, as depicted in Figure 1(b).

The rest of this chapter is organized as follows: Section 2 deals with the development of the proposed model, and the resulting analytic expressions for the memristance are obtained. In Section 3, the characterization of the model is carried out in order to demonstrate that it fulfills the main fingerprints of the device. Section 4 highlights the main characteristics of the memristive grid and its components. In Section 5, the results of the application of the memristive grid to edge detection are presented. Finally, in Section 6, some conclusions are drawn and future lines of research are proposed.


2. Development of a charge-controlled memristor model

Professor Leon O. Chua predicted in 1971 the existence of the fourth basic circuit element [8]. He called it memristor and defined it as a passive device with two terminals, which branch constitutive function relates the magnetic flux linkage and the electric charge. In 2008, the R. Stanley Williams group at Hewlett-Packard Laboratories presented a device whose behavior exhibits the memristance phenomenon [9].

Novel memristor applications became the main thrust in the search for better and more reliable models of the device that can predict the behavior of the electronic system application. With the goal of developing a memristor model that can achieve edge detection with the memristive grid, several features are pursued:

  • The model must be charge-controlled in order to reflect the dynamics of the edge detection.

  • The model must be recast in a fully symbolic form in order to express the memristance as a function of the device parameters.

  • The model must fulfill the fingerprints of the device [10].

The modeling methodology can be described as follows: first, the nonlinear drift mechanism is expressed as a function of charge instead of time; then, a symbolic solution xq to the nonlinear equation is found, and finally, xq is used to generate the memristance expression.

The nonlinear drift mechanism that governs the functioning of the HP memristor [9] is given hereafter as the ordinary differential equation (ODE) which is expressed in terms of the charge derivative:


where κ=μvRonΔ2, μv is the mobility of the charges in the doped region, Δ is the total length of the device, η describes the displacement direction of xq (η=1 or +1), and Ron is the ON-sate resistance. Besides, fwxq is the window function. We have selected the window given by [11]


where k controls the level of linearity, as k increases, the linearity increases in the range 01.

It is possible to find an analytical solution to Eq. (1) for k=1; however, for k>1, the solution can only be assessed by resorting to numeric analysis methods [11]. In this chapter, we resort to the homotopy perturbation method (HPM) reported in [12, 13] to obtain a symbolic solution xq that contains the parameters of the memristor. In this method, different solutions are obtained for the choice made on the Joglekar exponent k and the order of the homotopy. Besides, it must be pointed out that a pair of solutions do indeed exist in every case because η takes values of +1 and 1 depending on the direction of the charge displacement.

As an example of the solution, the equation obtained for order-1, k=3 and η=1 is given as follows:


where X0 corresponds to the initial value of the state variable (when the charge is zero). It can be noted that the model only converges for positive values of q, and the function tends to 0 when q.

The solution for η=+1 and positive values of q are given by


In order to establish a comparison, the numerical solution to Eq. (1) is obtained with the Backward Euler method. Figure 2 shows the plots of the solution xq obtained with the numeric method and with HPM for homotopy orders 1–3 with k=1,2 for both directions. Table 1 shows the values of the parameters used in these evaluations.

Figure 2.

Plots of xq for k=1,2. Numerical solution (red) and HPM solutions for order 1 (blue), order 2 (violet), and order 3 (cyan).


Table 1.

Parameters for the plots of xq.

2.1. Memristance expressions

Once the solution xq is obtained, it is substituted in the coupled resistor equivalent:


The expressions for the memristance for order-1 with k=15 are given hereafter.

Expressions for η=1


with Rd=RoffRon.


Expressions for η=+1


3. Characterization of the model

The developed model is tested in order to verify that it fulfills the main fingerprints of the device [10]. The nominal values of the HP memristor [9] are used, as shown in Table 2, where Ap is the amplitude of the sinusoidal stimuli.


Table 2.

Parameter values used in the characterization.

On one side, the vtit characteristic of a memristor must be a pinched hysteresis loop (PHL). Besides, the area of the PHL must decrease with the frequency. In the limit as the frequency tends to infinity, the memristor behaves as a linear resistor. In Figure 3, the PHLs are shown for k=1,5 and ω=1,2,5,10.

Figure 3.

Frequency behavior of the pinched hysteresis loops for (a) k=1 and (b) k=5.

Figure 4 shows the area as a function of the frequency. It can be verified that the lobe area decreases monotonically with the frequency from a critical value ωc. Table 3 shows these values for k=15.

Figure 4.

PHL lobe area as a function of the frequency (units of area in μm2) for (a) k=1 and (b) k=5.


Table 3.

Critical frequencies for different values of k.

On the other side, as the frequency tends to infinity, the value of the memristance becomes constant and the device acts as a linear resistor [10]. The limit of the memristance when the frequency ω can be expressed as


where ki and Oi are the selected k and homotopy order, respectively.

3.1. Comparison with other models

Several models are already reported in the study, which have been developed for different applications. A first scheme is reported in [14] in the form of a macro-model implemented in the SPICE circuit simulator. The second model is reported in [15], which is a mathematical model implemented in MATLAB. Figure 5 shows the vtit characteristics of these models and our charge-controlled model. For the sake of comparison, the model Mk1,O3 is used.

Figure 5.

Comparison of the vtit curves.

3.2. Memristance-charge characteristic

Figure 6 shows the Mq curves of the model for both cases of η. It can be seen that for η=1, the memristance tends to Roff in the positive range of the charge and tends to Ron in the negative range of q. On the contrary, when η=+1, the memristance tends to Ron in the positive range of the charge and to Roff in the negative range. Besides, the curves with higher k show a sharper transition.

Figure 6.

Memristance-charge characteristics.


4. Memristive grid for edge detection

Figure 1(b) shows the memristive grid used for edge detection. In fact, each fuse of the grid consists of two memristors in an anti-series connection, that is, the series connection of two memristors connected back to back, as shown in Figure 7(a). The combined Mq characteristic of the memristive fuse has the shape depicted in Figure 7(b). Ideally, the ON-state memristance is zero and the slope from the ON-state to the OFF-state around Qt is infinite. In practice, Mon has a very low value, and Moff takes a very high value. The value of Qt defines the degree of smoothing: more smoothing is related to larger Mq, which implies longer settling times in the edge detection. Besides, the memristance threshold Mth, which is related to Qt, is selected to define which pixel is identified as an edge of the original image.

Figure 7.

Memristive fuse: (a) anti-series connection, (b) schematic Mq characteristic, and (c) Mq characteristic of the fuse.

Figure 7(c) shows the Mq characteristic of the fuse to be used in the memristive grid. The parameters of the model are recast in Table 4.


Table 4.

Nominal parameter values.

The importance of a smart selection on the Mq characteristic resides in the fact that it allows us to achieve an appropriate smoothing preprocessing [16]. A figure of merit of great significance is the relation between the smoothing level L and the branch memristance in the grid, Mbranch. In fact, L is a space constant that serves to measure the smoothing as a number of pixels:


Some additional considerations must be taken into account for processing images with a memristive grid, due to the fact that the memristive grid implements a nonlinear anisotropic method. Namely, the method needs a stop criterion to find a solution [17]. The images processed with the memristive grid are in gray scale, and a threshold to stop the process is selected.

4.1. Solving the memristive grid

The equations emanating from the memristive grid form a set of differential algebraic equations (DAEs) that is solved with MATLAB. The number of pixels of the image determines the size of the grid and therefore the number of DAEs.

Figure 8 shows a single node of the grid (node Ni,j). Herein, the voltage source di,j is associated with the pixel i,j, which takes values between 01V. KCL analysis of the output node Ni,j yields


Figure 8.

Current contributions at node Ni,j.

This can be established as


where Mi1,j,Mi+1,j,Mi,j1,Mi,j+1 are the memristances incident to the node.

For an m×n image, KCL analysis on the complete grid yields a system of m×n DAEs that is solved for the nodal voltages ui,j. Moreover, the associated charges of the memristors are calculated by the numerical integration of their currents by using the trapezoidal integration rule. In a last step, the memristance is updated in the charge-controlled model.

As shown in Eq. (17), the level of smoothing depends on the rate MbranchRin, that is, the equivalent of each memristance arriving to the node Ni,j divided by the input resistance. The initial condition of the memristive grid is MonRin=0.044 which corresponds to L=4.78 pixels.

The dynamics of the grid comes from the time-dependent behavior of the memristance, which implies that the value of Mbranch increases with t causing in turn a low level of smoothing. In fact, after a long period of time, the output image gets closer to the original image. It clearly results that a stop criterion is needed.

This criterion is the smoothing time tsmooth, since it defines when the smoothing level of the output image is reached. At this point, the edges are determined by those nodes in the grid where the fuses have reached Mth. This threshold is referred to as a fraction of the maximum value of the memristance. A percentage of 2 of Moff has been used, allowing edges to be detected when the output image still retains a high level of smoothing. As a result, edge detection can be efficiently performed even for images with high levels of noise.


5. Results and comparisons

A benchmark image and its edges drawn by five human observers are presented in Figure 9 (extracted from the database BSD300 [18]). This image is used to evaluate the performance of the memristive grid.

Figure 9.

(a) Benchmark image and (b) ground truth for the edges of the benchmark image.

Figure 10 shows the output image for several levels of smoothing at different transient values. It allows us to verify that as the time increases, the smoothing level decreases, that is, the original image tends to be unveiled.

Figure 10.

Smoothing procedure: output image.

5.1. Figures of merit for the edge-detection procedure

A way of evaluating the efficiency is by means of the precision-recall curve and the parameter F [19]. On one side, the precision (P) is given as


where TP is the number of pixels that belong to the evaluated edge as well as to the reference edge (true positives), and FP is the number of pixels that belong to the evaluated edge but not to the reference edge (false positives). In fact, the precision denotes the quality of the detector.

On the other side, the recall parameter is defined as


where TB is the total number of pixels that belong to the edge in the reference image. Actually, the recall factor indicates the probability for an edge to be detected.

Another commonly used parameter is the precision-recall cost ratio F:


where β01. In order to have a balanced ratio, β=0.5 has been used.

The result of the edge-detection procedure is shown in Figure 11(a) for the memristive grid and in Figure 11(b) for Canny’s method [2].

Figure 11.

Edge detection: (a) memristive grid at t=20.45 ms, (b) Canny’s method [2] for a threshold 0.422.

The precision-recall (PR) curves are given in Figure 12(a) for the memristive grid and (b) for Canny’s method. In these plots, the black line represents the average of five curves obtained for different transients for the memristive grid and five curves with different thresholds for Canny’s method. In addition, the ground truth subjects have been cross-compared and the results are denoted by the green points, which are close to the human average as reported in [19].

Figure 12.

Precision-recall plots: (a) memristive grid and (b) Canny’s method [2].

The maximum F for the memristive grid is 0.76, and it was obtained at tsmooth=20.45ms, while for Canny’s method, the maximum F is 0.59 for a threshold of 0.422. In this case, the smoothing time is measured when the maximum of F parameter is reached, and this is the stop criterion of the method; however, when there is no ground truth to compare the detected edge, the stop criterion must be tsmooth. The human average F (for the five test observers) is 0.80 [19]. Therefore, the outcomes of the memristive grid exhibit an excellent agreement with outcomes made by humans.

5.2. Processing the noisy image

In order to evaluate the performance of the memristive grid in edge detection for images with noise, Gaussian noise is added to the benchmark image depicted in Figure 9. The noisy image (Figure 13) is processed with the memristive grid and Canny’s method; the edges detected are shown in Figure 14(a) and (b), respectively.

Figure 13.

Benchmark image with Gaussian noise.

Figure 14.

Edge detection for the benchmark image with noise: (a) memristive grid at t=19.65ms and (b) Canny’s method [2] for a threshold 0.443.

Figure 15 shows the PR curves for the memristive grid and for Canny’s method. The maximum F for the memristive grid is 0.75, and it was obtained at tsmooth=19.87ms, while for Canny’s method, the maximum is 0.59 for a threshold of 0.414. For the image under test, the F measure does not show a significant difference between the noisy and the original image.

Figure 15.

Precision-recall plots for the benchmark image with noise: (a) memristive grid and (b) Canny’s method [2].

5.3. Comparative results on a set of 500 images

In this paragraph, the performance of the grid is evaluated for 500 images extracted from the database BSD500 [19]. Figure 16 shows the statistics on the F value for the memristive grid, Canny’s method, and the human observers. Also, the histogram for the smoothing time in the memristive grid is presented. It can be noticed that the memristive grid produces 149 images with the average F, while Canny’s method produces 174. However, it must be pointed out that these average images are obtained with better F with the memristive grid. In addition, the human F results from the database show a less spread distribution centered in the class 0.6–0.7 for nearly 300 images.

Figure 16.

Histograms for 500 images from the database BSD500 [19].

A similar analysis is carried out on the set with noisy images. Gaussian noise with mean 0 and variance 0.01 has been added to the input images. The statistics are shown in Figure 17.

Figure 17.

Histograms for 500 images with Gaussian noise from the database BSD500 [19].


6. Conclusions

A symbolic model for a charge-controlled memristor has been developed. The model has been incorporated to a memristive grid that has been used as a filter for image smoothing and edge detection. A simple evaluation of the memristance expression confirmed that the model fulfills the fingerprints for the iv pinched hysteresis loop. Besides, special attention was devoted to the memristance-charge characteristic of the anti-series connection because it constitutes the key element in the memristive grid for achieving edge detection.

The methods for image edge detection usually use a smoothing filter as the first step to improve edge detection. However, in the memristive grid, the smoothing filter is naturally implemented by the same circuit, which allows to have an analog processor that implements both functions. In addition, the grid presents a good performance in edge detection in comparison with the human outcomes.

Future lines of research are mainly devoted to speed up the edge-detection procedure for high-resolution images. A relevant topic is to solve the DAEs emanating from the memristive grid by performing parallel computations on multicore computers. In this case, the edge detection can be applied to images arising from data-intensive scenarios, such as medical imaging and remote-sensing imagery.


  1. 1. Umbaugh SE. Digital Image Processing and Analysis: Human and Computer Vision Applications with CVIPtools. Boca Raton, FL, USA: CRC Press; 2016
  2. 2. Canny J. A computational approach to edge detection. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1986;8(6):679-698
  3. 3. Perona P, Malik J. Scale-space and edge detection using anisotropic diffusion. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1990;12(7):629-639
  4. 4. Bakalexis SA, Boutalis YS, Mertzios BG. Edge detection and image segmentation based on nonlinear anisotropic diffusion. In: Digital Signal Processing, 2002. DSP 2002. 2002 14th International Conference on. Vol. 2. IEEE; 2002. pp. 1203-1206
  5. 5. Harris J, Koch C, Luo J, Wyatt J. Resistive fuses: Analog hardware for detecting discontinuities in early vision. In: Carver Mead, Mohammed Ismail, editors. Analog VLSI implementation of neural systems. chapter 2. Dordrecht: Kluwer Academic Publishers; 1989. pp. 27-55
  6. 6. Jiang F, Shi BE. The Nonlinear Memristive Grid. New York, NY: Springer New York; 2011. pp. 209-225
  7. 7. Jiang F, Shi BE. The memristive grid outperforms the resistive grid for edge preserving smoothing. In: Circuit Theory and Design, 2009. ECCTD 2009. European Conference on. IEEE; 2009. pp. 181-184
  8. 8. Chua L. Memristor-the missing circuit element. IEEE Transactions on Circuit Theory. 1971;18(5):507-519
  9. 9. Strukov DB, Snider GS, Stewart DR, Stanley Williams R. The missing memristor found. Nature. 2008;453(7191):80-83
  10. 10. Adhikari SP, Sah MP, Kim H, Chua LO. Three fingerprints of memristor. IEEE Transactions on Circuits and Systems I: Regular Papers. 2013;60(11):3008-3021
  11. 11. Joglekar YN, Wolf SJ. The elusive memristor: properties of basic electrical circuits. European Journal of Physics. 2009;30(4):661
  12. 12. Velásquez YAR. Development of an analytical model for a charge-controlled memristor and its applications. Master’s thesis. Puebla, Mexico: National Institute for Astrophysics, Optics and Electronics (INAOE); 2017
  13. 13. Sarmiento-Reyes A, Hernández-Martínez L, Vázquez-Leal H, Hernández-Mejía C, Arango GUD. A fully symbolic homotopy-based memristor model for applications to circuit simulation. Analog Integrated Circuits and Signal Processing. 2015;85(1):65-80
  14. 14. Biolek D, Biolkova V, Biolek Z. Spice model of memristor with nonlinear dopant drift. Radioengineering. 2009;18(2)
  15. 15. Radwan AG, Zidan MA, Salama KN. Hp memristor mathematical model for periodic signals and dc. In: 2010 53rd IEEE International Midwest Symposium on Circuits and Systems. IEEE; 2010. pp. 861-864
  16. 16. Shi BE, Chua LO. Resistive grid image filtering: input/output analysis via the cnn framework. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications. 1992;39(7):531-548
  17. 17. Niklas Nordström K. Biased anisotropic diffusion: A unified regularization and diffusion approach to edge detection. Image and Vision Computing. 1990;8(4):318-327
  18. 18. Martin D, Fowlkes C, Tal D, Malik J. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In: Computer Vision, 2001. ICCV 2001. Proceedings. Eighth IEEE International Conference on. Vol. 2. IEEE; 2001. pp. 416-423
  19. 19. Martin DR, Fowlkes CC, Malik J. Learning to detect natural image boundaries using local brightness, color, and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2004;26(5):530-549

Written By

Arturo Sarmiento-Reyes and Yojanes Rodríguez Velásquez

Submitted: 14 February 2018 Reviewed: 10 May 2018 Published: 03 October 2018