Giter Site home page Giter Site logo

level1_imageclassification-cv-11's Introduction

Gender and age classification for wearing mask image

This project is the Naver Boost Camp CV11 team's submission code for the mask wearing status classification competition. When a picture of a person wearing a mask is given, it is a matter of classifying the person's age, sex, and whether he or she is wearing a mask.

Team Members


Environment

  • OS : Linux Ubuntu 18.04.5
  • GPU : Tesla V100 (32GB)

Usage

1. git clone

  • git clone https://github.com/boostcampaitech5/level1_imageclassification-cv-11.git

2. Install Requirements

  • pip install -r requirements.txt

3. Training

To solve this problem, we conducted 18 classifications including gender, age, and whether to wear a mask, experimented with multi-output-classicaiton by setting each as a separate output, and conducted many experiments in the training process, such as removing the background of a given image through segmentation or adding regression loss for age. The method of execution for this experiment is as follows.

3-1. single-output-classification

  • python train.py

3-2. multi-output-classification

  • python train_multi.py

Key Options

  • --save_dir : save path
  • --data_dir : input path
  • --use_age : weight of mseloss(age)
  • --seg : enable segmentation
  • --model : model type (default: EfficientNet B0)
  • --batch_size : batch size for training
  • --criterion : criterion type
  • --epoch : number of epochs to train

4. Inference

4-1. Inference without segmentation image

  • python inference.py

Key Options

  • --data_dir : input path
  • --model_dir : model weight path
  • --output_dir : output path
  • --is_multi : enable multi output classification
  • --model : model type (default: EfficientNet B0)
  • --batch_size : input batch size for validing

result

Metric : f1 score

Model f1 score
EfficientNet B0 0.93093
ResNet 18 0.88177
ResNet 34 0.93165
EfficientNet B1 0.94594
EfficientNet B2 0.95842
ViT Tiny (Patch 16, 384) 0.76766
ViT Small (Patch 16, 384) 0.77515

Best model : Efficientnet B2

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.