Search code examples
neural-networkobject-detectionpre-trained-model

Is it important to pre-train a model by using meaningless classes?


If I want to train an object-detecion model which can detect 5 classes in the picture, Is it important to pre-train this model in a large dataset like coco(80 categories of objects),or just take 5 categories of coco to pre-train this model(assuming these 5 categories can be found in coco)?


Solution

  • If the 5 classes that you want to detect are already in the MS-COCO dataset, there are two possible options

    1. Use the existing object detection model that was pretrained on the MS-COCO dataset. If the detections are satisfactory, great and you can continue using it
    2. If not, you can finetune the model on data containing your classes of interest, basically use the pretrained MS-COCO weights as a starting point for training the network on your data that consists of those 5 classes (the more data, the better)

    Now, if the classes that you wish to detect are not in the original MS-COCO dataset, you will be much better off by using the pretrained MS-COCO weights (trained on 80 classes even if they are not relevant to yours) in the early convolutional layers and then train the detection and deeper layers of the network on your dataset. This is because the low-level features (like edges, blobs, etc.) that the network has learned will mostly be common to all classes and will greatly speed up training