# Accurate Landmark Localization for Medical Images Using Perturbations
## 3 Materials and Methods
### Overall Algorithms  
Algorithm 1 illustrates a meta-algorithm for the proposed landmark localization method. The label L\({}_{i}\) contains the information about k landmark positions, in the form ((x_1, y_1), (x_2, y_2),..., (x_k, y_k)). A hand X-ray image has 37 landmarks, so k = 37. A cephalometric image has 19 landmarks, so k = 19. Excluding line 4, Algorithm 1 is the same as the standard BP (back-propagation) learning algorithm. The output of Algorithm 1 is the learned neural network weight.  
```
Input: Train set I\({}_{i}\) (image) and L\({}_{i}\) (label set) for i = 1, 2,..., n, perturbation operation q. Output: Learned network weights.
1: Initialize network weights.
2: While network is not converged
3: For i = 1 to n.
4: I\({}^{\prime}_{i}\) = random perturbation of I\({}_{i}\) using Algorithm 2 with the operation q.
5: I\({}^{\prime}_{i}\) = random augmentation of I\({}^{\prime}_{i}\).
6: Perform forward computation with I\({}^{\prime\prime}_{i}\) and compute error e\({}_{i}\).
7: Back-propagate e\({}_{i}\) and update weights.
```  
**Algorithm 1** Network training with local feature perturbation  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Property** & \multicolumn{2}{c}{**Digital Hand Atlas**} & **ISBI 2015** \\ \hline Number of & \multirow{2}{*}{37} & \multirow{2}{*}{19} \\ landmarks & & & \\ \hline \multirow{4}{*}{Train set} & Fold 1 & 597 & \multirow{4}{*}{150} \\ \cline{2-3} \cline{5-5}  & Fold 2 & 597 & \\ \cline{2-3} \cline{5-5}  & Fold 3 & 596 & \\ \hline \multirow{4}{*}{Test set} & Fold 1 & 298 & \multirow{4}{*}{Test1 (validation): 150} \\ \cline{2-3} \cline{5-5}  & Fold 2 & 298 & \\ \cline{2-3} \cline{5-5}  & Fold 3 & 299 & \\ \hline Resolution & Variable (on average 1563 \(\times\) 2169) & \multicolumn{2}{c}{1935 \(\times\) 2400} \\ \hline \hline \end{tabular}
\end{table}
Table 1: Statistics of datasets.  
Line 4 deserves attention. The perturbation can be an operation that reduces the information of the input image. In our implementation, we used an operation of smoothing, blackout, whiteout, binarization, or edge detection for the perturbation. The perturbation operation is applied to a patch whose location and size are decided randomly, as explained in Algorithm 2. Algorithm 2 is described in detail in Section 3.3. After altering the patch in line 5, the augmentation is applied to the perturbed image. Rotation, translation, rescale, and color-jitter are applied as augmentation operations. The augmented image is used as input to the network in line 6. Figure 2 illustrates the altered image with each of the 5 perturbation operations.  
Figure 2: Visualization of perturbed images, (**a**) is the original image, (**b–f**) are the perturbed images, (**b**) is perturbed with blackout, (**c**) is perturbed with whiteout, (**d**) is perturbed with smoothing, (**e**) is perturbed with binarization, and (**f**) is perturbed with edge detection.  
Note that Algorithm 1 works in the online mode in generating a train sample. The online mode generates a train sample just before inputting the sample into the network. The online mode has the advantage that the size of train set can be considered unlimited.