# A Deep-Learning Approach for Diagnosis of Metastatic Breast Cancer in Bones from Whole-Body Scans
## 2 Materials and Methods
### Methodology
Step 3.4: Train CNN  
As the name indicates, training a CNN means training the model with images offering the opportunity to learn patterns, as the more differentiated the training is, the better the model becomes. The training process begins when the algorithm tries to create a function that describes the desired relation, based on the training data. Afterwards, it makes predictions based on this function (it is an error function) and moves to the validation step. **Stage 4: Validation**  
The validation dataset is used exclusively for the validation process. During validation, the weights are normalized, and the algorithm makes predictions on already known data. During the validation process, the main aim is to minimize the error which reveals the prediction efficiency of the proposed method. **Stage 5: Testing/Evaluation**  
After the completion of the training and validation phases, the best learned model is deployed for the testing/evaluation process [84; 85]. The evaluation process for the CNN model is accomplished using the testing data, as initially split, which is completely unknown to the model. During the testing phase, we check whether our classifier can make correct labeling to bot familiar images thus assessing the predictive ability of the current model. The classifier makes predictions on each image's class and finally compares the calculated predicted class to the true class. Next, for classifier evaluation, some well-known and popular performance metrics, such as the testing accuracy, precision, recall, sensitivity, specificity and f1-score of the model are computed, and accompanied by employing an error/confusion matrix for further model evaluation [84; 86; 87]. **3. The Proposed CNN Architecture**  
The main goal of this research study is to create a deep neural network, and particularly, a CNN to precisely identify bone metastasis from whole-body scans, in women suffering from breast cancer. The developed CNN, which was applied in bone scintigraphy to automatically identify bone metastasis, will prove its ability to provide high accuracy with low computation time for whole-body image prediction. In the CNN exploration process, we had to experiment with different values for our parameters like pixels, epochs, drop rate, batch size, number of nodes and layers [79; 80; 88; 89]. After a large number of experiments conducted with the aforementioned values, the best CNN architecture was derived. Actually, the best architecture consists of three convolutional layers followed by max pooling and dropout layer every time. Following the above layers, flatten comes next, along with the dropout layer. Then one dense layer is shown, and, in the end, the output layer takes over (see Figure 3). Table 1 summarizes all the information about the relevant architecture. The proposed CNN architecture has an image input size of \(256\times 256\) pixels, and we pass the images in RGB mode. Three convolutional layers are present, where the max pooling and the dropout layers follow each one of them. It needs to be highlighted that all convolutional layers use ReLU as activation function and the values of filters are doubled for every convolutional layer. This means that the first convolutional layer has 8 filters, the second layer has 16 layers and so on, while all of them have a \(3\times 3\) pixels kernel size. Furthermore, all pooling layers retain their max values and have \(2\times 2\) pixels size. In addition, dropout layers have the value 0.7 as their drop rate parameter. Next, the flatten layer follows to convert the data into one dimension; hence, the data are ready for the fully connected layer [90]. In the next phase, the dropout layer takes over, having the same value for drop rate, and helps the model to avoid overfitting. Next, the fully connected layer takes control of the data, comprising 64 nodes and ReLU as activation function. Finally, yet essentially, there is the output layer which has one (1) node as it deals with binary classification and contains the Sigmoid as activation function.