# A Deep-Learning Approach for Diagnosis of Metastatic Breast Cancer in Bones from Whole-Body Scans
## 2 Materials and Methods
### Methodology  
In medical analysis, the use of CNNs is common, so we can identify with an automated algorithm whether a patient has bone cancer metastasis, or not. The CNN method for bone metastasis classification includes five processing stages (see Figure 2): obtain data from whole-body scans, data pre-processing to normalize the collected image data, CNN training, CNN validation and finally, CNN testing followed by the evaluation of the classification results, as presented in Section 4.3. The five stages of the proposed methodology are thoroughly presented in the following. **Stage 1: Obtain Data**  
The whole-body scans given by the nuclear medicine physician were in RGB (red, green, blue) mode and were stored in the PC memory. Depending on their class, whether they were normal or malignant, we assigned to them the equivalent prefix. This technique helped us to identify them inside the deep-learning algorithm and to pass them the correct output. Specifically we gave 0 to malignant images as output and 1 to benign ones. **Stage 2: Clean and Prepare Data**  
Step 2.1: Data normalization  
Data Normalization is used in every machine learning process. This procedure rescales the values of the data within the range of 0 and 1, while it is important to know or estimate accurately, the minimum and maximum observable values. The Min-Max normalization method has been selected as the most popular method, as regards the performance of the systems being examined. Moreover, reviewing the relevant literature, studies showed that the results' accuracy from this method is higher than of those being produced by other normalization methods [83]. The scale that all images are within zero and one also prevents having outliers which will confuse the algorithm. Step 2.2: Data shuffle  
From splitting the dataset into training and testing emerges the danger of choosing wrong samples for our algorithm, and so the solution to this problem is provided by the application of shuffling method. That gives a random order to the data. Step 2.3: Data split  
We split the available image data into three parts, which are training, validation and testing. Each partition has specific percentage, which had been taken from the whole dataset, meaning that 15% of the dataset was given to testing and 85% is for the other two parts, namely we split it 80% for training and 20% for validation. Therefore, three different datasets are created: Training, Validation and Testing datasets, respectively. **Stage 3: Training**  
Step 3.1: Data augmentation  
The method of data augmentation is usually used when we have a small number of data and we do not want to create a model that does not have generalization capabilities. For instance, with  
Figure 2: Five stages of the proposed methodology. the techniques of rescale, rotation range, zoom range and flip, we create variant images and we avoid overfitting. Step 3.2: Define CNN architecture  
To define a proper architecture of a CNN for image classification, an exploration process is followed. In the experimentation and trial phase, the most important parameters that can lead to effective network architecture were explored; the number and the type of convolutional layers, the number of nodes, the number of pooling layers, the filters, the drop rate and the batch size, the number of dense nodes. Step 3.3: Define the functions of the CNN architecture  
After a search in the relevant literature, the main functions of the CNN architecture are the activation function which is the function that defines the output of the layer, and the loss function which is the function that is used for the optimization of the network's weights. After thorough experiments illustrated in previous works, ReLU (rectified linear unit) is the most used activation function for convolutional layers and dense layers. As regards the output layer, Sigmoid is one of the most commonly used functions [78].