Hi! I am just trying to solve the " SIIM-ACR Pneumothorax Segmentation" competition on kaggle. There you get DICOM medical images with Segmentation Lists.
I have created png images from the pixel-arrays of the DICOM images and would like to create my ImageData. I’m trying an analogous approach to the lesson3-camvid notebook:
I may be wrong, but looks like you’re missing 3rd datablock API step - How to label the inputs?. I think it should be something like .label_from_func(get_y_fn, classes=codes).
Could you possibly share fastai starter for the competition on kaggle?
I wonder if there is a better way of incorporating the test set. I was getting an error due to the tfm_y=True on the test set (that has no masks). As a workaround, I changed the transform function itself to set tfm_y=False to the test set.
# Setting transformations on masks to False on test set
def transform(self, tfms:Optional[Tuple[TfmList,TfmList]]=(None,None), **kwargs):
if not tfms: tfms=(None,None)
assert is_listy(tfms) and len(tfms) == 2
self.train.transform(tfms[0], **kwargs)
self.valid.transform(tfms[1], **kwargs)
kwargs['tfm_y'] = False # Test data has no labels
if self.test: self.test.transform(tfms[1], **kwargs)
return self
fastai.data_block.ItemLists.transform = transform
I think I have difficulties understanding how to work with rle encoded masks. Is there way to directly use the rle-encodings from the csv file or do I have to generated the masked jpgs anyway?
Initially I tried to use the rle-encodings directly but I didn’t find a easy way of making it work so I ended up converting the masks to png (avoid jpgs as the compression can lead to problems). I used the rle2mask provided on competition data. I shared the code I used in the comments of the kernel I linked above.
So, first kaggle competition… Got rank in the top 100. Training with image size 64x64.
I have also tried to do transfer learning and retrain with higher resolution images in 512x512 but this resulted in lower total score.
Any ideas how to push further?
Well, with more competitors joining the competition, my rank sank and I am out of the top 100. Nevertheless, this is the goal, I am striving for.
So I tried different things:
Training the last layer with higher resolution images (128x128 and 256x256)
unfreezing and retraining
different transformation parameters on the databunch
Training more epochs (~20-30)
Based on the 64x64 I have changed the data to a 256x256 data bunch and retrained the last layer.
using a resnet50 and resnet101 as base model
Interesting enough, none of the above approaches got a higher score! The first very basic basic attempt scored: 0.7976
Any other attempt scored with 0.78**
Do you have any ideas what to do to get a higher score?
I think discussing solution may be against the rules.
Good heuristics in general is to find other people’s notebooks on similar problem and see what they did.