This project implements a multilayer perceptron (feedforward artificial neural network) from scratch in order to predict whether a cancer is malignant or benign on a dataset of
breast cancer diagnosis in the Wisconsin.
It is divided in two parts:
- The Training part will train the neural network
- The Prediction part will make predictions using the trained neural network
The neural network is composed of 4 layers:
- The input layer containing 30 neurons
- A first hidden layer containing 21 neurons
- A second hidden layer containg 21 neurons
- The output layer containing 2 neurons
The neural network is trained using backpropagation and gradient descent, and can early stop if necessary in order to avoid overfitting.
The program takes a dataset in input, splits it into a training part and a validation part, and then trains the neural network while displaying the loss and validation loss at each step as well as a graph showing their evolution during the learning process at the end.
The model is saved (network topology and weights) at the end of the execution.
From the root of the repository run python3 mp_train.py resources/data.csv.
The program will load the weights learned in the Training part, perform a ion on a given set, then evaluate it using the binary cross-entropy error function as well as some other metrics.
From the root of the repository run python3 mp_.py resources/data.csv.