28
Gender Classification REU 2017 RACHEL TOWNER UNCW JULY 25 1

REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Gender Classification REU 2017RACHEL TOWNER

UNCW

JULY 25

1

Page 2: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

OUTLINE

•What was my project?

•Dataset

•Steps to get there:• Image Preprocessing

• Feature Extraction Techniques

•Experiment

•Onward and Upward

•References

2

Page 3: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

IMAGE DATASET

Facial Recognition Gender

Classification

Race Classification

Age Estimation

3

Page 4: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

MORPH-II•The academic release of the Craniofacial Morphology Database (MORPH-II) contains 55,134 unique mugshots from 13,617 subjects [1].

•16 – 77 years old

•Average of around 4 images per person • Ranges 1 – 53 images per person

•Unbalanced nature between race and gender

Total Images

Male 46,644

Female 8,490

Total 55,134

4

Page 5: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Image Preprocessing

5

Page 6: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

MOTIVATION for PREPROCESSING

•Goal: Best classification/recognition rates

•Obstacle: difference in pose, scale, illumination, distractions (hair, clothes, etc.)

6

Page 7: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

PREPROCESSING PIPELINE•Goal: minimize variability between images

7

Page 8: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

IMPLEMENTATION•OpenCV package in python

•Function: cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

•Purpose: Convert Image pixels into grayscale

8

Page 9: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

IMPLEMENTATION

•Function: detectMultiScale

•Purpose: Use of Haar-Like Features to Locate particular items in image (face, eyes)

[1]

9

Page 10: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

IMPLEMENTATION

•Function: cv2.getRotationMatrix2D((cols / 2, rows / 2), angle, 1)

•Purpose: Generate transformation matrix• Output:

•Function: cv2.warpAffine(image, matrix, (cols, rows))

•Purpose: Transforms image by:

,M =

10

Page 11: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

IMPLEMENTATION

•Function: Box generate by calculating intraocular distance• Width = (intraocular distance) X 2

• Height = (intraocular distance) X 2.35

•Crop:

11

Page 12: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Feature Extraction

12

Page 13: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Gaussian Blur

•Blurring image results in reduction of noise and extra detail

• Sharpened image for crisp edges

Original Sigma = 1 Sigma = 2 DoG Sharpened

13

Page 14: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Gabor Filter•Examines frequency and orientation of an image

•Useful in edge detection

14

Page 15: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Bio-Inspired Features•Technique that emulates how the human visual system represents visual data• Uses low-level and high-level representations of face: S1 and C1

•S1: Combinations of Gabor filters at different scales and orientations

•C1: Combines images and creates a stack of new images of varying sizes

15

Page 16: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Local Binary Patterns

•Feature vector obtained by dividing image into cells and comparing pixel in each cell to neighboring pixel

•Histograms are computed over each cell and concatenated into feature vector

•Observation: Image noise remains

16

Page 17: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Complete 2DPCA

17

Page 18: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

PCA – 2DPCA•PCA is a classic data representation technique where the 2D image matrix is transformed into 1D image vectors. This results in a high dimensional vector space where it is difficult to calculate the covariance matrix accurately due to size [2], [3].

•2DPCA is based on the 2D image matrices and the covariance matrix can be constructed directly from image pixels. However, 2DPCA can only reduce dimension on one side

18

Page 19: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Complete 2DPCA•Complete 2DPCA uses two transformation matrices and can reduce an m x n image to a d1 x d2 feature matrix directly.

•Advantages: reduces computation time

19

Page 20: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Experiment

20

Page 21: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

SET-UP

•Subset: • 1,000 images of unique individuals

• Male to Female ratio 3:1

• Black to White ratio 1:1

•Training: 700

•Testing: 300

21

Page 22: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

PIPELINE

22

Page 23: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

RESULTS

23

Accuracy (%)

Original 91.7

LBP 72.7

Gabor 86.3

Gaussian 91.2

BIF: Compressed 90.7

BIF: Each C1 90.3

Seconds

Original 131.22

LBP 167.86

Gabor 130.84

Gaussian 150.69

BIF: Compressed

307.48

BIF: Each C1 380.67

•Original image performed best

•BIF took longest due to largest feature vector

Page 24: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Conclusions

24

Page 25: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

•C2DPCA could not be optimized by feature vectors with my methods

•Why did original image perform the best?• Feature extraction loses information from original image

•Why did LBP perform the worst?• Images has most noise

• Summarizes a lot of information

25

Useful Excess

Scale of Image Information

Page 26: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

Onward and Upward

26

Page 27: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

•Dr. Guinn method of majority vote for BIF images

•Spent a lot of time focusing on image preprocessing and different feature extraction techniques so I want to try different classification algorithms and dimension reduction methods for the future

•Use the feature extraction techniques without C2DPCA and see how that affects computation accuracy and speed

27

Page 28: REU 2017 Presentationpeople.uncw.edu › chenc › STT592_Deep Learning › 2017 NSF... · unique mugshots from 13,617 subjects [1]. •16 –77 years old •Average of around 4 images

REFERENCES1. https://www.researchgate.net/figure/237049645_fig1_Fig-2-Haar-features-examples-for-face-

detection

2. Anbang Xu, Xin Jin, Yugang Jiang, and Ping Guo. Complete Two-Dimensional PCA for Face Recognition. Image Processing & Pattern Recognition Laboratory, Beijing Normal University, 2006.

3. Jian Yang, David Zhang, Alejandro Frangi, and Jing-Yu Yang. Two-Dimensional PCA: A New Approach to Appearance-Based Face Representation and Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 26(1): 131-137, 2004

4. K. Ricanek and T. Tesafaye. Morph: a longitudinal image database of normal adult age-progression. In 7th International Conference on Automatic Face and Gesture Recognition (FGR06), pages 341-345, April 2006.

5. Ethan Meyers and Lior Wolf. Using Biologically Inspired Features for Face Processing. International Journal Computer Vision (76): 93-104, 2008.

28