# Transformative Transparent Hybrid Deep Learning Framework for Accurate Cataract Detection
## 3 Materials and Methods
### Methods
#### 3.2.2 The Model  
In the proposed model, a hybrid deep learning framework incorporating a Siamese network with the VGG16 architecture is used. Such architecture will easily compare pairs of medical images for cataract detection by leveraging deep feature extraction and similarity measurement. A learning rate scheduler is also adopted within the framework to optimize the training for better convergence and performance improvement. * VGG16-based Siamese Network  
A Siamese network is a type of neural network architecture that contains two or more identical sub-networks with shared weights and shared parameters [24]. In the work proposed herein, each sub-network consists of a VGG16 architecture, which is a convolutional neural network that normally is used for image recognition tasks. A Siamese network learns the similarity between pairs of input images. * Feature Extraction  
The Siamese Network first takes in feature extraction, wherein the input images are passed through the VGG16 model to represent the features. Let \(J_{1}\) and \(J_{2}\) be the two input images to be compared. The function \(f(. ;\theta)\) is used for feature extraction, which represents the VGG16 network, where \(\theta\) represents the trainable parameters of the network, i.e., weights and biases. The outputs from the two branches, two identical sub-networks, can be given by:  
\[FV_{1}(J_{1};\ \theta)\text{and}\ FV_{2}(J_{2};\ \theta) \tag{1}\]  
Figure 3: Proposed architectureof Transformative detection of Cataract. \(FV_{1}\) is the feature vector extracted from the first image \(J_{1}\). \(FV_{2}\) is the feature vector extracted from the second image \(J_{2}\). These feature vectors, \(FV_{1}\) and \(FV_{2}\), contain the important characteristics of the respective images and are essential for measuring similarity. * Distance Calculation The next step in determining the similarity between these two images will then be in computing the distance between their feature representations. One good choice for the distance in a Siamese network can be the Euclidean distance, given by: \[DT(FV_{1},\ FV_{2})=\sqrt{\sum_{i=0}^{n}\left(FV_{1-}^{i}FV_{2}^{i}\right)^{2}}\] (2) where n is the dimensionality of the feature vectors \(FV_{1}\) and \(FV_{2}\). \(DT(FV_{1},\ FV_{2})\) gives us a scalar value representing the distance between the two feature vectors. The output of the Siamese network is computed using the sigmoid function based on the distance calculated \[\hat{y}=\sigma(-DT(FV_{1},\ FV_{2}))\] (3)  
The resulting distance \(DT(FV_{1},\ FV_{2})\) is then transformed into a probability using the sigmoid function where \(\sigma(x)=\frac{1}{1+\epsilon^{-x}}\), which maps the result to a value ranging between 0 and 1. This value represents the likelihood of the two images being similar (close to 1) or dissimilar (close to 0). The negative sign in front of the distance ensures that larger distances correspond to lower probabilities, thus effectively transforming similarity measures into probabilistic outputs that reflect the confidence in the similarity assessment. * Learning Rate Scheduler To further enhance the training efficiency of the Siamese Network, a learning rate scheduler is adopted. For this purpose, \(\alpha\) can be tuned dynamically during training based on model performance. One common heuristic is to implement a schedule known as step decay, defined as: \[\alpha(r)=\alpha_{0}\times const\_factor[\frac{r}{len\_size}]\] (4) where \(\alpha(r)\) is the learning rate at epoch and \(\alpha_{0}\) is the initial learning rate. The \(const\_factor\) is a constant factor to reduce the learning rate and \(len\_size\) defines how often the learning rate is reduced. * Hybrid Deep Learning Approach In this hybrid framework, the output from the Siamese network is combined with those of additional models for improving the overall performance. Indeed, this makes particular sense for tasks in which different models capture different aspects of the data.