Primary competition visual

Amini Cocoa Contamination Challenge

Helping Ghana
$7 000 USD
Completed (over 1 year ago)
Computer Vision
Object Detection
943 joined
255 active
Starti
14 Feb 25
Closei
11 May 25
Reveali
12 May 25
User avatar
Brainiac
🌟 1st Place Solution – Amini Cocoa Disease Detection Challenge
17 Jun 2025, 16:17 Β· 9

🔎 Approach Summary

  • Framework: MMDetection
  • Backbone: Swin Transformer (Large) with Co-DETR head
  • Training Time Constraint: 9 hours
  • Key Insight: A smaller, high-signal subset of the data + a large backbone outperformed training on the full dataset with a small model

📎 Inference Notebook: Kaggle Link – feel free to upvote if you find it useful! 🔼

📊 Smart Data Subsampling

To stay within time limits while using Swin-L, I applied a signal-based filtering strategy:

  1. Created a fixed validation set
  2. Established baseline model trained on small seed
  3. Iteratively added training samples in batches
  4. Retained only those batches that improved validation score

This led to a compact and high-signal training set.

🚀 Model Pipeline

  • Backbone: Swin-Large pretrained on ImageNet-22k
  • Detector: Co-DETR with 5-scale deformable attention
  • Training Augmentations: Color jitter Horizontal, vertical, diagonal flips Random resize to 512/640 px – Multi-scale training
  • Training Epochs: 10
  • Optimizer: AdamW (lr=1e-4, weight decay=1e-4)

💡 Postprocessing & Ensembling

  • Checkpoints: Used last 3 epochs (8, 9, 10) for ensembling
  • TTA: Horizontal flip, Vertical and Transpose
  • Soft-NMS: Class-wise with IoU threshold 0.5
  • Ensembling: Bayesian-style box fusion across TTA + checkpoints

🌐 Environment

  • GPU: Tesla T4 (Kaggle)
  • PyTorch: 2.5.1
  • MMDetection: 3.3.0

📅 Reproducibility

  • All code, config, and checkpoints are available in the shared Kaggle notebook
  • Run all to get the submission file

Massive thanks to the Zindi team, Makerere AI Lab, and Amini.ai for this powerful real-world challenge! 🚀

Discussion 9 answers
User avatar
Koleshjr

Thank you so much @Brainiac for sharing 🤝 and congratulations for your first place !!!

Upvotes 0
User avatar
Brainiac

Really appreciate it! Trust it proves helpful

Upvotes 1
User avatar
100i

Wow, this is super cool man! Congrats on your first place win!

Cool to know you successfully applied bayesian-style box fusion. We also experimented with that a lot but could'nt squeeze much from it. Very creative data subsampling. How did you find soft nms over wbf ensemble?

Upvotes 0
User avatar
Brainiac

Thanks a lot! Soft-NMS actually outperformed WBF in my ensemble, both on local validation and on the leaderboard.

Upvotes 0
User avatar
100i

Wow, same observation I made from our experiments. Thanks for clarifying.

Upvotes 0
User avatar
CodeJoe

Now it is settled mmdetection beats yolo

Upvotes 0
User avatar
Brainiac

1

Upvotes 2
User avatar
CodeJoe

Thank you so much for sharing @Brainiac

Upvotes 0
User avatar
Brainiac

Appreciate it!

Upvotes 1