# Hybrid Deep Learning Model for Cataract Diagnosis Assistance
## 3 Method
### Model Architecture
#### 3.3.2 Classifier  
The underlying classification module in this experiment is improved and reorganized on the basis of the classical few-shot learning network, the prototypical network. The prototype network was proposed by [PERSON] et al., and its basic principle is to make vectors of the same type closer together and different types of vectors farther apart [21]. The mean of the features of each category is called the prototype of that category (\(c_{k}\)), and by calculating the distance between the test samples and each prototype, the prototype with the smallest distance is taken as the category of the test sample. The class prototype calculation formula is shown in (5):  
Figure 4: SE_block structure.  
\[c_{k}=\frac{1}{|S_{k}|}\sum_{(x_{i},y_{i})\in S_{k}}f_{\phi}(x_{i}) \tag{5}\]  
where \(f_{\phi}(x_{i})\) is the mapping function \(f_{\phi}:\mathbb{R}^{D}\rightarrow\mathbb{R}^{M}\), which is used to map the \(D\) dimensional sample data to the \(M\)-dimensional space. \(S=(x_{1},y_{1},\ldots,(x_{N},y_{N}))\) is a set of small-scale \(N\)-type label-supported datasets in FSL learning, \(x\) is a vector representation of \(D\)-dimensional sample data, \(y\) is its corresponding category, and \(S_{k}\) represents a dataset of category \(k\).The class prototype diagram is shown in Figure 5. Then, given the distance function \(d:\mathbb{R}^{M}\times\mathbb{R}^{M}\rightarrow[0,\infty]\), the prototype network generates a class distribution of query point \(x\) based on softmax at the distance to the prototype in the embedded space:  
\[p_{\phi}(y=k|x)=\frac{exp(-d(f_{\phi}(x),c_{k}))}{\sum_{k}exp(-d(f_{\phi}(x),c _{k^{\prime}}))} \tag{6}\]  
Learning is performed by minimizing the negative logarithmic probability of the real class \(k\) by SGD, and the loss function is  
\[J(\phi)=-\log p_{\phi}(y=k|x) \tag{7}\]  
In this experimental study, Prototypical Networks is used as the underlying classifier, and in terms of feature representation, it enhances the feature representation by learning the center or prototype of the category, which is particularly important when processing medical images with complex patterns [22]. Secondly, Prototypical Networks has strong generalization ability and can be well generalized to unseen data, which is crucial for accuracy and reliability in practical clinical applications. In addition, Prototypical Networks is insensitive to noise and outliers and shows good robustness, which is very beneficial for medical image processing that may contain noise. The decision-making process of the model is based on the category center, which not only improves the prediction accuracy of the model, but also enhances its explanatory power, helping doctors understand the diagnostic basis of the model. In terms of computational efficiency, Prototypical Networks typically have lower computational complexity than other complex classifiers, which makes them more practical in resource-constrained medical settings. At the same time, the adaptability of Prototypical Networks allows it to be adapted to different datasets and task requirements to improve classification performance [23].