zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 452 forks source link

Training & Finetuning on Custom Data #372

Open ghost opened 3 years ago

ghost commented 3 years ago

Hi,

Apologies if this has been asked before.

I have a custom data with ~700 tagged images, total number of classes are 15.

I have trained a model using the following combination (this gives the best results so far);

python train_dist.py --dataset ADE20K --model EncNet --aux --se-loss --backbone resnest101 --epochs XXX

It is giving okay-ish results. I understand the data is too less to expect pretty good results but the classes are rather simple and I cannot afford more data. I want to fine-tune (or maybe overfit) to my custom data for demonstration purpose. But, whatever I try so far, it just doesn't get any better.

Can you suggest any best practices, suggestions on how can I fine-tune to my particularly small data-set?

Thank you!

zhanghang1989 commented 3 years ago

For small datasets, consider pre-training on similar public datasets and then fine-tune it. You may also try to reduce the learning rate, which maybe helpful.

ghost commented 3 years ago

Hi, Thanks for you response.

Sadly, there aren't any public datasets available for the use case I am working on.

I was thinking the following;

  1. Taking a pretrained model on COCO or ADE dataset and do finetune on the smaller dataset I have.
  2. Use my current dataset (~800 images now) and create difference variations for each image and increase the dataset in size and then train it..not sure whether it would make any difference or not.

Any feedback is much appreciated.