Diabetic Retinopathy Detection Using Classical-Quantum Transfer Learning Approach and Probability Model

: Diabetic Retinopathy (DR) is a common complication of diabetes mellitus that causes lesions on the retina that affect vision. Late detection of DR can lead to irreversible blindness. The manual diagnosis process of DR retina fundus images by ophthalmologists is time consuming and costly. While, Classical Transfer learning models are extensively used for computer aided detection of DR; however, their maintenance costs limits detection performance rate. Therefore, Quantum Transfer learning is a better option to address this problem in an optimized manner. The significance of Hybrid quantum transfer learning approach includes that it performs heuristically. Thus, our proposed methodology aims to detect DR using a hybrid quantum transfer learning approach. To build our model we extract the APTOS 2019 Blindness Detection dataset from Kaggle and used inception-V3 pre-trained classical neural network for feature extraction and Variational Quantum classifier for stratification and trained our model on Penny Lane default device, IBM Qiskit BasicAer device and Google Cirq Simulator device. Both models are built based on PyTorch machine learning library. We bring about a contrast performance rate between classical and quantum models. Our proposed model achieves an accuracy of 93%–96% on the quantum hybrid model and 85% accuracy rate on the classical model. So, quantum can harness quantum machine learning to do work with power and efficiency that is not possible for classical computers.

Organization has declared that, in 2030 diabetes will be the most serious and 7th highest death causing disease across world. DR occurs due to the damage of tiny blood vessels in the retina due to chronic diabetics. This may cause hemorrhages, exudates and even swelling of the retina can cause blind spots blurry vision. Diabetic Retinopathy is a major cause of vision loss and blindness affecting millions of people across the globe. If DR is diagnosed early, it can be managed using available treatments. Regular eye fundus examination is necessary because DR do not present any symptoms at early stages. The retinal abnormalities in DR also include Hemorrhages (HM), "Cotton wool" spots, Microaneurysm (MA), Retinal neovascularization, hard exudates, which are clearly presented in Fig. 1.

Figure 1:
Normal eye and Infected eye [2] In recent years, classical transfer learning approaches are used in the field of image classification, segmentation, and screening for DR. However, limited detection performance rates are hinderance to computer aided diagnostic. A breakthrough in the field of quantum computing can help in giving the ophthalmologist a second opinion to solve this problem by using hybrid quantum transfer learning approach. This quantum approach can result into more efficient detection of DR in patients as compared to the classical transfer learning [3,4]. Quantum transfer learning and Principal Component Analysis (PCA) is currently used in various medical diagnostics [2]. Zhang [5] used pathological images for Non-Hodgkin Lymphoma analysis. Similarly, classification of Arabic sign language is done using same hybrid approach [6]. Therefore, this work presents a hybrid approach of quantum learning model for DR detection. This paper presents a hybrid approach for early detection of DR. We have compared the results of our three hybrid Quantum Transfer Learning models with one classical Transfer Learning model. We have labeled our data set into two categories i.e., no DR or DR. To build Quantum Transfer learning model, we have used inception-V3 [7] pre trained neural network for feature extraction and used quantum variational circuit for classification. Further our model is trained on penny lane default device, IBM Qiskit BasicAer device and Google Cirq Simulator device. We have built Classical transfer model on the same parameters and learning rates as defined in Quantum transfer learning model. Moreover, both models are based on pytorch machine learning Library. Our proposed model achieves an accuracy of 93%-96% on hybrid models and 85% accuracy rate on classical model. Quantum transfer learning approach has many advantages over conventional diagnostic techniques. This approach has less probability of human error and it is found to be more efficient and rapid way of finding the lesions in retina. Quantum computing approaches are great for solving optimization problems as compared to classical computing approaches.

