# Hybrid Deep Learning Model for Cataract Diagnosis Assistance
## 3 Method
### Model Architecture
#### 3.3.1 Feature Enhancement  
The Squeeze-and-Excitation block (SE_block) mainly consists of two parts, which are Squeeze and Excitation [19]. The input for \(\mathbf{F}_{tr}\) in the structure is \(\mathbf{X}\), and \(\mathbf{X}\in\mathbb{R}^{H^{{}^{\prime}}\times W^{{}^{\prime}}\times C^{{}^{ \prime}}}\), and the output is \(U\), and \(U\in\mathbb{R}^{H\times W\times C}\), where \(F_{tr}\) is considered as a simple convolution operation, denoted by the formula \(V=[v_{1},v_{2},\dots,v_{c}]\), in which \(v_{c}\) represents the \(c\) convolution kernel; and the output is represented by the formula \(U=[u_{1},u_{2},\dots,u_{c}]\); then, there is  
\[u_{c}=v_{c}*X=\sum_{s=1}^{C^{{}^{\prime}}}v_{c}^{s}*x^{s} \tag{1}\]  
where \(*\) denotes the convolution, \(v_{c}=[v_{c}^{1},v_{c}^{2},\dots,v_{c}^{C^{{}^{\prime}}}]\), \(X=[x^{1},x^{2},\dots,x^{C^{{}^{\prime}}}]\), and \(u_{c}\in\mathbb{R}^{H\times W}\), \(v_{c}^{s}\) is a 2D spatial convolution, where the bias term is simplified. Typically, the correlation between channels is implicitly expressed by the summing of all channels, and this expression is intertwined with the capture of local spatial features. The sensitivity of the network to key information features cna be enhanced by explicitly defining dependencies between channels, which can then be effectively utilized at a deeper level of the network. Through this design, the network can not only learn local features, but also understand the global relationship between channels, so as to improve the ability of feature expression, and ultimately improve the performance of the entire network. The roles of the two phases (Squeeze and Excitation) are detailed below. The role of the Squeeze part is to obtain the global information embedding for each channel of the feature representation \(U\). In the SE_block, this is achieved by global mean pooling (GAP), where the average value of the features of each channel \(c\in 1,2,\dots,C\) is  
\[z_{c}=\mathbf{F}_{sq}(u_{c})=\frac{1}{W\times H}\sum_{i=1}^{W}\sum_{j=1}^{H}u_ {c}(i,j) \tag{2}\]  
The eigenvalues obtained by the above equation are global, and the resulting eigenvectors are global. The role of the Excitation section is to learn the feature weights of each channel in \(C\) through \(z_{c}\), and there are three main design principles: flexibility, simplicity, and non-exclusivity. Flexibility ensures that the weights obtained from learning have practical application value and can be adapted to different feature importance; simplicity ensures the training efficiency of the network after adding SE_blocks. Finally, we recognize that the relationships between channels are not completely independent, so our goal is to make the learned weights reinforce those features that are critical to the task while suppressing those that are less important. Based on these principles, the SE_block adopts a gating mechanism consisting of two fully connected layers, which dynamically adjusts the contribution of each channel. The gating unit \(s\) (i.e., the \(1\times 1\times C\) eigenvector in Figure 4) is calculated as follows:  
\[s=\mathbf{F}_{ex}(z,W)=\sigma(g(z,\mathbf{W}))=\sigma(g(  
After obtaining the gating unit \(s\), the final output \(\tilde{X}\) is represented as the vector product of \(s\) and \(U\), the operation \(F_{scale}(\cdot,\cdot)\) in Figure 4:  
\[\tilde{\mathbf{x}_{c}}=\mathbf{F}_{scale}(u_{c},s_{c})=u_{c}\cdot s_{c} \tag{4}\]  
where \(\tilde{\mathbf{x}_{c}}\) is a feature representation of a feature channel of \(\tilde{\mathbf{X}}\), and \(s_{c}\) is a constant in the gating unit \(s\). Spatial attention focuses on the importance of different areas in an image, i.e., how much a pixel value at a particular location contributes to a task. With spatial attention, the model can learn to focus attention on specific areas of the image to capture and emphasize important spatial features in the image, such as textures, shapes, edges, and more.