Ensemble classifier layers for a single deep neural network
We recommend starting with creating a Python virtual environment and installing the most recent stable version of PyTorch, e.g.:
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Then install additional requirements using pip:
pip install -r requirements_pip.txt
The primary dataset used for development and testing this classifer ensemble method was the Airbus Ship Detection dataset. This dataset can be downloaded and used directly. The dl.py
labels image IDs with pixel coordinates as true
and those without false
.
To start training a classifier ensemble, start train_clf.py
from the commmand line. An example of the options used to train using the Airbus Ship Detection dataset with EfficientNet-B0:
python train_clfs.py --dir ./airbus-ship-detection/train_v2/ --csv ./airbus-ship-detection/train_ship_segmentations_v2.csv --model_type EFFICIENTNET-B0 --clf_out ./clf_out
A similar set of options can be used to train the meta-learner, e.g.:
python train_meta.py --dir ./airbus-ship-detection/train_v2/ --csv ./airbus-ship-detection/train_ship_segmentations_v2.csv --model_type EFFICIENTNET-B0 --data_in ./clf_out --data_out . --ens_num 10 --ens_type xgboost
Then the ensemble can be applied to classify the dataset:
python train_meta.py --dir ./airbus-ship-detection/train_v2/ --csv ./airbus-ship-detection/train_ship_segmentations_v2.csv --model_type EFFICIENTNET-B0 --data_in ./clf_out --ens_num 10 --ens_type xgboost
Use command line option --help
for more input options for training the classifiers and meta-learner.