# Enhancing Feature Selection for Imbalanced Alzheimer's Disease Brain MRI Images by Random Forest
## 3 Design of Imbalanced AD Medical Data Analysis Approach
### The Feature Extraction
#### 3.1.1 Morphological Feature Extraction
The DARTEL algorithm obtains the corresponding deformation field by exponentiating the flow field, which ensures that the determinant of the Jacobian matrix is always positive while obtaining the deformation field so that the registration result is diffeomorphic;  
Step 2: Brain tissue segmentation. After the processing of spatial normalization, the images are segmented into gray matter (GM), white matter (WM), and cerebrospinal fluid (CSF);  
Step 3: Spatial smoothing. Spatial smoothing is a filtering process, based on images of the different tissue in segments. In this process, a Gaussian kernel function is used to convolve image data in the standard space. The purpose of the smoothing is to eliminate subtle matching errors and improve the signal-to-noise ratio;  
Step 4: Defining ROI binary image. At present, VBM statistical analysis is based on a generalized linear model. It performs a two-sample \(t\)-test on the hypothesis to detect whether there is a significant difference in the density of certain regions of the gray matter images between the two groups. The gray matter density regions with significant differences are identified as an area of interest. The two-sample \(t\)-test was used to analyze whether there are significant differences between the brain medical image data of normal people and those with AD lesions and to identify the brain regions with more serious differences. The process is as follows:  
Original hypothesis \(H_{0}\): assume that the population means values of the 2 samples are equal. Alternative Hypothesis \(H_{1}\): assume that the population means values of the 2 samples are not equal. The \(t\)-value is calculated in the 2-sample statistical test as shown in Formula (5):  
\[t=\frac{\overline{X}_{1}-\overline{X}_{2}}{S_{\overline{X}_{1}-\overline{X}_{ 2}}} \tag{5}\]  
In Formula (5), \(\overline{X}_{1}\) and \(\overline{X}_{2}\) represent the population means values of the 2 independent samples, respectively. The solution of \(S_{\overline{X}_{1}-\overline{X}_{2}}\) is shown in Formula (6):  
\[S_{\overline{X}_{1}-\overline{X}_{2}}=\sqrt{\frac{(n_{1}-1)S_{1}^{2}+(n_{2}-1 )S_{2}^{2}}{n_{1}+n_{2}-2}\bigg{(}\frac{1}{n_{1}}+\frac{1}{n_{2}}\bigg{)}} \tag{6}\]  
In Formula (6), \(S_{1}^{2}\) and \(S_{2}^{2}\) represent their sample variances, respectively, and their calculation methods are shown in Formulas (7) and (8). \[S_{1}^{2}=\frac{1}{n_{1}}\sum_{i=1}^{n_{1}}\big{(}X_{1i}-\overline{X}_{1} \big{)}^{2} \tag{7}\]  
\[S_{2}^{2}=\frac{1}{n_{2}}\sum_{i=1}^{n_{2}}\big{(}X_{2i}-\overline{X}_{2} \big{)}^{2} \tag{8}\]  
where \(n_{1}\) and \(n_{2}\) represent the total numbers of sample 1 and sample 2, respectively. In the case of a certain significance level, according to the \(t\) critical value table, if \(t\) is greater than the critical threshold, then the result is to reject \(H_{0}\) and accept \(H_{1}\), which proves that there is a significant difference between the 2 sample populations. A two-sample \(t\)-test was performed on different groups of AD brain medical image data by VBM to detect the regions where they have significant differences;  
Step 5: Gray matter volume calculation. After VBM analysis, the ROI of the lesion area was obtained. The ROI binary masks were made by using the WFU_PickAtlas ([[https://www.nitrc.org/projects/wfu_pickatls](https://www.nitrc.org/projects/wfu_pickatls)]([https://www.nitrc.org/projects/wfu_pickatls](https://www.nitrc.org/projects/wfu_pickatls)), accessed on 10 September 2021). Because the two MRI images for dot product calculation must have the same dimension, the ROI binary masks additionally needed to be resampled to have the same dimensions as the gray matter image. Then the resampled ROI binary mask and the gray matter image were implemented in the dot product calculation to obtain a gray matter volume.