# Speckle Noise Removal in OCT Images via Wavelet Transform and DnCNN
## 2 Materials and Methods
### Correlation Function  
Image correlation serves as a quantitative method for assessing the inherent relationships between two images by measuring their similarity or statistical interdependence. As a foundational analytical tool in this domain, the cross-correlation function provides a canonical framework for similarity measurement, with its mathematical formulation essentially equivalent to convolution operations within normalized spatial domains.  
This formulation involves systematically sliding a template image across the target image while computing localized similarity metrics through pixel-wise multiplication and summation. The resulting correlation coefficients form a response surface where peak values indicate optimal template-target alignment positions, with magnitude reflecting the strength of structural correspondence.  
\[R(h,k)=\sum_{h,k}f(x,y)g(x-h,y-k) \tag{5}\]  
\(f(x,y)\) denotes the target image, \(g(x,y)\) represents the template image, and (\(h\),\(k\)) signifies the spatial displacement vector.  
The dual processing pathways independently generate images \(f\) and \(g\), reflecting inherent methodological discrepancies in their denoising paradigms. While complete noise elimination through dual-path processing remains unattainable due to the inherent stochasticity of noise contamination, we propose a correlation-guided refinement framework to mitigate residual artifacts while preserving critical texture information in OCT imagery.  
Correlation analysis confirms significant texture-related coherence between the processed images, particularly in structural regions of diagnostic relevance. Notably, the SWT applied to pathway g incorporates an additional decomposition level compared to pathway f, enabling superior preservation of microstructural details at lower spatial frequency bands. This architectural difference forms the basis for adaptive feature fusion.  
To achieve optimal noise-texture balance, a hybrid fusion strategy is implemented through spatially variant weight allocation. In low-correlation regions (\(R(h,k)<R_{1}\)), where noise dominance persists, the enhanced detail representation from pathway g is prioritized to maintain anatomical integrity. In high-correlation regions (\(R(h,k)\geq R_{0}\)),  
Figure 5: The process of the DnCNN network training.  
where signal reliability is confirmed, an arithmetic mean of both pathways is adopted to balance noise suppression and feature preservation. In intermediate-correlation regions (\(R_{1}\leq R(h,k)<R_{0}\)), a weighted preference toward pathway f is maintained to ensure perceptual continuity, as excessive detail inclusion from g may introduce interpretative ambiguity. This hierarchical fusion mechanism, formally described by Equation (6), ensures progressive integration of complementary features across spatial scales.  
\[D(x,y)=\left\{\begin{aligned} 0.5f+0.5g,R(h,k)\geq R_{0}\\ 0.7f+0.3g,R_{1}\leq R(h,k)<R_{0}\\ 0.3f+0.7g,R(h,k)<R_{1}\end{aligned}\right. \tag{6}\]  
The correlation coefficients \(R_{0}\) and \(R_{1}\) are set to 0.2 and 0.7 times the maximum correlation coefficient value, respectively. Here, f denotes the image generated through Pathway 1, while g represents the image produced via Pathway 2. This parameter configuration ensures balanced integration of texture features from both processing streams during image fusion.  
The resultant synthesis achieves effective suppression of stochastic noise components while maintaining diagnostic-grade structural fidelity. By prioritizing texture coherence in heterogeneous tissue boundaries, this approach demonstrates measurable improvements in image interpretability without compromising quantitative measurement accuracy.