Dog Breed Identification challenge

Nasty bugger :spy:

One night works and first ever submission got me top15 in the competition!

Thanks @jeremy for this amazing course! and also @jamesrequa @sermakarevich for the all tips in the discussion!

8 Likes

You can use arch = resnext101 without the 64, I assume resnext101_64 is another model. That works for me without having to download the weights.

2 Likes

@jakcycsl Nice work!!

1 Like

Hi Guys, Did you resized the images to 224 or 299. I resaw the video and Jeremy didn’t mention to resize. But there is code block which does the resize. Just want to know how you are handling that

@satish860 It’s sz parameter. Try different values to see which is better. Jeremy gave a hint to look at sizes distribution.

@jakcycsl Congrats! I assume 10-th place is a group of students from some other dl course )

Interesting question from @Moody in another thread

1 Like

@jeremy explains why he used the resize trick, from 224 to 299, here.
It’s cutting-edge SOTA secret sauce, don’t tell anyone :sunglasses:

6 Likes

I got this error when I tried to make predictions for test set.
Does anybody help me solve this issue?
Thanks in advance :slight_smile:

@rikiya The same thing happened to me and only with TTA predictions.

To solve it, you should be able to edit it slightly as below:
test_probs = np.exp(test_log_preds[0])

3 Likes

@jamesrequa That worked perfectly, thanks a lot :smiley:

1 Like

TTA returns a tuple. The 2nd item are the y values.

2 Likes

@jeremy this makes sense for predicting on the validation set but for the test set we don’t have any y values so in that case shouldn’t learn.TTA(is_test=True) just return the predictions?

If you agree I could submit a PR for it. :slight_smile:

2 Likes

IIRC it just returns zeros for the y values for the test set - I figured it’s more convenient for it to be consistent, so you don’t have to write different code for different datasets.

2 Likes

How do I check the most correct predictions for each breed while analysing the results?

In the dogs vs cats it was a classification problem - and I could call this line as I knew 1 was a dog.

plot_val_with_title(most_by_correct(1, True), "Most correct dogs")

But wondering how to check when having multiple outputs - and also how to display the title for each.

Thanks.

@jeremy Thanks, got it! Actually I saw bunch of zeros as 2nd item, now totally make sense :slight_smile:

You’ll need to write that code yourself - it would be a great exercise, actually. Let us know if you try and get stuck!

1 Like

Maybe a silly question. Why do we need to take np.exp of the prediction?

That gives us the probabilities.

In the below code, why are we choosing 300 as the default size value to check if condition?

def get_data(sz, bs):
    tfms = tfms_from_model(arch, sz, aug_tfms=transforms_side_on, max_zoom = 1.1)
    data = ImageClassifierData.from_csv(PATH, 'train', f'{PATH}labels.csv', 
                                    test_name ='test', val_idxs=val_idxs, suffix='.jpg', tfms=tfms, bs=bs)
    return data if sz>300 else data.resize(340, 'tmp')
3 Likes

Most pytorch models return the log of the probabilities.

2 Likes