Anomaly Detection from Medical Signals and Images Using Advanced Convolutional Neural Network

In the field of Artificial Intelligence (AI), deep learning is a method falls in the wider family of machine learning algorithms that works on the principle of learning. Convolutional Neural Networks (CNNs) can be used for pattern recognition from different images based on deep learning. Anomaly detection is a very vital area in medical signal and image processing due to its importance in automatic diagnosis. Anomaly detection from medical EEG signals based on spectrogram and medical corneal images are tested and evaluated in this paper. Technically, deep learning CNN models are used in the train and test processes, each input image will pass through a series of convolution layers with filters (Kernels), pooling, and fully connected layers (FC) for the classification purposes. The presented simulation results reveal the success of the proposed techniques towards automated medical diagnosis.


Introduction
In the field of medical signal and image processing, automatic diagnosis is the main and most important task. Automatic diagnosis depends on the detection of anomalous behavior in signals or images. For example, EEG signals can reflect the status of epilepsy patients. At certain times, it is possible to detect or predict seizure periods based on anomaly detection techniques. In another example of medical image processing, anomaly detection techniques can be used to locate exudates and micro-aneurysms in optical fundus images. The common thread between these trends is how to develop efficient tools for automated diagnosis of abnormal activities in medical signals or images.
Convolutional neural network (CNN) is one of the most effective deep learning methods to solve image classification problems and it is one of the most widespread deep neural networks models that owns the capability of learning features automatically from input 5 data. At this paper, we will discuss how CNN can detect the anomalies from the images and the signals. CNN consists of convolutional layers followed by activation function, pooling layers, dropout layers, and fully connected layers. The convolutional layer is contained filters that are used to perform a two-dimensional (2D) convolution with the input image. Feature maps are generated from the convolution layer. The pooling layer decreases the size of the image. The used value is the maximum or mean value of the pixels. The max-pooling layer is used in this technique. The inclusion of a dropout layer is used a regularization technique for reducing over fitting.
Epileptic seizures are the results of the transient and unexpected electrical disturbance of the brain. Approximately, one in each 100 persons can experience a seizure at least once.
Unfortunately, the occurrence of an epileptic seizure is unpredictable, and its process is not totally understood. EEG is a representative signal containing information of the electrical activities of the brain. EEG is the most commonly used signal to clinically assess brain activities. The detection of epileptic form discharges within the EEG is a vital task within the diagnosis of epilepsy. The detection of epilepsy with visual scanning of EEG recordings for the spikes and seizures is extremely time consuming, particularly in the cases of long recordings. Therefore, the extraction of EEG signal parameters using computers is extremely helpful in automatic diagnosis.
In the proposed work, the original EEG signals are converted to images using spectrogram and then the resulted spectrogram images are directly input into the CNN instead of extracting all feature types. We tested this method on three patients in the scalp CHB-MIT database. We are not only detecting binary epilepsy scenarios, e.g., Normal vs. Seizure and Normal vs. Pre-ictal, but also verified the ability to classify a triple case, e.g., Normal vs. Seizure vs. Pre-ictal.
The rest of this paper is organized as follows. Section 2 presents the proposed approaches 6 for corneal image detection of anomalies with CNN and EEG signal detection and predication with CNN. Section 3 presents the specifications of the employed datasets. Section 4 presents the simulation results. Finally, the concluding remarks are given in Sect. 5.

Methods
This section will show two successfully models for the convolutional neural networks which are exploited for anomaly detection from medical EEG signals based on spectrogram and from medical corneal images.

Corneal Image Detection of Anomalies with CNNs
Cornea is the transparent portion through which the light enters the eye. Cornea and Sclera form the outer tunic of the eye and are mechanically strong. They act a protective shield and prevent the foreign objects from entering the eye. Cornea has five main layers, namely: (1) Epithelium, (2) Bowman's layer, (3) Stroma, (4) Descemet's membrane, and (5) Endothelium. The main function of the endothelium is to pump the excess water out of the stroma to preserve its mechanical structure and optical clarity. The corneal endothelium is the inner layer of the cornea and it is of great interest for ophthalmologists. This layer is formed by closely packed, predominantly hexagonal cells whose shape and structure can provide important diagnostic information about the cornea health status or indicate some corneal diseases. The corneal endothelium is a monolayer of cells which has a big impact on the human vision. It is responsible to assure proper hydration of the eyeball and in consequence by providing sufficient amount of water [1][2][3].
Eye disorders among the elderly are a major health problem. With advancing age, the normal function of eye tissues decreases and there is an increased incidence of ocular pathology. Corneal is a complication of refractive surgery characterized by the cloudiness of the normally clear cornea. Computer based intelligent system for classification of these 7 eye diseases is very useful in diagnostics and disease management. Corneal disease is a serious condition that can cause clouding, distortion and eventually blindness. There are many types of corneal disease. The three major types are keratoconus, Fuchs' endothelial dystrophy, and bullous keratopathy. ground truths [21][22][23][24]. Table 1 shows a comparison between different classification techniques according the accuracy.

