# A Preprocessing Method for Coronary Artery Stenosis Detection Based on Deep Learning
## 2 Materials and Methods
### HFV Filter  
Enhancement filters are crucial for boosting vessel segmentation efficiency in medical imaging. Commonly used techniques focus on differential information, such as the second derivative or the Hessian matrix, to highlight vessel structures in images. These methods utilize differential analysis to enhance the visibility of blood vessels, making them essential for medical image segmentation and analysis.  
This method is based on the eigenvalues analysis of the Hessian matrix \((H(x,y))\) to determine the presence of vessel-like structures in the image. Denote the source image as \(I(x,y)\), and then the Hessian matrix is made continuous by convolving it with a two-dimensional (2D) Gaussian filter for images. Equation (1) presents the convolution of the Gaussian filter with the Hessian of image \(I(x,y)\) using convolution.  
\[H(x,y)\approx G*\begin{bmatrix}\frac{\partial^{2}I}{\partial x^{2}}&\frac{ \partial^{2}I}{\partial x\partial y}\\ \frac{\partial^{2}I}{\partial y\partial x}&\frac{\partial^{2}I}{\partial y^{2} }\end{bmatrix}=\begin{bmatrix}\frac{\partial^{2}G}{\partial x^{2}}&\frac{ \partial^{2}G}{\partial x\partial y}\\ \frac{\partial^{2}G}{\partial y\partial x}&\frac{\partial^{2}G}{\partial y^{2} }\end{bmatrix}*I(x,y) \tag{1}\]  
The analysis of the sign and magnitude of the Hessian eigenvalues can be used to improve the local image structure. Thus, the eigenvalues and eigenvectors of \(H(x,y)\) are calculated to obtain information about the contrast and direction at each point of the image. The eigen decomposition generates 2 eigenvalues, which are \((\lambda_{1},\lambda_{2})\), and the corresponding 2 eigenvectors \((\vec{u}_{1},\vec{u}_{2})\). These parameters are analyzed to distinguish the blob-like, tubular, or plate-like structure in the image. Because we are interested in the blood vessel-like structures in the image, these structures are represented by the relation of \(|\lambda_{1}|\approx 0\), \(|\lambda_{1}|\ll|\lambda_{2}|\), and \(\vec{u_{1}}\) points toward the direction of the vessel. In addition, \(\lambda_{2}\) is negative if the vessels appear as glowing tubular structures in dimly lit areas. This signature information is used as a consistency check to exclude other structures existing in the image. The Frangi vesselness function is defined as follows:\[\mathrm{F}(v)=\begin{cases}0&\text{if }\lambda_{2}>0,\\ e^{-\frac{R_{B}v^{2}}{2\beta^{2}}}\left(1-e^{\frac{\beta^{2}}{2\lambda^{2}}}\right)& \text{otherwise,}\end{cases} \tag{2}\]  
where  
\[R_{B}=\frac{|\lambda_{1}|}{|\lambda_{2}|},\qquad S=\sqrt{\lambda_{1}^{2}+ \lambda_{2}^{2}} \tag{3}\]  
The parameter \(R_{B}\) is the measure of eccentricity of the object in a 2D image. \(S\) is the measure of structureness and is used to obtain the background area. The contrast in the background is lowest because of the absence of any structure. \(S\) is also low for the background and high for the region with structures. \(\beta\) and \(c\) are thresholds to control the sensitivity of the line filter with respect to the parameters \(R_{B}\) and \(S\). The value of \(\beta\) can be set at 0.5, whereas the value of c depends on the gray level intensity of the vessels. This filter is applied to the image to obtain the response value for each pixel. The response values are higher for the pixels belonging to the vessels and vice versa.