Digital Implementation of a Spiking Convolutional Neural Network for Tumor Detection

: The structural variation of the brain tissue creates challenges for detection of tumors in MRI images. In this paper, an architecture for spiking convolutional neural networks (SCNNs) is implemented in an embedded system and their potential is evaluated in terms of hardware utilization and power consumption in complex applications such as tumor detection. Accordingly, the structure of the proposed SCNN is implemented on a field-programmable gate array (FPGA) using fixed point arithmetic. To evaluate the speed, accuracy and flexibility of the proposed SCNN, Izhikevich neuron model is used with the spike-timing-dependent plasticity (STDP) learning rule. The suggested neural network is explored for digital implementation possibility and costs. Results of the hardware synthesis and digital implementation are presented on an FPGA.


Introduction
Most clinical reports struggle with the problem of large volume of data about patient records in the form of medical imaging such as MRI images and CT scans. Analyzing and efficient processing of these huge data opens up a research avenue motivating researchers to explore possible solutions and help physicians to have a better diagnosis particularly in case of emergencies when no expert is available. Convolutional neural networks (CNNs) as a type of deep neural network (DNN) present a premium performance in machine learning fields including pattern recognition, speech and image processing, and natural language processing.
Simulation and implementation of brain-like networks are vital for perceiving the way the brain processes information. The third generation of neural network models, called spiking neural networks (SNNs), improved the level of biological realism in neural simulations. SNNs have provided many opportunities for opening up a totally new field in artificial intelligence research. Currently, spiking neural networks (SNNs) have gained popularity because of their biological plausibility. Practically, when a neuron model is selected for large SNN, there is always an exchange between the biological plausibility and computational efficiency [6].
Alan Lloyd Hodgkin and Andrew Huxley suggested the first scientific model of spike neurons named Hodgkin-Huxley (HH) model in 1952 [7]. This model presented the procedure of spike generation with a set of four differential equations by describing how action potentials take place and reproduce. Considering accuracy and computational complexity, various biological models such as Izhikevich model [8], [9], Integrate and Fire model [8], FitzHugh-Nagumo (FHN) model [10], [11], and Hindmarsh-Rose model [12] are available. Effective tools for analysis of primary procedures in the brain are provided by spiking models and solutions are suggested for a wide range of special problems in engineering, including fast signal processing and pattern and speech recognition [13]. The procedure of data processing in the brain can be simulated outside the brain through analog or digital circuits if the effective model and detailed condition of neuron connections are selected. Through targeting various platforms, hardware realization of biological neuron models has been examined. VLSI systems are notable options for the neural systems' direct implementations. Rapid prototyping of neural algorithms to realize theories of computational neuroscience, network architecture, and learning system is made by a VLSI implementation as it enjoys high performance and remarkably improved technology [14]. Digitally implemented neurobiological networks possess shorter development times and are more flexible while they consume more silicon area and power compared with their analog counterparts.
Nowadays, breakthroughs in circuits and systems such as application specific integrated circuits (ASIC), graphical processing units (GPU), and custom hardware accelerators have been proposed as methods for implementing CNNs in practical applications [1][2]. A high accuracy digital implementation makes it possible to develop networks with high dynamic range and stability. Recently, in order to realize neural system models, reconfigurable digital platforms have been utilized [15]- [22]. Critical challenges of the digital implementation include Through FPGA it is possible to achieve lower power consumption [3,4,5].
In this paper, a spiking convolutional network has been proposed based on Izhikevich neuron. By using STDP as a learning rule, the network was trained to achieve the higher accuracy in tumor detection. Furthermore, an architecture is presented for Izhikevich neuron. Accordingly, synthesis and physical implementation have been done on the FPGA board.

The proposed neural network
Considering the biological plausibility and power efficiency of neuromorphic platforms, developing deep SNNs for these platforms is inevitable. These types of neural networks are not precise and are not considered as deep learning methods. On the other side, SNNs are efficient networks for simulating the brain performances to solve complicated problems in the field of intelligent objects. The proposed architecture has been presented as the simplest deep structure which is fully connected and consists of input, hidden, and output layer. Fig. 1 shows the overall structure of the deep SNN with its layers. The structure of the suggested deep spiking neural network offers a neuronal population with hidden layers which is capable of being employed in the medical images. The input layer learns to perform pre-processing on the input. Information is then sent to a series of hidden layers. These layers can vary in number. As the information disseminates through hidden layers, more complex features are extracted and learned. The output layer performs classifications and detects the tissues of the input images, usually by Soft-max. The proposed SNN network contains Izhikevich neurons. In this structure, the data flows in a completely one-way flow from the input to the output units. Data processing can be performed at several layers of neurons, but there is no feedback in this structure. For bridging biologically plausible learning algorithms and traditional learning methods in neural networks, deep spiking neural networks can be an ideal choice. An important restricting parameter is lack of training algorithms that have specific uses in the capability of spiking neuron models. Most methods use rate-based approximations of conventional DNNs. Deep SNNs might still be suitable because approximating the results could be achieved more efficiently and faster than traditional systems, especially if the SNN is implemented on a neuromorphic hardware platform. Furthermore, designing and analyzing the training algorithms for SNNs and their employment are more difficult because they are discontinuous and asynchronous methods for computing [23]. In the last decades, a new learning approach has been emerged in cellular learning according to which temporal order has been focused instead of frequency. This novel learning rule has been known as spike-timing dependent plasticity (STDP). STDP process presents the activity-dependent development of neural systems by considering longterm potentiation and long-term depression. Also, it has obtained great popularity because of having the mixture of computational power and biological plausibility [24]. To train network weights, an STDP algorithm has been applied along with a gradient algorithm that is a kind of reinforcement training. This network is used to achieve a better classification in detecting benign and malignant tumors. The output results of the SNN are used for categorizing two types of images which are recognized at frequencies 11 Hz and 80 Hz for images with and without tumors, respectively.
Also STDP algorithm is presented by [25]: where, A + and Aare the domains of weight changes, τ + and τare 10 ms, and W is the synaptic weight. To evaluate the speed, accuracy, and flexibility of the proposed spiking neural network, it is implemented on FPGA.

