Parameters for the plots of .
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
- image processing
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 .
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 . 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 . 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 .
As a direct result, nonlinear resistive grids have been used to explicitly implement edge detection based on nonlinear anisotropic diffusion . 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.
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 . 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 .
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 .
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 to the nonlinear equation is found, and finally, is used to generate the memristance expression.
The nonlinear drift mechanism that governs the functioning of the HP memristor  is given hereafter as the ordinary differential equation (ODE) which is expressed in terms of the charge derivative:
where , is the mobility of the charges in the doped region, is the total length of the device, describes the displacement direction of (or ), and is the ON-sate resistance. Besides, is the window function. We have selected the window given by 
where controls the level of linearity, as increases, the linearity increases in the range .
It is possible to find an analytical solution to Eq. (1) for ; however, for , the solution can only be assessed by resorting to numeric analysis methods . In this chapter, we resort to the homotopy perturbation method (HPM) reported in [12, 13] to obtain a symbolic solution that contains the parameters of the memristor. In this method, different solutions are obtained for the choice made on the Joglekar exponent 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 and depending on the direction of the charge displacement.
As an example of the solution, the equation obtained for order-1, and is given as follows:
where 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 , and the function tends to when .
The solution for and positive values of 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 obtained with the numeric method and with HPM for homotopy orders 1–3 with for both directions. Table 1 shows the values of the parameters used in these evaluations.
2.1. Memristance expressions
Once the solution is obtained, it is substituted in the coupled resistor equivalent:
The expressions for the memristance for order-1 with are given hereafter.
3. Characterization of the model
The developed model is tested in order to verify that it fulfills the main fingerprints of the device . The nominal values of the HP memristor  are used, as shown in Table 2, where is the amplitude of the sinusoidal stimuli.
On one side, the 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 and .
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 . The limit of the memristance when the frequency can be expressed as
where and are the selected 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  in the form of a macro-model implemented in the SPICE circuit simulator. The second model is reported in , which is a mathematical model implemented in MATLAB. Figure 5 shows the characteristics of these models and our charge-controlled model. For the sake of comparison, the model is used.
3.2. Memristance-charge characteristic
Figure 6 shows the curves of the model for both cases of . It can be seen that for , the memristance tends to in the positive range of the charge and tends to in the negative range of . On the contrary, when , the memristance tends to in the positive range of the charge and to in the negative range. Besides, the curves with higher show a sharper transition.
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 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 is infinite. In practice, has a very low value, and takes a very high value. The value of defines the degree of smoothing: more smoothing is related to larger , which implies longer settling times in the edge detection. Besides, the memristance threshold , which is related to , is selected to define which pixel is identified as an edge of the original image.
The importance of a smart selection on the characteristic resides in the fact that it allows us to achieve an appropriate smoothing preprocessing . A figure of merit of great significance is the relation between the smoothing level and the branch memristance in the grid, . In fact, 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 . 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 ). Herein, the voltage source is associated with the pixel , which takes values between . KCL analysis of the output node yields
This can be established as
where are the memristances incident to the node.
For an image, KCL analysis on the complete grid yields a system of DAEs that is solved for the nodal voltages . 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 , that is, the equivalent of each memristance arriving to the node divided by the input resistance. The initial condition of the memristive grid is which corresponds to pixels.
The dynamics of the grid comes from the time-dependent behavior of the memristance, which implies that the value of increases with 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 , 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 . This threshold is referred to as a fraction of the maximum value of the memristance. A percentage of 2 of 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 ). This image is used to evaluate the performance of the memristive grid.
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.
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 . On one side, the precision () is given as
where is the number of pixels that belong to the evaluated edge as well as to the reference edge (true positives), and 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 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 :
where . In order to have a balanced ratio, has been used.
The precision-recall () 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 .
The maximum for the memristive grid is , and it was obtained at , while for Canny’s method, the maximum is for a threshold of . In this case, the smoothing time is measured when the maximum of 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 . The human average (for the five test observers) is . 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 15 shows the curves for the memristive grid and for Canny’s method. The maximum for the memristive grid is , and it was obtained at , while for Canny’s method, the maximum is for a threshold of . For the image under test, the measure does not show a significant difference between the noisy and the original image.
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 . Figure 16 shows the statistics on the 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 , while Canny’s method produces 174. However, it must be pointed out that these average images are obtained with better with the memristive grid. In addition, the human results from the database show a less spread distribution centered in the class 0.6–0.7 for nearly 300 images.
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.
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 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.