Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks

Overview

mtcnn-caffe

Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks.

This project provide you a method to update multi-task-loss for multi-input source.

result

Requirement

  1. Ubuntu 14.04 or 16.04
  2. caffe && pycaffe: https://github.com/BVLC/caffe
  3. cPickle && cv2 && numpy

Train Data

The training data generate process can refer to Seanlinx/mtcnn

Sample almost similar to Seanlinx's can be found in prepare_data

  • step1. Download Wider Face Training part only from Official Website and unzip to replace WIDER_train

  • step2. Run gen_12net_data.py to generate 12net training data. Besides, gen_net_imdb.py provide you an example to build imdb, Remember changing and adding new params.

  • step3. Run gen_12net_hard_example.py to generate hard sample. Run gen_24net_data.py. Combine these output and generate imdb.

  • step4. Similar to last step, Run gen_24net_hard_example.py to generate hard sample. Run gen_48net_data.py. Combine these output and generate imdb.

Strongly suggest readers generate training data themselves. The sample training data of 12net and 24net is available( Too big for Baidu Drive to upload 48net) by sending Email

Net

The main idea is block backward propagation for different task

12net 12net 24net 24net 48net 48net

Questions

The Q&A bellow can solve most of your problem.

Q1: What data base do you use?
A1: Similar to official paper, Wider Face for detection and CelebA for alignment.

Q2: What is "12(24/48)net-only-cls.caffemodel" file for?
A2: Provide a initial weigh to train. Since caffe's initial weigh is random, a bad initial weigh may take a long ran to converge even might overfit before that.

Q3: Why preprocess images by minus 128?
A3: Separating data from (0,+) to (-,+), can make converge faster and more accurate. Refer to Batch Normalization Accelerating Deep Network Training by Reducing Internal Covariate Shift

Q4: Do you implement OHEM(Online-Hard-Example-Mining)?
A4: No. OHEM is used when training data is not that much big. Refer to faster-rcnn's writer RBG's paper

Q5: Ratio positive/negative samples for 12net?
A5: This caffemodel used neg:pos=3:1. Because 12net's function is to eliminate negative answers, similar to exclusive method, we should learn more about negative elininate the wrong answer.

Q6: Why your stride is different to official?
A6: If you input a (X,X) image, the output Y = (X-11)/2. Every point on output represent a ROI on input. The ROI's left side moving range = (0, X-12) on input, and (0, Y-1) on output. So that stride = (X-12)/(Y-1) ≈≈ 2 in this net.

Q7: What is roi(cls/pts).imdb used for?
A7: Use imdb can feed training data into training net faster. Instead of random search data from the hard-disk, reading data from a large file once to memory will save you a lot of time. imdb was created by python module-cPickle.

Q8: What is tools_matrix.py different from tools.py?
A8: Matrix version use linear matrix to make calculation faster(160ms on FDDB). If you are green hand in this area, read Non-Matrix version to understand each process.

Q9: I want your training data for emergency use. How to use them? How to train? ...
A9: ???

Current Status

CongWeilin updated in 2017/3/5

Update tools_matrix.py to make calculate faster, about 160ms/image.

You might also like...
Takes those cursed usernames you see on social networks and lets them be accessible to screen readers.
Takes those cursed usernames you see on social networks and lets them be accessible to screen readers.

AccessibleAuthorLabel 🔖 Takes those cursed usernames you see on social networks and lets them be accessible to screen readers so everyone can partake

On-device wake word detection powered by deep learning.
On-device wake word detection powered by deep learning.

Porcupine Made in Vancouver, Canada by Picovoice Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening

Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta)
Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta)

FlutterPianoAudioDetection Plugin Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta) Android Implementation iOS/iPa

CloneCorp - Data corpus for the evaluation of cross-language clone detection algorithms

CloneCorp - Data corpus for the evaluation of cross-language clone detection algorithms

Tiny YOLO for iOS implemented using CoreML but also using the new MPS graph API.
Tiny YOLO for iOS implemented using CoreML but also using the new MPS graph API.

YOLO with Core ML and MPSNNGraph This is the source code for my blog post YOLO: Core ML versus MPSNNGraph. YOLO is an object detection network. It can

Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.
Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.

CoreML-samples This is the sample code for Core ML using ResNet50 provided by Apple. ResNet50 can categorize the input image to 1000 pre-trained categ

WhatPet - A basic app that classifies images of dogs, cats and rabbits using CoreML
WhatPet - A basic app that classifies images of dogs, cats and rabbits using CoreML

WhatPet ✓ A basic app that classifies images of dogs, cats and rabbits using Cor

Automatic spoken language identification (LID) using deep learning.

iLID Automatic spoken language identification (LID) using deep learning. Motivation We wanted to classify the spoken language within audio files, a pr

Hand-gesture recognition on iOS app using CoreML
Hand-gesture recognition on iOS app using CoreML

GestureAI-CoreML-iOS Hand-gesture recognizer using CoreML Demo Screenshots This app is using RNN(Recurrent Neural network) with CoreML on iOS11. The m

Owner
Weilin Cong
Graduate student at Pennsylvania State University.
Weilin Cong
Deeper Depth Prediction with Fully Convolutional Residual Networks (FCRN)

Deeper Depth Prediction with Fully Convolutional Residual Networks By Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, Nassir

Iro Laina 1.1k Dec 22, 2022
Automatic colorization using deep neural networks. Colorful Image Colorization. In ECCV, 2016.

Colorful Image Colorization [Project Page] Richard Zhang, Phillip Isola, Alexei A. Efros. In ECCV, 2016. + automatic colorization functionality for Re

Richard Zhang 3k Dec 27, 2022
Artificial intelligence/machine learning data structures and Swift algorithms for future iOS development. bayes theorem, neural networks, and more AI.

Swift Brain The first neural network / machine learning library written in Swift. This is a project for AI algorithms in Swift for iOS and OS X develo

Vishal 331 Oct 14, 2022
Accelerated tensor operations and dynamic neural networks based on reverse mode automatic differentiation for every device that can run Swift - from watchOS to Linux

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning. It furthermore has automatic differentiati

Palle 87 Dec 29, 2022
DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning.

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning. It furthermore has automatic differentiati

DL4S Team 2 Dec 5, 2021
A toolbox of AI modules written in Swift: Graphs/Trees, Support Vector Machines, Neural Networks, PCA, K-Means, Genetic Algorithms

AIToolbox A toolbox of AI modules written in Swift: Graphs/Trees, Linear Regression, Support Vector Machines, Neural Networks, PCA, KMeans, Genetic Al

Kevin Coble 776 Dec 18, 2022
Easily craft fast Neural Networks on iOS! Use TensorFlow models. Metal under the hood.

Bender Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks. Contents Introduction Why did we need Bend

xmartlabs 1.7k Dec 24, 2022
DeepInfant® is a Neural network system designed to predict whether and why your baby is crying.

DeepInfant DeepInfant® is a Neural network system designed to predict whether and why your baby is crying. DeepInfant uses artificial intelligence and

Skytells AI Research 14 Oct 19, 2022
BrainCore is a simple but fast neural network framework written in Swift.

BrainCore is a simple but fast neural network framework written in Swift. It uses Metal which makes it screamin' fast. If you want to see it

Alejandro Isaza 377 Jun 29, 2022
Realtime yoga pose detection and classification plugin for Flutter using MLKit

ML Kit Pose Detection Plugin Flutter plugin for realtime pose detection using MLKit's Blazepose. License Copyright (c) 2021 Souvik Biswas, Bharat Bira

Souvik Biswas 8 May 5, 2022