Deep Learning Regression-Based Retinal Layer Segmentation Process for Early Diagnosis of Retinal Anamolies and Secure Data Transmission through ThingSpeak

Diabetic retinopathy (DR) is a progressive type of problem that affects diabetic people. In general, this condition is asymptomatic in its early stages. When the condition progresses, it can cause hazy and unclear vision of objects. As a result, it is necessary to develop a framework for early diagnosis in order to prevent visual morbidity. The suggested method entails acquiring fundus and OCT images of the retina. To acquire the lesions, techniques such as preprocessing, sophisticated Chan–Vese segmentation, and object clustering are used. Furthermore, regression-based neural network (RNN) categorization is used to achieve expected results that help foretell retinal diseases. The methodology is implemented using the MATLAB technical computing language, together with the necessary toolboxes and blocksets. The proposed system requires two steps. In the first stage, the detection of diabetic retinopathy via the proposed deep learning technique is carried out. The data collected from the MATLAB are transmitted to the approved PC via the IoTmodule known as ThingSpeak in the second stage. To validate the robustness of the proposed approach, comparisons with regard to plots of confusion matrices, mean square error (MSE) plots, and receiver operating characteristic (ROC) plots are performed.


Introduction
e medical industry is currently attempting to gain a signi cant advantage as the number of wearables, tablets, and virtual reality applications for Internet of ings (IoT) users has grown signi cantly. In this process, the combination of image processing with deep learning and data transfer IoT has become one of the most commonly used procedures today. An image can be improved or data can be extracted by using image-processing techniques to perform various operations to the image. According to the application, a picture or a set of characteristics or features can be generated by this type of signal processing [1]. Image analysts use a number of interpretative basics while working with visual tools [2]. Digital photographs can be altered using computers and digital image-processing techniques. When employing digital approaches, all kinds of data must undergo preprocessing, augmentation, presentation, and information extraction.
Colour fundus imaging and OCT are two of the most common imaging modalities used by an ophthalmologist. e colour fundus image depicts the retina's two-dimensional image quite e ectively. e retina's re ection on the fundus camera [3] is captured and used to create a fundus image. Image sensors often capture the fundus image, which is a reflection of the eye's internal surface. e retina, retinal veins, the macula, and the optic disc are only a few of the visible biological features that are discussed here [4]. e distortion of the retina can be seen in a colour fundus picture. However, it is impossible to gain access to the deteriorating depth of information. Imaging with the OCT is mostly employed in the field of ophthalmology to examine the retinal layers [5]. Ophthalmologists frequently detect fundus retinal illnesses, the majority of which are the result of retinopathy [6]. Automating the segmentation of retinal layers in retinal optical coherence tomography (OCT) pictures can assist better in identifying and monitoring eye illnesses [7]. Fundus nerve tissue can be examined using OCT, a minimally invasive, real-time imaging technique that provides a microresolution volumetric scan of biological tissues [8].
In this study, a deep learning-based regression neural network method for automating the segmentation of retinal layers using fundus or OCT images as input was tested. For the best potential results, deep learning techniques are applied to train the algorithms and learn which eye disease they are taught for.
Most, if not all, vision-related issues can be diagnosed and treated at an early stage. Until a few decades ago, digital image-processing methods were seen as the best option. Regression networks in combination with deep learning provide the most accurate classification results of any of the available methods, traditional or cutting-edge. e primary goals of the preprocessing and postprocessing techniques employed in this study are the reduction of image noise and the extraction of image characteristics. As a result of the simple preprocessing and postprocessing procedures employed here, any anomalies in the retina or macula can easily be seen.

Literature Survey
is section includes a comprehensive review of the relevant literature to the study's findings. e use of computer-aided analysis methods, such as automatic segmentation, for segmenting retinal OCT pictures has grown steadily over the last few decades. An important and demanding stage in the development of computer-aided diagnosis systems for ocular illnesses is segmentation of the retina [9]. As an indicator of the health status or illness development, structural alterations (thickness or area measurements) are often utilized [10]. To obtain these measurements, the tissue boundaries must first be segmented [11]. As a result, specialists must manually mark these limits, which is a tedious and subjective process that could lead to inaccuracies [12].
Fundus retinal OCT images can be stratified using active contours, as described in [13]. In order to convert the segmentation method into a procedure for finding the energy function's minimal value, they used continuous curves and an energy function. High-resolution optical coherence tomography (OCT) has been described by the authors of [5,14]. High-resolution cross-sectional and volumetric images of the retina are provided by the SD-OCT results. To diagnose dry AMD and DME using OCT imaging, the researchers in [15] developed a classification system combining support vector machine (SVM) classifiers and histogram of oriented gradient (HOG) descriptors [16]. e inner retinal layers were not segmented in their proposed strategy. An OCT-based technique for identifying retinal diseases has been presented in [17] based on the inception network. e OCT algorithm presented with little training data and trained with nonmedical pictures can be finetuned. Researchers have looked into various methods of bolstering a diagnosis' accuracy [18]. Researchers used an extreme learning machine and probabilistic neural networks to identify the retinal blood veins. Artificial neural networks and support vector machines (SVMs) were used by the researchers in [19][20][21] for the categorization of diabetic retinopathy images, respectively, using fundus images as a source of data for machine learning identification. Data sets are small and labelling is expensive and time-consuming, making these studies difficult to implement despite their promising outcomes.
OCT research has focused on layer segmentation accuracy because it is critical for clinical interpretation. Image processing approaches such as active contour [22,23], support vector machine [24][25][26], and graph-based algorithms [27][28][29][30] have been presented in the literature to segment retinal layer borders.
It has been demonstrated that deep learning (DL) can outperform standard methods in a variety of computer vision and image analysis applications. Consequently, its application to medical image analysis, including ophthalmology pictures, of course, has been prompted by its success in achieving the desired results by combining regression networks with current classifiers in order to achieve the desired results [6,31,32]. As a result, it is clear from the literature that regression-based deep learning procedures, as well as K-means clustering and morphological processing combined with IoT procedures, have not been examined.
is has been identified as a research gap in order to carry out this work, together with preprocessing and postprocessing techniques involving K-means clustering and morphological processing.

