|
1 | 1 | # MLE-Image-Classification |
2 | 2 | Meta-learning ensemble framework for image classification with convolutional neural networks |
| 3 | + |
| 4 | + |
| 5 | +## Purpose |
| 6 | +This project creates an ensemble of CNN models for the MINST, Fashion-MNIST, and CIFAR10 dataset. The predictions from the ensemble are evaluated by a CNN super-learner and a weight matrix optimized by a genetic algorithm. |
| 7 | + |
| 8 | + |
| 9 | +A special case is used for binary classification where a MLP detects errors in the aggregation of prediction matrices and flips the final predictions accordingly. |
| 10 | + |
| 11 | +All base learners in the ensemble are saved to disk along with the prediction matrices and final predictions from the GA and CNN meta learners. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Set-up |
| 16 | +### Set up a virtual environment ([source](https://docs.python.org/3/tutorial/venv.html#virtual-environments-and-packages)) |
| 17 | +*A virtual environment, a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages.* |
| 18 | + |
| 19 | +**Unix/MacOS** |
| 20 | +* `python3 -m pip install --user virtualenv` - if you don't have virtualenv installed |
| 21 | +* `python3 -m venv venv` - Create a virtual environment |
| 22 | +* `source venv/bin/activate` - Activate virtual environment |
| 23 | +* `python3 -m pip install -r requirements.txt ` - Install required libraries for project |
| 24 | + |
| 25 | +**Windows** |
| 26 | +* `py -m pip install --user virtualenv` - if you don't have virtualenv installed |
| 27 | +* `py -m venv venv` - Create a virtual environment |
| 28 | +* `.\venv\Scripts\activate` - Activate virtual environment |
| 29 | +* `py -m pip install -r requirements.txt ` - Install required libraries for project |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Config settings |
| 34 | +The project uses `dafault.ini` to set configurations for dataset, ensemble and GA prediction. The following table shows the allowed values for the configurations: |
| 35 | + |
| 36 | +| Section | Setting | Allowed values | Description | |
| 37 | +|----------|----------------------|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------| |
| 38 | +| General | Dataset | any one of MNIST, MNIST_BIN, F_MNIST, F_MNIST_BIN, CIFAR10, CIFAR10_BIN | Dataset to use | |
| 39 | +| General | ValidationProportion | decimal number in range [0.0, 1.0]. Recommended 0.2 | Proportion of training data to use to train meta-learners | |
| 40 | +| Ensemble | Type | full or stacked | full: no meta-learner and full training set is used to train ensemble; stacked: validation data is left for training meta-learners | |
| 41 | +| Ensemble | NumBaseLearners | Any positive integer > 2. Recommended a value above 30 | Number of base learners in ensemble | |
| 42 | +| Ensemble | UseDynamicLoss | True or False | Boolean value specifying whether or not to use dynamic loss to train base learners in the ensemble | |
| 43 | +| Ensemble | DynamicLossThreshold | decimal number in range [0.0, 1.0]. Recommended a value between 0.6 and 0.9 | Threshold to use for dynamic loss | |
| 44 | +| GA | GAGenerations | Any positive integer. Recommended a value above 150 | Number of generations to run GA meta-learner for | |
| 45 | +| GA | GAPopulation | Any positive integer. Recommended a value above 100 | Population to maintain in GA optimizer | |
0 commit comments