## 4 Machine-Learning Techniques for Diagnosing and Analyzing Hairy Scalps
### Scale-space Peak Selection  
The SIFT algorithm identifies the interesting points in different scale spaces. By multiplying the Gaussian kernel with input images, we can obtain different scale spaces. Equation (23) shows the two-dimensional variable scale space's Gaussian function and Equation (24) shows the scale-space. \[G(x,y,\sigma) =\frac{1}{2\pi\sigma^{2}}e^{-(x^{2}+y^{2})/2\sigma^{2}} \tag{23}\] \[L(x,y,\sigma) =G(x,y,\sigma)*I(x,y) \tag{24}\]  
where \(L(x,y,\sigma)\) is the result of the convolution operation with an input image \(I(x,y)\) and the two-dimensional space's Gaussian function and \(\sigma\) is the standard deviation. If the value of \(\sigma\) increases, then the image will be blurred, and vice versa. Multiple Gaussian scale spaces can be obtained by using the convolution operation on an original image and varying \(\sigma\). Figure 12 shows that the Gaussian pyramid is constructed by different octaves. Figure 13 shows the four octaves of a dandruff image and five standard deviations in each octave. The images in the same octave are the same size but have different standard deviations. Figure 12: Difference-of-Gaussian (DOG). For example, at the bottom of octave1, the \(\sigma\) value is the lowest and the upper layer is \(k\) times \(\sigma\). As \(\sigma\) increases, a variety of scale spaces can be obtained. For different octaves, the next octave is obtained by down-sampling the previous octave. Based on the Gaussian pyramid, the DOG can be generated by subtracting two adjacent images in the same octave. Comparing 26 neighbor pixels of the candidate pixel (as shown in the right side of Figure 10) can obtain a feature point as the local maxima and minima in the DOG space. The 26 neighbor pixels include the 18 pixels of the up and down layer of DOG and the 8 pixels at the current layer of DOG. To identify stable key points within the scale space, the DOG scale-space is obtained by convoluting different DOG kernels and original images as shown in Equation (25). \[D(x,y,\sigma)=(G(x,y,k\,\sigma)-G(x,y,\sigma)*I(x,y))=L(x,y,k\,\sigma)-L(x,y,\sigma) \tag{25}\]  
(b)Key Point Localization  
Because all local maxima and minima in the DOG space are not feature points, many redundant points must be removed. [PERSON] and [PERSON] [PERSON] and [PERSON] (2016) proposed using the Taylor expansion of the scale-space function (as shown in Equation (26)) to increase the accuracy of identifying feature points by removing candidate points that have low contrast. \[D(x,y,\sigma)=D(x,y,\sigma)+\frac{\partial D^{T}}{\partial x}x+\frac{1}{2}x^ {T}\frac{\partial^{2}D}{\partial x^{2}}X \tag{26}\]  
where \(x=(x,y,\sigma)^{T}\) is the offset from the local maxima or minima sampled. Then, the derivative of Equation (26) is applied and set to zero. The accurate location of the local maxima or minima sampled can be obtained as \(\hat{x}\) as shown in Equation (27). \[\hat{x}=-\frac{\partial^{2}D^{-1}}{\partial x^{2}}\frac{\partial D}{\partial x} \tag{27}\]  
Then, we place Equation (27) into Equation (26), and the result of the first two items is shown in Equation (28). \[D(\hat{x})=D(x,y,\sigma)+\frac{1}{2}\frac{\partial D^{T}}{\partial x}\hat{x} \tag{28}\]  
Finally, the value of \(D(\hat{x})\) at the minima or maxima must be larger than the threshold as shown in Equation (29). \[|D(\hat{x})|>\text{threshold} \tag{29}\]  
Figure 13: Dandruff image is displayed at four octaves with five standard deviations. If the value of \(\left\lvert D(\hat{x})\right\rvert\) is less than the threshold, then those points are unstable and can be removed. Removing the interesting points with low contrast is insufficient because of the strong response at the image edges within the difference of the Gaussian function. Two situations were observed: when the principle curvature is large across the edge and when the principle curvature is small on the perpendicular edge. Therefore, [PERSON] used the 2*2 Hessian matrix to create the principle curvatures. The Hessian matrix is shown in Equation (30). \[\mathrm{H}=\left[