Open access peer-reviewed chapter

Charge-Controlled Memristor Grid for Edge Detection

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

Submitted: February 14th 2018Reviewed: May 10th 2018Published: October 3rd 2018

DOI: 10.5772/intechopen.78610

Downloaded: 648


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 xqto the nonlinear equation is found, and finally, xqis 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, μvis the mobility of the charges in the doped region, Δis the total length of the device, ηdescribes the displacement direction of xq(η=1or +1), and Ronis the ON-sate resistance. Besides, fwxqis the window function. We have selected the window given by [11]


where kcontrols the level of linearity, as kincreases, 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 xqthat contains the parameters of the memristor. In this method, different solutions are obtained for the choice made on the Joglekar exponent kand 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 +1and 1depending on the direction of the charge displacement.

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


where X0corresponds 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 0when q.

The solution for η=+1and positive values of qare 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 xqobtained with the numeric method and with HPM for homotopy orders 1–3 with k=1,2for both directions. Table 1 shows the values of the parameters used in these evaluations.

Figure 2.

Plots ofxqfork=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 xqis obtained, it is substituted in the coupled resistor equivalent:


The expressions for the memristance for order-1 with k=15are 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 Apis the amplitude of the sinusoidal stimuli.


Table 2.

Parameter values used in the characterization.

On one side, the vtitcharacteristic 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,5and ω=1,2,5,10.

Figure 3.

Frequency behavior of the pinched hysteresis loops for (a)k=1and (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=1and (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 kiand Oiare the selected kand 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 vtitcharacteristics of these models and our charge-controlled model. For the sake of comparison, the model Mk1,O3is used.

Figure 5.

Comparison of thevtitcurves.

3.2. Memristance-charge characteristic

Figure 6 shows the Mqcurves of the model for both cases of η. It can be seen that for η=1, the memristance tends to Roffin the positive range of the charge and tends to Ronin the negative range of q. On the contrary, when η=+1, the memristance tends to Ronin the positive range of the charge and to Roffin the negative range. Besides, the curves with higher kshow 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 Mqcharacteristic 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 Qtis infinite. In practice, Monhas a very low value, and Mofftakes a very high value. The value of Qtdefines 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) schematicMqcharacteristic, and (c)Mqcharacteristic of the fuse.

Figure 7(c) shows the Mqcharacteristic 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 Mqcharacteristic 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 Land the branch memristance in the grid, Mbranch. In fact, Lis 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,jis associated with the pixel i,j, which takes values between 01V. KCL analysis of the output node Ni,jyields


Figure 8.

Current contributions at nodeNi,j.

This can be established as


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

For an m×nimage, KCL analysis on the complete grid yields a system of m×nDAEs 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,jdivided by the input resistance. The initial condition of the memristive grid is MonRin=0.044which corresponds to L=4.78pixels.

The dynamics of the grid comes from the time-dependent behavior of the memristance, which implies that the value of Mbranchincreases with tcausing 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 Moffhas 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 TPis the number of pixels that belong to the evaluated edge as well as to the reference edge (true positives), and FPis 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 TBis 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.5has 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 att=20.45ms, (b) Canny’s method [2] for a threshold0.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 Ffor the memristive grid is 0.76, and it was obtained at tsmooth=20.45ms, while for Canny’s method, the maximum Fis 0.59for a threshold of 0.422. In this case, the smoothing time is measured when the maximum of Fparameter 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 att=19.65msand (b) Canny’s method [2] for a threshold0.443.

Figure 15 shows the PRcurves for the memristive grid and for Canny’s method. The maximum Ffor the memristive grid is 0.75, and it was obtained at tsmooth=19.87ms, while for Canny’s method, the maximum is 0.59for a threshold of 0.414. For the image under test, the Fmeasure 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 Fvalue 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 Fwith the memristive grid. In addition, the human Fresults 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 ivpinched 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.

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Arturo Sarmiento-Reyes and Yojanes Rodríguez Velásquez (October 3rd 2018). Charge-Controlled Memristor Grid for Edge Detection, Advances in Memristor Neural Networks - Modeling and Applications, Calin Ciufudean, IntechOpen, DOI: 10.5772/intechopen.78610. Available from:

chapter statistics

648total chapter downloads

3Crossref citations

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Synaptic Behavior in Metal Oxide-Based Memristors

By Ping Hu, Shuxiang Wu and Shuwei Li

Related Book

First chapter

Application of IR Thermography for Studying Deformation and Fracture of Paper

By Tatsuo Yamauchi

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us