Coder Social home page Coder Social logo

beiningwu / faceattr-analysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hawaii0821/faceattr-analysis

0.0 0.0 0.0 284.42 MB

Facial Attributes analysis/classification based on the dataset CelebA

License: MIT License

Shell 0.20% Python 99.80%

faceattr-analysis's Introduction

FaceAttr-Analysis

This repo is for the adavanced training on deeping learning with the purpose of building a face attributes analysis application.

Plan

Dataset

  • CelebA: about 162770 train images and about 39829 test images. (with precropped images, but it's better to try wild images.)
  • LFWA: (todo...because the original dataset link is invalid...)

Methods

  • v1:resnet101 (self-defined fc + BCE loss with logits + average accuracy)
  • v2:resnet101 (self-defined fc + BCE loss with logits + threshold rescaling (from page 67,Machine Learning, Zhihua Zhou) + average accracy + more metrics (recall, precision, TPR, FPR, F1 from page 30-33,Machine Learning, Zhihua Zhou))
  • v3+v5: try GC_resnet101 after modifying label format and loss.
  • v4: resnet101 + focal loss.
  • v6: se_resnet101
  • v7: resnet152
  • v8: densenet121
  • v9: SGE_resnet101.
  • V10: SK_resnet101.

Some model's codes are from PytorchInsight and pytorch.torchvision.Thx!

Experiment Result

Our Work

Solution average accuracy(%) macro-precision(%) macro-recall(%) macro-F1(%)
Resnet101 91.53 79.81 63.67 68.52
GCnet101 91.94 79.45 65.64 69.94
SEnet101 91.95 79.81 65.64 69.99
Densenet121 91.64 79.25 65.42 69.81
SGEnet101 91.60 79.23 65.40 69.77
SKnet101 91.93 79.69 65.54 69.95
CBAMnet101 91.42 78.12 65.32 69.24
Resnet152 91.95 79.46 65.98 70.14

More detailed data can be seen in folder \result.

Some explanable results for the model by using Grad-CAM.

Bald.

Bald

Eyeglasses

Eyeglasses Eyeglasses

Female and Male

Male Male

Wear hat

hat

State of the Art

State of the art

The image is from this paper--FAN,Youtu Search, IJCAI 2018

Simple Dashbord

Done:

More study notes on the DailyNote.md

Usage

The pretrianed model Resnet18 is availabel. Click Google Drive .

Open the run.sh file, read the main.py and you can see the running arguments of model.

bash run.sh

If you want to train and test model by yourself, you can run this command:

nohup python main.py --model_type Resnet18 --batch_size 32 --epochs 128 --learning_rate 1e-3 --exp_version v1 &

If you want to visulize the model, you can download pretrianed model and see comments in main part in file featuremap_visulize.py for the usage, and just run:

python featuremap_visulize.py

Problems

  • Sample attributes imbalance.
  • Need more effective learning strategies on multi-label task. (loss function? network structure?...)
  • The wild images differ from training and test image (aligned)

Related Resource

Dependency & OS

pip install -r requirements.txt # requirements.txt created by cmd: pipreqs ./

linux 16.0.1

License

MIT.

faceattr-analysis's People

Contributors

joshuaqyh 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.