# Enhancing Neural Network Interpretability Through Deep Prior-Guided Expected Gradients
## 3 Methodology
### Multivariate Gaussian Model for Deep Priors  
This section presents the multivariate Gaussian model [25] for capturing image appearance priors. The MGM provides an intuitive probabilistic modeling approach particularly suitable for scenarios where feature space data of specific categories exhibits concentrated distributions. Our rationale for selecting MGM includes four key considerations:  
Compact Feature Representation: MGM compactly models feature spaces through first-order statistics, which are represented by the mean vector, and second-order statistics, which are encoded by the covariance matrix. The mean vector captures central tendencies, while the covariance matrix encodes linear correlations between feature channels, such as co-occurrence patterns of textures or colors. This explicit parameterization enables interpretable mathematical analysis: for example, eigenvalue decomposition of covariance matrices reveals principal variation directions that correspond to semantically significant regions.  
Computational Efficiency: With a complexity of \(O(NC^{2})\), where \(N\) denotes the pixel count and \(C\) the feature dimension, MGM requires only mean and covariance calculations. This contrasts with kernel density estimation (KDE), which involves \(O(N^{2})\) kernel evaluations, or variational autoencoders (VAEs), which rely on computationally intensive backpropagation during training. The efficiency of MGM makes it preferable for real-time applications like medical imaging analysis.  
Data Efficiency: Unlike overparameterized generative models (VAEs/GANs) prone to overfitting with limited data (e.g., rare disease imaging), MGM demonstrates superior performance in low-data regimes.  
Automatic Spatial Correlation: Off-diagonal covariance terms automatically capture global spatial statistics without manual neighborhood definition required in Markov random fields (MRFs). Cross-regional feature correlations reflect anatomical topology constraints, enhancing robustness to local deformations.  
Following the our proposed framework, we model appearance priors using final convolutional layer features. The implementation proceeds as follows:  
**Feature Flattening**: Given feature map \(\mathbf{F}\in\mathbb{R}^{B\times C\times H\times W}\), reshape into matrix \(\mathbf{F}^{\prime}\in\mathbb{R}^{N\times C}\) (\(N=H\times W\)) shown in Equation (11).  
\[\mathbf{F}^{\prime}=\text{reshape}(\mathbf{F},(-1,C)) \tag{11}\]  
**Parameter Estimation**: Compute mean vector \(\boldsymbol{\mu}\) and covariance matrix \(\boldsymbol{\Sigma}\) by Equation (12).  
\[\boldsymbol{\mu} =\frac{1}{N}\sum_{i=1}^{N}\mathbf{F}^{\prime}_{i} \tag{12}\] \[\boldsymbol{\Sigma} =\frac{1}{N-1}\sum_{i=1}^{N}(\mathbf{F}^{\prime}_{i}-\boldsymbol{ \mu})(\mathbf{F}^{\prime}_{i}-\boldsymbol{\mu})^{\top} \tag{13}\]  
**Probability Computation**: The multivariate Gaussian distribution is then defined by Equation (14).  
\[P(\mathbf{F}^{\prime})=\frac{1}{(2\pi)^{C/2}|\boldsymbol{\Sigma}|^{1/2}}\exp \left(-\frac{1}{2}(\mathbf{F}^{\prime}-\boldsymbol{\mu})^{\top}\boldsymbol{ \Sigma}^{-1}(\mathbf{F}^{\prime}-\boldsymbol{\mu})\right) \tag{14}\]  
Per-pixel class probabilities are subsequently obtained through Equation (15).  
\[P(\mathbf{F}^{\prime}_{i})=\frac{1}{(2\pi)^{C/2}|\boldsymbol{\Sigma}|^{1/2}} \exp\left(-\frac{1}{2}(\mathbf{F}^{\prime}_{i}-\boldsymbol{\mu})^{\top} \boldsymbol{\Sigma}^{-1}(\mathbf{F}^{\prime}_{i}-\boldsymbol{\mu})\right) \tag{15}\]  
The resultant probability distribution serves as the appearance prior for baseline enhancement, improving feature attribution interpretability through explicit modeling of feature co-occurrence patterns and spatial dependencies.