Literature Review
Transfer learning refers to a technique for predictive modeling on a different but somehow similar problem that can be used partially or entirely to accelerate the training and improve the performance of a model. It can train deep neural network with comparatively small size of data. If a previously trained artificial neural network is successful in solving a particular problem, it can be reused with some additional training to solve a problem. Let's consider a pre-trained deep neural network with the data set used for the solution of a problem. Transfer learning can be used to accelerates the training of neural networks as either a weight initialization scheme or feature extraction method that is retrained to solve a different or similar problem with a new dataset.
Quantum machine learning extends the concept of transfer learning, widely applied in modern machine learning algorithms, to the emerging context of hybrid neural networks composed of classical and quantum elements. In Quantum transfer learning we focus mainly on the paradigm in which a pre-trained classical network is modified and augmented by a final quantum layer. We can use any pre trained classical neural network according to our problem for feature extraction. To classify these features with the help of "dressed quantum circuit" we need to reduce output-dimensional feature vector to final dimensions with linear transformation [8]. We commonly use variational quantum classifier to classify output features from built-in neural network and variational quantum classifier used in this regard as presented in Fig. 2. In Fig. 2 we have presented three basic components (embedding layers U(x), variational circuit V(θ ) and final measurements) on which Variational Quantum Classifier (VQC) is built [9]. We have adopted a different method to get data into quantum computers and we have used four major data encoding techniques like: Basis Encoding, Amplitude Encoding, Angle Encoding and Higher order embedding.
One of the most important components in VQC is variational circuit. Fig. 3 presents variational circuit for one qubit operation.
So now we can calculate the expectations value : After solving above equation we get : It's shows that our variational circuit depend's on the two parameters like θ 1 & θ 2 In past, many works have been reported to solve DR problem by using classical machine learning approaches using different datasets. Mansour [10] used a deep convolution neural network using transfer learning for feature extraction when building a computer aided diagnosis for DR.
To avoid the time and resource consumption, Mohammadian [11] fine-tuned the Inception-V3 and Xception pre-trained models to classify the DR dataset into two classes. After using data augmentation to balance the dataset, an accuracy score of 87.12% on the Inception-V3, and 74.49% on the Xception model is reported. Wan et al. [12] implemented transfer learning and hyper parameter tuning on the pre-trained models AlexNet, VggNet-s, VggNet-16, VggNet-19, GoogleNet and RestNet using the Kaggle dataset and compared their performances. The highest accuracy score was that of VggNet-s model, which reached 95.68% when training with hyper-parameter tuning. Transfer learning was used to work around the problem of insufficient training dataset in for retinal vessel segmentation. Dutta et al. [13] used 2000 fundus images to train a shallow feed forward neural network, deep neural network and VggNet-16 model. On a test dataset of 300 images, the shallow neural network scored an accuracy of 42%, and the deep neural network scored 86.3% while the VggNet-16 scored 78.3% accuracy.
It is quite evident from the majority of the work in diabetic retinopathy detection revolves around the use of various transfer learning models and performance comparison of these models. It is also observed that less emphasis has been given on improvement of quality of the diabetic retinopathy dataset which could lead to more accurate results. It is important to highlight the fact that the reliability of results generated from the transfer learning model depends on the features of the dataset. Google's recent achievement of quantum supremacy marked the first glimpse of this promised power. This is reminiscent of how machine learning evolved towards deep learning with the advent of new computational capabilities. These new algorithms use parameterized quantum transformations called parameterized quantum circuits (PQCs), Quantum Neural Networks (QNNs), Variational quantum circuits and Dressed quantum circuits. In analogy with classical transfer learning, the parameters of a variational quantum circuits are then optimized with respect to a cost function via either black-box optimization heuristics or gradient-based methods.

Limitations of Existing Works and Contributions
A tabular comparison has been outlined to discuss the limitations and contributions of the existing works. The dataset we used in our study is a publicly available retinal fundus images database from Kaggle (APTOS 2019 Blindness Detection) [14] consisting of 3662 images. This database is formed by technicians as they traveled in rural areas to take images for ophthalmologist's review regarding diagnosis. This process is time and resource consuming. Therefore, in current study this dataset is used to get computer aided ability to screen images without the help of ophthalmologists for timely detection of disease. The obtained dataset was weed up and a clean dataset was created. The resulting dataset is labeled into two categories. In order to train our model, we have used 789 non-DR and 738 DR images. Validation of our model is carried out by using 384 images from which 198 non-DR and 186 DR images of patients. We test out model on 1738 different and random images to evaluate performance of both types of models i.e., Classical transfer learning-based model and Quantum transfer learning based model. Distribution of training data with labels of Non-DR and DR is presented in Fig. 4.

Quantum Devices
The Quantum Computing device used in our study is Penny-lane default device, IBM QiskitBasicaer and Google Cirq Simulator device. These simulators are noiseless to avoid any error.

Image Pre-Processing
In current work, APTOS 2019 Blindness Detection dataset is taken from Kaggle and labelled into two categories with the help of provided file in Kaggle documentation. Furthermore, resizing of imbalance images is done to 350 by 350. These images are further processed to remove extra black pixel part to covert image as input in our inception V3 pre-trained neural network. After this we have converted our images into tensor vector because machine learning model always input data in the form of vectors. We have done some normalization of parameters like ( [0.485,0.456,0.406]) to remove any misbalancing during resizing of images [15,16].

