## 2 Proposed Method
### Pre-Processing  
#### 2.1.1 Method of Selection  
The principle of the top-bottom hat transformation is to utilize the morphological transformation of the image, which could retain some features of the image that can adapt to the structural elements, and remove features that cannot adapt to the structural elements [26]. The implementation process of the top-bottom hat transformation is as follows:  
\[f_{T}(x,y) = f(x,y)-\left[(f(x,y)\Theta S)\oplus S\right] \tag{1}\] \[f_{B}(x,y) = \left[(f(x,y)\oplus S)\Theta S\right]-f(x,y) \tag{2}\]  
Here, \(f(x,y)\) is the input image, \(S\) is the selected structural element, \(f_{T}(x,y)\) is the result of the top hat transformation, \(f_{B}(x,y)\) is the result of the bottom hat transformation.  
The opening operation of the input image excludes the bright details smaller than the structural elements, selects the appropriate structural elements for the top hat transformation, highlights the information of AD, and then performs the bottom hat transformation to obtain the trough information filled by the closed operation, and highlights dark areas in the image. Therefore, after the top-bottom hat transformation, the bright areas are made brighter and the dark areas are made darker, which enhances the contrast of the image. The result is shown in Figure 2.  
In Figure 2, the structural elements use \"line\", it shows that the length has an effect on the image contrast. As the length increases, the gray value of some areas in the image become unusual big, which will cause some lesion areas to be lost when detecting AD. However, the angle has almost no effect on the image contrast. In this paper, the best enhancement effect is obtained when the structural elements use \"line\", the length is 100 and the angle is 100 degrees.  
The contrast of the mammograms after the top-bottom hat transformation is somewhat enhanced, but in order to detect AD more accurately, the contrast of the mammograms needs to be further enhanced. Therefore, this paper chooses the exponential transformation, also known as the Gamma transformation. The Gamma transformation is a nonlinear transform. When \(\gamma>1\), the dynamic range  
Figure 2: (**a**) Original region of interest (ROI); (**b**) AD area marked by expert; (**c**) top–bottom hat transformation result (length 50, angle 100); (**d**) top–bottom hat transformation result (length 100, angle 100); (**e**) top–bottom hat transformation result (length 200, angle 100); and (**f**) top–bottom hat transformation result (length 100, angle 130).  
of the low gray value area of the image becomes smaller, and the dynamic range of the high gray value area becomes larger, therefore, the image contrast of the high gray value area is increased, and the image contrast of the low gray value area is reduced. When \(\gamma<1\), the opposite is true [27]. In this paper, \(\gamma=2.5\) is set based on experience, the enhancement effect of the mammograms is shown in Figure 3.  
In Figure 3, the image contrast has been enhanced obviously through the top-bottom hat transformation and the Gamma transformation. This result is very helpful for the subsequent detection of AD.