Hardware design
Countless analog and digital brain-inspired electronic systems have been put forward as solutions for brisk simulations of spiking neural networks. While these architectures are proper for realizing the computational features of large scale models of the nervous system, the challenge of constructing physical devices that are able to operate intelligently in the real world and display cognitive competence is still kept open. Designing and efficient implementation of these structures in hardware provide us with the benefit of presenting a processing system based on the structure of brains. Analog circuits require precision in terms of the fabrication procedure variations and environment temper-atures. In fact, designing circuits that perform reliably under a vast range of extraneous factors is a challenging endeavor. As a result of this challenge, there is a dissonant condition between simulation results and the analog implementation. Furthermore, the reconfiguration of a very large scale integrated (VLSI) implementation is not achieved easily. Consequently, having a rapid prototyping platform for neural models with homogeneous flexibility in general purpose microprocessors seems essential. An FPGA is an ideal technology for this purpose. It is true that digital computation consumes more silicon area and power per operation than its analog counterpart; however, it affords extra merits.
Having fascinating features such as low-cost, flexibility, reliability, and digital precision makes FPGAs popular as a promising choice over analog VLSI approaches for designing neuromorphic systems. A digital implementation of the spiking neural network is considered for its fast, high precision, and flexible storage structure.
On the other hand, usually both analog and digital implementations are used. Analog implementations have more restrictions than digital ones. Using a reconfigurable and programmable device like FPGA can be an ideal option. The smart and small systems used in modern day-to-day applications and the possibility of their connection to the computer, require the implementation of neural network hardware in small volumes. In this structure, a large number of neurons are packed in order to implement the network at a huge scale. Based on the Euler recursive method, differential equations are solved for a neuron model. as a case study which will be discussed presently. As shown in Fig. 3, each Izhikevich neuron can be implemented at six different states by the presented scheduling diagram for describing in Verilog HDL as a hardware neuron unit. Also, Fig. 4 demonstrates the general structure of Izhikevich neuron by logical units. Accordingly, a hardware architecture is proposed based on combinational circuits such as Multiplexers, Multipliers, and arithmetic logic units (ALU). Each part of this architecture can perform on the base of the discretized the Izhikevich neuron in Euler method. Also, by using functional units, the spiking neuron model can be described in HDLcode.
Figs. 5 and 6 represent the frequency movement for detecting cancer tumors at frequency 11 Hz and for noncancerous tumors at frequency 80 Hz, respectively. Accordingly, the proposed hardware system is designed for recognizing the cancerous and non-cancerous tumors at two different frequencies. Fig. 7 shows how to change weights for 8 different neurons.

Brain tumors in MR images and the proposed convolutional neural network
A spiking convolutional neural networks (SCNN) was used for tumor detection as a signal processing application in magnetic resonance imaging (MRI). Based on Fig. 8, which illustrates the basic architecture, the images as inputs are transformed to spikes after preprocessing. The weights trained by a non-spiking CNN have been used in the spiking layers. The neuron with maximum activity (spike frequency) has been selected as the image's class. One of the most significant CNNto-SNN approaches for energy efficient recognition is the structure displayed in Fig. 8 in which the weight normalization is employed to reduce the performance loss. The MRI images are employed for the SCNN by using STDP learning. There are 700 experimental MRI images as input, 80% of which are used for training

Physical Implementation
The proposed SCNN is used for recognizing the tumors in MRI images which are categorized based on the presence or absence of tumors as shown in Fig. 10. On the base of this figure, a physical implementation can be proposed for detecting the differences in these two categories. Fig. 11 depicts the final results of physicallyimplemented network by which the images with and without tumors (displayed in Fig. 10) can be recognized at 11 Hz and 80 Hz frequencies, respectively. Furthermore, the outcomes of the physical implementation are presented as experimental results, verifying and validating the accuracy of the proposed method. Also, the hardware utilization summary results are presented in Table 1 in which an efficient implementation has been obtained. Table 2 compares the synthesis results

Conclusions
In this paper, an automated fragmentation of brain lesions was presented based on deep convolution neural networks. The proposed architecture is a great improvement in the voxel-based classification with regard to neighboring information and a number of features. In addition to the ability to apply MR images, the proposed method can also be applied to enhancedcontrast scan images. Moreover, by appropriate training of this learning method, a wide range of medical images taken with different devices can also be covered. A spiking neural network was used to detect benign and malignant tumors. Furthermore, hardware design and digital implementation on the FPGA framework improved the speed, accuracy, and flexibility of  of the present study with those of two other studies reported in the literature, which suggests the lower cost of SCNN as compared with CNN on a Virtex-6 FPGA ML605 board. The merits of SCNN as an ideal choice for hardware implementation purposes is evident. the proposed spiking network, which uses a combination of the Izhikevich and the STDP learning model. The experimental test results confirmed the accuracy of the proposed model. To the best of our knowledge, while there are some research studies on medical image processing by deep learning, particularly convolutional neural networks, no instance of hardware implementation of SCNN was found to use medical images as a dataset. Also, our dataset is a special one based on experimental work and it is not a general dataset. Our hardware implementation based on a Virtex-6 FPGA ML605 board, presents a hardware module which is appropriate for MRI-embedded devices and this reduces human mistakes. Also, based on the results of the study, the possibility of physical implementation is recommended.