# Deep Learning-Based Hip X-ray Image Analysis for Predicting Osteoporosis
## 3 Research Methods
### Experimental Design  
#### 3.4.1 Model Evaluation Indicators  
Using Intersection over Union (IoU) in object detection for image segmentation [32]. The IoU is calculated by dividing the intersection of two object images by the union, and when the experimental result is greater than or equal to 0.5, it will be regarded as a valid image segmentation result, and the IoU is calculated as the following Equation (2):  
\[\text{IoU}=\text{(Area of Overlap)}/\text{(Area of Union)} \tag{2}\]  
In the part of deep learning image classification, the common evaluation method is accuracy, but in medical and biological research, if we only rely on accuracy, the model evaluation may not be complete enough. Plus, other evaluation methods can make the model evaluation more complete. Before explaining the evaluation indexes of the other models, we will first define the confusion matrix of True Positive (TP), False Positive (FP), False Negative (FN), and True Negative (TN) to facilitate the calculation, as shown in Table 2 below.  
This study belongs to medical image classification, and there are four model evaluation indexes derived using a confusion matrix, which are accuracy, sensitivity, specificity, and  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**HipDataset** & **Data Augmentation Methods** & **Original Images** & **After Data Augmentation** & **Total Number of Images** \\ \hline \multirow{2}{*}{Femoral Neck} & rotation \(\rightarrow\pm 3^{\circ}\) & & 222 & \\  & shifting \(\to\)\(X\)-axis \(\pm\) 5, \(Y\)-axis \(\pm\) 5 & 111 & 444 & 777 \\ \hline \multirow{2}{*}{Greater Trochanter} & rotation \(\rightarrow\pm 3^{\circ}\) & & 114 & 399 \\  & shifting \(\to\)\(X\)-axis \(\pm\) 5, \(Y\)-axis \(\pm\) 5 & 57 & 228 & 399 \\ \hline \multirow{2}{*}{Ward’s Triangle} & rotation \(\rightarrow\pm 3^{\circ}\) & & 114 & 399 \\  & shifting \(\to\)\(X\)-axis \(\pm\) 5, \(Y\)-axis \(\pm\) 5 & 57 & 228 & 399 \\ \hline \multirow{2}{*}{Total Hip} & rotation \(\rightarrow\pm 3^{\circ}\) & & 222 & \\  & shifting \(\to\)\(X\)-axis \(\pm\) 5, \(Y\)-axis \(\pm\) 5 & 111 & 444 & 777 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison of data volume before and after data expansion.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{4}{c}{**True Condition**} \\ \hline  & **Total Population (T)** & **Positive** & **Negative** \\ \hline \multirow{4}{*}{Predicted condition} & Positive & True Positive (TP) & False Positive (FP) \\ \cline{2-4}  & Negative & False Negative (FN) & True Negative (TN) \\ \hline \multicolumn{4}{c}{**Four cases of confusion matrices**} \\ \hline True Positive (TP) & Positive diagnosis with real symptoms. \\ \hline False Positive (FP) & Positive diagnosis, but no symptoms. \\ \hline False Negative (FN) & The diagnosis is negative, but symptoms & are present. \\ \hline True Negative (TN) & The diagnosis was negative and symptom-free. \\ \hline \hline \end{tabular}
\end{table}
Table 2: Confusion matrix.  
F1-score. Each of the model evaluation indexes is defined in Table 3, and the relevant formulas are as follows in Equations (3)-(6):  
\[\text{Accuracy}=(\text{TP}+\text{TN})/(\text{TP}+\text{FP}+\text{FN}+\text{TN}) \tag{3}\]  
\[\text{Sensitivity}=\text{TP}/(\text{TP}+\text{FN}) \tag{4}\]  
\[\text{Specificity}=\text{TN}/(\text{TN}+\text{FP}) \tag{5}\]  
\[\text{F1-score}=2\text{TP}/(2\text{TP}+\text{FP}+\text{FN}) \tag{6}\]