Coder Social home page Coder Social logo

sujayr91 / knowledge-distillation-for-image-captioning Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 4.0 209.16 MB

Compressing Image Captioning Network using Knowledge Distillation

Python 12.17% Jupyter Notebook 87.83%
pytorch knowledge-distillation image-captioning lstm

knowledge-distillation-for-image-captioning's Introduction

Knowledge Distillation for ImageCaptioning

  • Implementation of Knowledge distillation for Image Captioning. This project combines the knowledge distillation techniques introduced in https://arxiv.org/abs/1503.02531, https://arxiv.org/abs/1606.07947 for a multimodal task, i.e Image Captioning

  • Requirements:

    • Pytorch
    • Coco dataset in the folder coco
  • Training

    • Image Captioning model is trained using teacher_train.py [Only embedding layer of resnet is learnt, all other layers are pretrained model taken from torch]
    • Create a database with beam search captions from Teacher. Vary beam size per requirment, has utility to get captions with top CIDER scores.[generate_beamsearch_captions.py]
    • Do joint distillation of CNN + LSTM: Loss = CrossEntropy(studentcaptions, teachercaptions) + MSELoss(studentcnnout, teachercnnout)
  • Networks:

    • Teacher CNN: Resnet 50
    • Embedding : 512
    • Teacher LSTM: 2 layer, 512 hidden
    • Student CNN: Resnet 18
    • Student LSTM: 1 layer, 256 hidden
  • Evaluation:

    • Use CIDER, Blue Evaluation available in folder Evaluation
  • Results:

    • Teacher trained on Ground Truth: Cider 0.867
    • Student trained using distillation Cider: 0.82

knowledge-distillation-for-image-captioning's People

Contributors

sujayr91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

knowledge-distillation-for-image-captioning's Issues

Paper List

  1. Distillation as a Defense to Adversarial Perturbations against Deep Neural Networks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.