Methodology
e proposed technique, depicted in Figure 1, begins by retrieving the retinal OCT and fundus pictures from the database. To remove undesired artefacts, the images must be preprocessed using a Gaussian filter and a bilateral filter. During the filtering process, the Gaussian filter is typically used, which is a smoothing operator that uses a convolution approach to blur the images and remove undesired information. is filtering function is commonly used to reduce noise and details in an image in order to improve the image structure.
e Gaussian filter uses a Gaussian function, which describes the normal distribution function, to determine the transformation applicable to each pixel value in the associated images in a mathematical approach. e filtered image is then passed into a bilateral filter, which is a nonlinear filter that seeks to maintain edges while simultaneously reducing noise. e ltering procedure is carried out here by utilizing the geometric proximity as well as the similarity detected in neighbouring pixels to construct a lter kernel. During this edge-preserving smoothing method, each pixel in the image is replaced by a weighted average of the nearby pixels. e ltered image is subjected to image segmentation using the Chan-Vese algorithm which is generally designed to divide the objects in an image even though a clear set of boundaries are de ned. is algorithm is usually based on the level set theory which is evolved iteratively for energy minimization. is model of segmentation is quite capable for segmentation of any sort of images that would be di cult by means of classical methods of segmentation which use thresholding operation or the gradient type of procedures. Once the image is segmented by energy minimization, the objects are clustered by means of a k-means algorithm, which is an unsupervised algorithm used to segment the region of interest from the background part of an image.
Furthermore, the edge detection process is initiated by means of the gradient procedure, and the boundary tracing method for the segmented image is carried out which has foreground pixels and background pixels. e tracing of the boundaries is mainly divided into inner boundary and outer boundary labelled as one and zero, respectively, during simulation.  Step 1: Import retinal OCT and fundus images from the database Step 2: Preprocess the images by applying Gaussian and bilateral lters %Gaussian lter as below equation for smooth impulse response and no ringing e ects Step 3: Image segmentation via Chan-Vese procedures Step 4: Object clustering via K-means clustering (i) Choose "k" cluster centres at random. (ii) Determine the distance between each data point and the cluster centres.
(iii) Assign the data point to the cluster centre with the shortest distance from the cluster centre among all cluster centres.
(iv) Calculate the new cluster centre again.
Step 5: Edge detection and boundary tracking to identify lesions in OCT and fundus images.
Step 6: Carry out morphological enhancement for lling the gaps in objects Step 7: Feature extraction and classi cation using regression deep-learning networks Step 8: Transmission to remote areas via the IoT module ALGORITHM 1: Proposed regression algorithm.
Mobile Information Systems e resulted image provides the detected lesions which have active contours and is subjected to morphological enhancement before the features are extracted. e feature extraction is an iterative process which involves a winning process generally termed as bilinear interpolation. Further concatenation of histograms is processed to create the block of features which are normalized to be fed to regression neural network classi cation model. is model needs the variables to be continuous or real-valued variables (see Figure 1). e regression models involve convolution network classi cation and utilize a regression layer in the network for the purpose of predicting the continuous-valued data. In this work, the training feature containing retinal issues is also fed to the model and also the target values indicated by retinal ailments such as diabetic retinopathy and other retinal diseases provide the feedback to the model. In the classication model, primarily, the SVM classi er is applied which is a supervised algorithm utilized for classi cation as well as regression issues. SVM uses the kernel procedure to transform the applied data and nds the optimal boundary values. e obtained values are later fed to the secondary classi er of the model represented as naive Bayes classi er. It belongs to the supervised learning algorithm family. It assists in assigning a class to the obtained features from the retinal imagery.  In the proposed application, based on the fundus images, DR-a ected regions are observed as the region of interest, whereas in retinal OCT images, the thickness of the layers between the internal limiting membrane (ILM) and the retinal pigment epithelium (RPE) is considered as the region of interest. In this manner, the classi cation of retinal fundus and OCT images is established. e nal parameters are passed on to ingSpeak which is MATLAB's IoT cloud such that it can be shared to remote health centres to have multiple analyses by healthcare workers and proper treatment in time (Algorithm 1).

