question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improvement on motion-cnn result: 84.1% on split-1, with VGG-16

See original GitHub issue

Hi, all

I did some investigation on why the motion-cnn result is much lower than their original paper. After a simple modification, I am able to achieve 84.1% top-1 accuracy. This modification is adding transforms.FiveCrop() to the transformation. Before this modification, the result is only 80.5%. I use pretrained model fromhttps://github.com/feichtenhofer/twostreamfusion, I think further improvement can be down with transfroms.TenCrop().

I think with this modification, it can bridge the gap of performance between twostream model trained on pytorch and other frameworks.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:42

github_iconTop GitHub Comments

1reaction
gaoshcommented, Mar 26, 2019

@duygusar yeah, you also need to average for training. Alternatively, you can expand label to match the shape of the model output. But I think it won’t be much variance, you can written down cross entropy loss for these two cases, and compare them.

1reaction
gaoshcommented, Mar 26, 2019

You can directly refer to official reference, I will just paste it here:

>>> transform = Compose([
>>>    FiveCrop(size), # this is a list of PIL Images
>>>    Lambda(lambda crops: torch.stack([ToTensor()(crop) for crop in crops])) # returns a 4D tensor
>>> ])
>>> #In your test loop you can do the following:
>>> input, target = batch # input is a 5d tensor, target is 2d
>>> bs, ncrops, c, h, w = input.size()
>>> result = model(input.view(-1, c, h, w)) # fuse batch size and ncrops
>>> result_avg = result.view(bs, ncrops, -1).mean(1) # avg over crops

Basically, you just average across ncrops, and you will have the same batch size with label.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improvement on motion-cnn result: 84.1% on split-1, with VGG ...
This modification is adding transforms.FiveCrop() to the transformation. Before this modification, the result is only 80.5%. I use pretrained ...
Read more >
An Improved VGG16 Model for Pneumonia Image Classification
Thus, this paper proposes IVGG13 (Improved Visual Geometry Group-13), a modified VGG16 model for classification pneumonia X-rays images.
Read more >
Expression Recognition Method Using Improved VGG16 ...
18] proposed a facial expression recognition system based on depth CNN. This paper constructs a dual channel CNN model and gathers the channel ......
Read more >
The two-stream-action-recognition from jeffreyyihuang
Improvement on motion-cnn result : 84.1% on split-1, with VGG-16. Hi, all. I did some investigation on why the motion-cnn result is much...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found