Eeg Signal Detection And Predication With Cnns
Epilepsy is a neurological disease that is not contagious, it is not a mental illness, and it is not a developmental disability. A seizure is a brief disruption of electrical activity in the human brain. Epileptic seizures can also be defined as a deformity in the human brain that makes the patient prone to seizures, which usually are frequent and recurrent [ 25 , 27].
Research studies provided by World Health Organization (WHO) shows that approximately 50 million people suffers from epilepsy worldwide. The estimated proportion of the general population with active epilepsy (i.e. continuing seizures or with the need for treatment) at a given time is between 4 and 10 per 1000 people. However, some studies in low and middle-income countries suggest that the proportion is much higher, between 7 and 14 per 1000 people [ 28].
Electroencephalography (EEG) is the recording of electrical activity along the scalp produced by the discharging of neurons within the brain. EEG refers to the recording of the brain's spontaneous electrical activity over a period. When brain cells (neurons) are activated, local current flows are produced. EEG detects the electrical activity using small, and flat metal discs (electrodes) attached to the brain scalp. The brain cells send electrical impulses and are active all the time, even when human sleeping [ 29,31].
Automatic seizure detection and prediction from EEG have received considerable research focus because of their importance for better understanding of epilepsy and more efficient management of the disease. Feature extraction is a key step in determining EEG classification for detection or prediction. We imagine courageously a method in which classification is carried out without complex feature extraction, and the recent development of CNN has provided a new way for addressing this issue. The first step to calculate the spectrogram is to segment the EEG signal to equal length windows, which may not overlap but usually overlapped in various ways, the window size should consider the nonstationary nature of the EEG signal. The idea here is that the spectral properties of an EEG non-stationary signal can be displayed through a series of spectral snapshots. As a nonstationary signal, EEG frequency change with time, the segment length (time resolution) must be short enough in which the frequency change is not remarkable.
Next step in signal analyzer is to compute the spectrum to get the short-time Fourier transform. Finally, the power of each spectrum is displayed segment by segment; these spectrums laid side by side to form the image a magnitude-dependent color map is produced as an image. This image depicts the spectrogram of each signal.
The proposed approach is based on building an efficient model that can distinguish 13 between three-states classification, detection process, and prediction process. The proposed model consists of Convolutional layer followed by max pooling layers. Finally, a global average pooling is used. Images are input in 224×224. One convolutional layer has no. of filters 32 and max. pooling with size 2. Finally, a dense layer with size of 3 is used for classification decision for three-states classification and with size 2 for classification decision for detection and prediction process as shown in Table 3.   Table 4 The used data set description.

Results And Discussion
In the proposed approaches, accuracy is used to estimate the strength of the CNN model.
Accuracy is calculated as follow: Corneal Image Classification Results: The proposed approach consists of 5 convolution layers followed by five max pooling layers and a global average pooling layer is used before the dense layer at the last decision soft max layer. Figures 3 and 4 show the accuracy and loss during the training phase. It can be observed that the accuracy reached 100% and the loss decreased near to be zero. Our proposed system illustrates comparable results with other techniques in the literature.

EEG Signals Classification Results:
The proposed approach consists of a convolutional layer followed by max pooling layer are used before the dense layer at the last decision soft max layer. Simulation results are performed using python, Keras, Pillow, and Tensorflow.
The methodology described is evaluated using the CHB-MIT databases based on time 15 domain signal. This system is tested on three cases: two types of experiments involving two-states classification problems ((i) Normal vs. Pre-ictal and (ii) Normal vs. Seizure) and one three-state classification problem (Normal vs. Seizure vs. Pre-ictal). We trained and tested our method for each 23 channels for three patients individually, after applying the spectrogram for them and the accuracy of classification results for all channels for the three patients analyzed are presented in Tables 3 through 5 and Figures from 3 through 5.   were obtained for six channels, such as channels 03, 17, 21, and 23. Table 5 The accuracy results for patient 1.

Fig. 5
The accuracy results for patient 1. Table 6 The accuracy results for patient 8 Fig. 6 The accuracy results for patient 8. Table 7 The accuracy results for Patient 20.

Conclusions
This paper has dealt with a very vital track in medical signal processing, which is the automated diagnosis from signals and images. We have introduced efficient anomaly detection techniques based in CNN for both EEG and corneal images. The proposed approaches for seizure detection and prediction have been evaluated on CHB-MIT database and achieved success rates up to 100% in seizure detection and prediction.
Moreover, the corneal images detection approaches managed to achieve efficient detection of anomalous behavior in the corneal images. The track presented in the paper is a good step towards automated diagnosis systems.  The accuracy results for patient 1.

Abbreviations
28 Figure 6 The accuracy results for patient 8.

Figure 7
The accuracy results for patient 2

Supplementary Files
This is a list of supplementary files associated with the primary manuscript. Click to download.