Search code examples
deep-learningtensorflow2.0cross-validationobject-detection-api

Tensorflow 2 Object Detection API - Can/Should I use K-Fold Cross Validation?


I have a small dataset of about 1000 images and am training my model to detect 8 classes. I had divided my dataset in a ratio of 80:20 (training: validation) and wanted to apply k-fold cross validation so as to make the most of my dataset.

#1: Is this line of thinking proper or am I misunderstanding something? In another post about K-fold cross-validation in object detection, someone mentioned that since we have confidence scores, we don't require k fold cross-validation. However, I don't see a correlation between training my model on the 'k' number of folds and confidence scores.

#2: Is this something that has to be manually done or does tensorflow 2.x have the means to add k fold cross-validation?

Any clarification would be greatly appreciated! Thanks!


Solution

  • About your query 1 and 2

    • (IMO), It would be proper to do K-Fold. FYI, splitting the data set into the 8:2 ratio is something called the holdout method, AFAIK, it's not K-Fold. When you want to do K-Fold there is something you probably need to consider such as class distribution, bounding box distribution, etc. However, as you don't provide any sample data or code, here is a similar discussion that might help you.

    • It has to be manually done. It's a resampling procedure used to evaluate machine learning models on a limited data sample. It's not something integrated with any framework.