Authors: Akash Singha Bappy, Mitun Kanti Paul, Tanvir Shuvo
Motivation: In some application domains, we cannot get a large amount of data, which makes it difficult or even impossible to train the deep learning models from scratch. One common approach to address this problem is transfer learning. Researchers attempt to address this problem with transfer learning.
- Understand what is transfer learning, and why transfer learning can help to address this problem.
- Goal: Improve the performance in remote sensing application with small dataset via transfer learning.
-
database: Database-related files.
-
datasets: Datasets used in the project.
-
Mini-ImageNet: Mini-ImageNet dataset of 100 classes.
- train_train: Train subset of 64 class.
- train_val: Validation subset of 64 class.
- train_test: Test subset of 64 class.
- val: Val subset(not used).
- test: Test subset(not used).
-
EuroSAT_RGB_100: EuroSAT dataset of (5 class * 20 images) = 100 images
- Five class folders
-
EuroSAT_PR: EuroSAT_RGB_100 dataset splitted into [25,25,50:Train,Val,Test] ratio.
-
-
logs: Log files of hyper-parameter tuning.
-
models: Model files in .pth format
-
plots: Plots and visualizations.
- not pretrained: Plots for models without pretraining.
- Pretrained: Plots for pretrained models.
-
src: Source code files.
- configs.py: cofigurations of project.
- utils.py: Utility functions.
- download_dataset.py: Data download functions.
- data_loader.py: Dataloader functions.
- models.py: Models definition.
- logger.py: Defining logger.
- train.py: train and evaluation functions.
- hyp_tune_miniimagenet.py: Objective function Definintion for Mini-ImageNet.
- hyp_tune_eurosat.py: Objective function Definintion for EuroSAT.
-
run_tuning_miniimagenet.py: Run hyper-parameter tuning on Mini-ImageNet.
-
run_tuning_eurosat.py: Run hyper-parameter tuning on EuroSAT.
-
train_miniImagenet.py: Run trainig and testing on Mini-ImageNet.
-
training_EuroSAT.py: Run trainig and testing on EuroSAT.
-
requirements.txt: pip install requirements.txt.
-
readme.md: ReadMe file.
This project centers on applying transfer learning to enhance the efficacy of deep learning models for remote sensing applications, specifically addressing challenges posed by limited datasets. The primary datasets utilized are Mini-ImageNet, a subset designed for few-shot learning, and EuroSat-RGB, a benchmark dataset for land use classification. The ResNet-50 architecture is chosen as the primary model for Mini-ImageNet training, with preliminary exploration involving ResNet-18 and VGG16. Key steps involve data preparation, preprocessing with augmentation techniques, model selection, hyperparameter optimization using Optuna, and iterative training processes for both Mini-ImageNet and EuroSat. The project aims to demonstrate the potential of transfer learning in overcoming data scarcity issues in remote sensing, providing valuable insights and outcomes for real-world applications.
The installation is pretty much straight forward. all of the dependencies are included in requirement.txt in the root directory. So running the following command in terminal will install all the necessary dependencies.
pip3 install -r requirement.txt
while running the traning the dataset will be downloaded from a dropbox link automatically. So no setup necessary for dataset whatsoever.
As we used optuna for hypermeter auto optimizations, a range of the parameters can be set in the run_tuning_miniimagenet.py
and run_tuning_eurosat.py
. All the input variables are written in capital cases to find them easily.
To train the model with a specific hyperparametere configaration, the variable values can be set in train_miniImagenet.py
and training_EuroSAT.py
to run any script, navigate to the root directory and run like the following manner.
python run_tuning_miniimagenet.py
the code structure is in modular form so the funnctions and classes which are reused in multiple scripts are written separatelty and kept in src folder.
This project is licensed under the MIT License.