Experimental Results and Analysis
In a single frame, Figure 2 depicts the optical disc detection and segmentation interface. Figure 3 shows how the retinal picture is used in an iterative manner. e Gaussian lter and bilateral lters are used to preprocess the image. ere are two types of smoothing lters: the Gaussian lter and the bilateral lter. e  Mobile Information Systems 5 former is a low-pass lter that reduces noise by showing highfrequency components in the image and blurring areas of the image. Each pixel is replaced with a weighted average of the intensity values from surrounding pixels. ese lters change the appearance of the image by means of deep learning and smoothing. Later, the image segmentation process is carried out by means of clustering and thresholding to provide the nal optical disc region as shown in Figure 4. Furthermore, the boundary tracking process is initiated at an iterative rate as shown in Figure 5, which clearly shows the marking and tracking of the boundaries of DR-a ected regions. e same process is further carried out for 60 iterations for vivid marking of the a ected region as shown in Figure 6. Here, the a ected region is visible in the form of an oval shape indicated as the region of interest. e framework as shown in Figure 7 is utilized for detection of diabetic retinopathy for fundus images.
is framework clearly      represents the procedures involved such as future extraction and classi cation via SVM and Bayes classi cation algorithms.
As a second phase of the test retinal OCT image as shown in Figure 8, performing the aforementioned procedure is considered in order to display the segmented layers of ILM and RPE. RPE describes a single layer of normal polygonal cells organized at the outer surface of the retina, whereas ILM represents the structural boundary seen between the vitreous and the retina, which has been suggested to act as a barrier for a wide range of retinal therapies; ILM represents the structural boundary between the vitreous and the retina, and RPE denotes a single layer of regular polygonal cells organized at the outer surface of the retina. e RPE is connected to Bruch's membrane and the choroid on its outer side, while the inner side is attached to the outer layer of photoreceptor cells on its inner side. Figure 9 explains the process of feature extraction from OCT images via the clustering process based on support vectors. Later, a trained data confusion matrix is plotted between the target and output classes which is shown in Figure 10 which clearly indicates that the performance with respect to the true value mentioned in the green boxes shows the insight into the data set.
Similarly, the test confusion matrix is derived as a nal confusion matrix for target and output class variables as shown in Figure 11, which describes the performance of the classi ed and further utilized for which true values are known. For identifying and classifying diabetic retinopathy from OCT images, Figure 12.
To validate the performance of the proposed methodology, a plot of the mean square error (MSE) with respect to iterations (or) epochs and MSE for both trained data and validation are represented. e best MSE, which has to be low, is indicated by dotted lines on the graphical plot shown in Figure 13. It is       After the confusion matrix is derived for training, testing, and the validation procedure shown in Figure 16, the nal receiver operating characteristic (ROC) curve is as displayed in Figure 17, which is graphically plotted between the false positive rate and the true positive rate. e ROC curve is most often used to display the interrelationship between sensitivity and speci city for a cuto value of the testing procedure. e area and the ROC graph must lie between "0.9 and 1." Hence, the nal ROC from our plot reaches the maximum best value of "1," and the graphical plot is a linear progressive plot. e nal parameters are sent to the ingSpeak module, MATLAB's IoTcloud, for which interface dialog box appears as shown in Figure 18, such that it can be shared with remote health centres for numerous analyses by healthcare workers and proper treatment in real time.

Conclusion
A robust deep-learning regression technique is used, together with fundus and OCT layer segmentation and grouping. Following that, RNN classi cation using the support vector machine (SVM) and naive Bayes classi ers yields the precise segmented DR impacted regions and layers.
e suggested procedure was simulated using the MATLAB programme on a system with 8 GB RAM and 2 GB VRAM to nd the best solutions involving image acquisition and deep-learning toolboxes along with the ingSpeak IoT Module. is work has been carried out on a prototype at the moment, and it can be extended further using the hardware setup to reach more population. Comparisons of confusion matrix plots, mean square error (MSE) plots, and receiver operating characteristic (ROC) plots are undertaken to con rm the robustness of the suggested technique. e  classification additionally evaluates the normal and damaged retinal areas using cluster diagrams. e proposed method also included confusion matrices to characterize the subtle performance of the test data based on the true values acquired. As a result, the classification model's performance demonstrates an ideal procedure for delivering expected outcomes by satisfying the statistical constraints specified in the findings. In order to ensure timely treatment, the final parameters are sent to ingSpeak, MATLAB's IoT cloud, so that it may be accessed by healthcare staff in faraway locations.
Data Availability e processed data are available upon request from the corresponding author.

Conflicts of Interest
e authors declare that they have no conflicts of interest.