Giter Club home page Giter Club logo

ssr_net_pytorch_age's Introduction

author : oukohou
time : 2019-09-26 16:44:48
email : [email protected]

A pytorch reimplementation of SSR-Net.

the official keras version is here: SSR-Net

results on MegaAge_Asian datasets:

- train valid test
version_v1^[1] train Loss: 22.0870 CA_3: 0.5108, CA_5: 0.7329 val Loss: 44.7439 CA_3: 0.4268, CA_5: 0.6225 test Loss: 35.6759 CA_3: 0.4935, CA_5: 0.6902
original paper ** ** CA_3: 0.549, CA_5: 0.741
version_v2^[2] train Loss: 2.9401 CA_3: 0.6326, CA_5: 0.8123 val Loss: 4.7221 CA_3: 0.4438, CA_5: 0.6295 test Loss: 3.9311 CA_3: 0.5151, CA_5: 0.7163

Note:

  • This SSR-Net model can't fit big learning rate, learning rate should be smaller than 0.002. otherwise the model will very likely always output 0, me myself suspects this is because of the utilizing Tanh as activation function.
  • And also: Batchsize could severely affect the results. A set of tested params can be :
    batch_size = 50
    input_size = 64
    num_epochs = 90
    learning_rate = 0.001 # originally 0.001
    weight_decay = 1e-4 # originally 1e-4
    augment = False
    optimizer_ft = optim.Adam(params_to_update, lr=learning_rate, weight_decay=weight_decay)
    criterion = nn.L1Loss()
    lr_scheduler = optim.lr_scheduler.StepLR(optimizer_ft, step_size=30, gamma=0.1)
    
  • The dataset preprocess is quite easy. For MegaAsian datasets, you can use the ./datasets/read_megaasina_data.py directly; for other datasets, just generate a pandas csv file in format like:
    filename,age
    1.jpg,23
    ...
    

is OK. But also, remember to change the ./datasets/read_imdb_data.py accordingly.

onnxruntime C++ implementation

thanks to DefTruth 's implementation here: How to convert SSRNet to ONNX and implements with onnxruntime c++.

another small note:

my reading understanding of SSRNet can be found:

which was written in Chinese.

ssr_net_pytorch_age's People

Contributors

oukohou avatar

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.