All the dependencies are packaged in environment.yml
that can be installed using conda.
conda env create -f environment.yml # install dependencies
conda activate buic # activate encironment
The Breast Ultrasound Images dataset can be downloaded here.
Before running the experiments, please download the dataset and unzip it to this directory.
Please run the script prepare_data.py
.
This script performs the following tasks:
- Loads and resize images to
$128 \times 128$ pixels. - Randomly shuffles the data.
- Splits the data into training, validation, and test sets (ratio:
$80:10:10$ ) while preserving class proportions. - Saves each prepared set as a NumPy array in folder
data128
.
Scripts tune_unet.py
and tune_cnn.py
explore a range of hyperparameters and model structures to identify the optimal settings for the U-Net and CNN model, respectively.
The optimal configurations will be written to the output .txt
files.
Scripts train_unet.py
and train_cnn.py
train the U-Net and CNN model using the optimal configuration, respectively.
The best models will be saved under the same directory.
Script test.py
evaluates the saved models and prints the confusion matrices and classification report (accuracy, precision, recall and F1-score) on the validation set and the test set.