# Multi-Channel Surface EMG Spatio-Temporal Image Enhancement Using Multi-Scale Hessian-Based Filters
## 2 Materials and Methods
### Filter for Enhancing the MUAP Propagation Region
The bright line-like structure on grey background for each pixel is represented by a high negative magnitude of second eigenvalue and a low absolute first eigenvalue. Based on these eigenvalues, a higher response filter for the line-like region can be defined as having almost zero response in the background. To track the MUAP propagation for varying grey levels and varying widths, the Hessian is approximated using a Gaussian kernel with varying scales (scale space theory) [20; 25]. The Gaussian Kernel can be represented as:  
\[G(x,y)=\frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{x^{2}+y^{2}}{2\sigma^{2}}} \tag{6}\]  
where \(\sigma\) is the width of the Gaussian vertical to the axis of the MUAP structure. The Hessian matrix of each pixel of an image is analytically given as:  
\[H(x,y)=\left[ \begin{array}{cc}\frac{\partial^{2}}{\partial x^{2}}I(x,y)& \frac{\partial^{2}}{\partial x\partial y}I(x,y)\\ \frac{\partial^{2}}{\partial y\partial x}I(x,y)&\frac{\partial^{2}}{\partial y ^{2}}I(x,y)\end{array} \right] \tag{7}\]  
In scale space theory, the Hessian is computed by the convolution of the sEMG spatio-temporal image with the second-order derivatives of the Gaussian, described in Equation (6) for a chosen scale \(\sigma_{\rm k}\). Mathematically, this approximation of the Hessian is as follows [18; 19]:  
\[H(x,y,\;\sigma_{k})=\left[ \begin{array}{cc}\sigma_{k}^{\gamma}I(x,y)*\frac {\partial^{2}}{\partial x^{2}}G(x,y)&\sigma_{k}^{\gamma}I(x,y)*\frac{\partial^ {2}}{\partial x\partial y}G(x,y)\\ \sigma_{k}^{\gamma}I(x,y)*\frac{\partial^{2}}{\partial y\partial x}G(x,y)& \sigma_{k}^{\gamma}I(x,y)*\frac{\partial^{2}}{\partial y^{2}}G(x,y)\end{array} \right] \tag{8}\]  
where \(\gamma\) is a parameter used for normalization [25]. The \(\sigma_{k}\) is the scaling factor proportional to the width of the MUAP structure in sEMG images. Using the eigenvalue decomposition, the Hessian of each pixel of the sEMG image is decomposed to eigenvectors and eigenvalues. Let these eigenvalues for the 2D sEMG image be \(\lambda_{1}\) and \(\lambda_{2}\), such that \(|\lambda_{1}|<|\lambda_{2}|\), with associated eigenvectors V1 along the MUAP structure while V2 is normal to the MUAP structure. As shown in Section 2.1., the \(\lambda_{1}\) is zero while the \(\lambda_{2}\) is negative inside the bright tubular structure, thus classifying a pixel as either belonging to MUAP or the background region. A filter is now designed to enhance the MUAP structure by first calculating the norm (\(N\)) of the Hessian, as given below:  
\[N(x,y)=abs(\lambda_{1}+\lambda_{2}) \tag{9}\]  
The response of the proposed filter which enhances the bright portion of the sEMG image is as follows:  
\[V^{+}(S(x,y),\sigma_{k})=\left\{ \begin{array}{c}e^{-\frac{R_{B}^{2}}{2\alpha ^{2}}}\\ 0\;otherwise\end{array} \right.\left(1-e^{-\frac{N^{2}}{2\alpha^{2}}}\right)if \;\lambda_{2}<0 \tag{10}\]  
where \(R_{B}=\lambda_{1}/\lambda_{2}\). This ratio is nearly zero for the MUAP region with smaller value of \(\lambda_{1}\) and larger absolute value of \(\lambda_{2}\). The value of parameters \(\alpha\) and c are adjusted to the scale response of the filter. The multiplication operation (Equation (10)) ensures that the pixel corresponding to the MUAP region is enhanced only. Both factors of the product are nearly equal to one for the pixel belonging to MUAP region, and otherwise equal to zero for the background. This filter response is calculated for \(\sigma_{k}\) of the Gaussian kernel with varying pixels ranging between 1 and 10. This range is chosen according to the possible widths of the MUAP [3]. When the width of the MUAP is like the \(\sigma_{k}\), then the filter output (Equation (10)) is the highest value, which is the desired output. Thus, the final response is:  
\[V_{0}^{+}(x,y)=\max(V^{+}(S(x,y),\sigma_{k})) \tag{11}\]  
Similarly, the Hessian matrix for the dark region (negative signal amplitude) of the MUAP propagation is estimated and the corresponding eigenvalues are obtained.