Proposed Hybrid Quantum Transfer Learning Model
We have proposed hybrid Quantum transfer learning model, in which we have used inception-v3 pre trained neural network for feature extraction. Inception-v3 is a pre-trained convolutional neural network model that is 48 layers deep that is used to reduce images to 2048-dimensional feature vector [1].
To classify these features with the help of 4-qubit "dressed quantum circuit" we have reduced 2048-dimensional feature vector to 4 dimensions with linear transformation [8]. Variational quantum classifier, built for our problem is presented in Fig. 5. 2. Then we have applied, additional transformation to encode our classical data with unitary circuit. To perform this operation, we encoded our 4-dimensional feature vector as a parameters or weights into our circuit consisting of Ry(fi) gates and U (α, β, θ , γ ) circuit.
We have a sequence of trainable variational layers having an entanglement layer and a data encoding circuit. We have 3 CNOT gates in the entanglement layer which makes all qubits, entangled 4. In the end we have done measurements on each 4-qubits to get the expected value along the z-operator. Fig. 6, clearly presents the complete flow of our proposed model from first block A (inception V3) to its final measurement block (between Non-DR or DR (0,1)). We have trained two models, first is classical model using classical transfer learning and second is quantum model using quantum transfer learning with the same training data set and parameters. We have setup learning rate 0.0004 which is same for both models and used Adam optimization algorithm and Cross Entropy function as activation function. Online google Colab notebook is being used to run our model.
We have evaluated our model with five basic standards: Accuracy, Precision, Recall, f1-score and specificity with the following formulas.
Where T p = True Positive, F P = False Positive, T N = True Negative, F N = False Negative. Performance of classical and hybrid quantum models on 5 epochs are presented in Figs. 8 and 9. Our results presented that accuracy rate of Classical model, Pannylane default device, IBM Qiskit BasicAer device and Google Cirq Simulator Device is found to be 85.14%, 91.48%, 93.25% and 94.11% respectively. Therefore, it is observed that Google Cirq Simulator device presented high accuracy rate of 94.11% as compared to other hybrid or classical models. Validation accuracy of our models is presented in Fig. 9 [15].    In Tab. 3, we have compared the overall Model accuracy based on the labels of DR or Non-DR and performed evaluation for PannyLane, BasicAer Qiskit, Cirq Simulator and Classical Computer. It can be seen in Tab. 3 that overall accuracy for 0-No DR is found to be 95% and 88% for 1-DR. This shows that our transfer learning approach is capable of DR detection with much higher accuracy and less errors. This technique can further be linked with mobile applications to enable DR detection at local level with the help of a specialized doctor. The probability distributions are used in Statistics to make the detection of any change in the trend of the data. If a probability distribution is fitted accurately to the data, then it will be helpful to detect the change in data at early stage. In this section we tried to fit five different probability distributions such as Reflected Power function distribution, Kumarswamy Lehmann-2 Power function distribution (KL2PFD), Beta Lehmann-2 Power function distribution (BL2PFD), Weighted Power function distribution(WPFD) and Exponentiated Generalized Power function distribution (EGPFD) which are generated and used in medical diagnosis in literature [17][18][19][20] to get the better probability distribution for diabetic retinopathy diagnostic data. If we get early diagnosis of the patients that suffer from retinopathy, it will make the medical team to treat it at early stage.
The probability density function (pdf) of the proposed Reflected Power function distribution (RPDF) for the diabetic retinopathy are given as The probability density function (pdf) of Kumarswamy Lehmann-2 Power function distribution (KL2PFD) are given as Where "γ " and "β" are the shape and scale parameters. Also, the parameters "θ " and "ϕ"are the tuning shape parameters.
The probability density function (pdf) of Beta Lehmann-2 Power function distribution (BL2PFD) are given as where "γ " and "β" are the shape and scale parameters. Also, the parameters "α" and "b" are the tuning shape parameters.
The probability density function (pdf) Weighted Power function distribution (WPFD) is given as where "γ " and "β" are the shape and scale parameters.
The probability density function (pdf) Exponentiated Generalized Power function distribution (EGPFD) is given as where "γ " and "ϕ" are the shape and scale parameters. Also, the parameters "α" and "β" are the tuning shape parameters.
In this section, we have analyzed diabetic retinopathy data using statistical modeling. We have derived the estimates and their standard errors of the parameters of distributions using modified maximum likelihood method. The results are presented in Tab. 4. We have compared the proposed probability distributions using Goodness of fit measures such as Akaike information criteria (AIC), corrected Akaike information criteria (CAIC), Baysian information criteria (BIC), Hannan-Quinn information criteria (HQIC) and log likelihood criteria (LogL). The TTT-plot is presented in Fig. 10, which shows that the HRF has a first concave downward and then concave upward for upside-down bathtub-shaped failure rate. So, we can easily fit above mentioned probability distributions on the diabetic retinopathy data.
In Tabs. 4 and 5 and Fig. 11, we have compared the performances of the proposed distributions for the diabetic retinopathy diagnostic data and we see that Reflected Power function distribution (RPFD) best described the diabetic retinopathy data and can be used for further statistical approach. We have proposed an efficient hybrid quantum learning (Section 6) reflected power function distribution in statistical terms to get early detection of any future patient to get a chance of suffering from diabetic retinopathy disease. So, we have presented hybrid quantum learning along with probability distribution for the detection of diabetic patients, suffering from retinopathy disease.

Conclusion
A hybrid quantum transfer learning approach is adopted to model early DR detection. From our results we clearly see that Google Cirq simulator shows higher efficiency in terms of model accuracy. Moreover, already used Classical training model have presented large gap in accuracy rate. We report superiority of Quantum models in terms of performance and speed. During training of our models, we see Pannylane default device takes very less time as compared to other models. Overall performance of Pannylane default device is very good in term of time. This work suggests that there might be some variation in performance of these quantum devices but these show high performance rate when compared with classical model and is verified by statistical methods as well. This performance analysis shows that computer aided technique can be used in mobile applications for timely detection of DR in rural areas.