How many images do I need for fine-tunning the yolo_nas_l model?

84 views Asked by At

So, I would like to fine-tune the Yolo-nas-l model for person classes. The number of images of person class with annotations I have right now is 3979, 1135 valid, and 569 test. I'm getting good map at 050-95 but bad precision and recall, so should I increase the train_set? So any suggestions.

So for finetunning the model this were the training paras and I trained it for 100 epochs

train_params = {
    'silent_mode': False,
    "average_best_models": True,
    "warmup_mode": "LinearEpochLRWarmup",
    "warmup_initial_lr": 1e-6,
    "lr_warmup_epochs": 3,
    "initial_lr": 5e-4,
    "lr_mode": "cosine",
    "cosine_final_lr_ratio": 0.1,
    "optimizer": "Adam",
    "optimizer_params": {"weight_decay": 0.0001},
    "zero_weight_decay_on_bias_and_bn": True,
    "ema": True,
    "ema_params": {"decay": 0.9, "decay_type": "threshold"},
    "max_epochs": MAX_EPOCHS,
    "mixed_precision": True,
    "loss": PPYoloELoss(
        use_static_assigner=False,
        num_classes=len(dataset_params['classes']),
        reg_max=16
    ),
    "valid_metrics_list": [
        DetectionMetrics_050(
            score_thres=0.3,
            top_k_predictions=100,
            num_cls=len(dataset_params['classes']),
            normalize_targets=True,
            post_prediction_callback=PPYoloEPostPredictionCallback(
                score_threshold=0.01,
                nms_top_k=500,
                max_predictions=150,
                nms_threshold=0.7
            )
        ),
        DetectionMetrics_050_095(
            score_thres=0.3,
            top_k_predictions=100,
            num_cls=len(dataset_params['classes']),
            normalize_targets=True,
            post_prediction_callback=PPYoloEPostPredictionCallback(
                score_threshold=0.01,
                nms_top_k=500,
                max_predictions=150,
                nms_threshold=0.7
            )
        ),

    ],
    "metric_to_watch": '[email protected]:0.95'
}

and this was the result after 100 epochs

Valid_PPYoloELoss/loss_cls: 0.8076702356338501  
Valid_PPYoloELoss/loss_iou: 0.329728901386261   
Valid_PPYoloELoss/loss_dfl: 0.44104906916618347 
Valid_PPYoloELoss/loss: 1.5784482955932617  
[email protected]: 0.48968252539634705   
[email protected]: 0.9280189275741577   
[email protected]: 0.8829154372215271  
[email protected]: 0.6410865187644958   
[email protected]:0.95: 0.3704988658428192   
[email protected]:0.95: 0.7021487355232239  
[email protected]:0.95: 0.6309549808502197 
[email protected]:0.95: 0.4850526750087738  
1

There are 1 answers

0
Nuhman Pk On

Consider applying additional data augmentation techniques to your existing dataset. This might include random rotations, flips, and changes in scale to make your model more robust. Use packages like Albumentations for this