Primary competition visual

Arm UNICEF Disaster Vulnerability Challenge

Helping Malawi
$10 000 USD
Completed (over 1 year ago)
1193 joined
347 active
Starti
Mar 15, 24
Closei
Jun 23, 24
Reveali
Jun 23, 24
38th place Segmentation approach
Connect · 24 Jun 2024, 00:42 · 5

First of all, I joined the competition 10 days before the deadline and decided to go to with a segmentation approach. Fun data to play around with and was still able to learn a lot!

Preprocessing X:

- Remove corrupted images (3)

- Reshape images to 256x256

Processing Y (labels):

- Create bounding box segmentation maps of size 0.7 (to reduce overlaps) and also reshape the maps to 256x256

I trained a model specifically for each class (Tin and Thatch). When training on all 3 channels, my model only seemed to predict and learn Tin houses and nothing for Thatch and Other. Since the majority of the houses were tin, this was the most important class, so I focussed on optimizing that.

Training:

Segmentation models PyTorch ensemble of vgg11 + eca + eff_b4 (75 epochs trained on all data)

Augmentations: (Horizontal Flip, Vertical Flip, RandomRotate90, CutMix, BBoxCutmix, Mosaic)

Loss: Dice + Focal + Surface Loss

Postprocessing:

Test time augmentation: (rotate and flip inference image in all 8 possible ways, then predict, rotate back) and average over all 8.

Find contours: From the segmentation maps that our model predicts, we applied cv2.findContours to count the number of houses with a threshold of 0.502.

Where did this approach not perform well?

- Very crowded overlap environments. Most error in the score comes likely from zoomed out drone images of a lot of tin houses where there is overlap.

- Confusing long rectangle sheds with houses (namely if the sheds were standalone, they were mostly labelled in the training data as houses, but if they were next to a house, they are not a house)

- Other houses (too little training data)

Other ideas I would have liked to implement:

- DETR and other HF Transformer object detection approaches

- Oversample Other class in a smart way

- Feature engineering (edge detection / add more channels next to RGB)

- Experiment with different loss functions and image resolutions.

- Experiment with zooming augmentations, since some drone images were very close, others were very zoomed out.

Final comments:

Since there were only ~60 images labelled with 'Other' houses, I was not able to learn for that class appropriately, so I put everything to 0. Probably also assuming this class is not prominent in test, if we have the same distributions.

In the last days, my teammate was working with DETR and the goal was to ensemble above written segmentation approach with a bounding box detection approach, but unfortunately time ran out :(

Congratulations to the winners of the competition! Also very interested in your approaches :)

Discussion 5 answers
User avatar
Mohamed-Eltayeb

Nice work :)

For us, we didn't do any significant work tbh. We focused on diversity and ensembling yolos.

But if there is something we did, i could say it is the postprocessing. We took the oof predictions and the ground truth then separate them to 3 parts, one for each class. Then we optimize for w and c here:

w * preds + c

We found it gave 0 to the "other" class in all our models. But give some interesting results for the other models (e.g. cv mae 0.34 ==> 0.31) and quite correlated to lb, but our base models were already simple (and we joind late) so didn't benefit from this a lot.

I think if we had models with cv 0.30-0.29 we would get into top scores.

24 Jun 2024, 01:14
Upvotes 2

Yeah postprocessing really can add a lot here. I was also thinking of analysing in which range my model is over / underpredicting. So for example, If I observe that my model is always predicting too few houses when it predicts 50+ houses, I could just add a constant to this range.

Of course, you could completely overfit on your test here, but sometimes I saw it translate to submission LB even for the trained models on all data instead of on 80%. In the end, did not have time to individually analyze my models to apply this tweaking, but opportunity is there

User avatar
Mohamed-Eltayeb

Your idea is known as nelder-mead postprocessing. Found it in several nlp kaggle competitions. Was thinking about it tbh, but preferred to focus on ensembling instead due to limited time.

The weights in this could be optimized on cv to avoid overfitting

how did you go about :Augmentations: (Horizontal Flip, Vertical Flip, RandomRotate90, CutMix, BBoxCutmix, Mosaic)

24 Jun 2024, 06:54
Upvotes 0

Great workkkkk!!!!!!!!!!!!!

I am taking notes :)

24 Jun 2024, 08:04
Upvotes 1