Learning to Generate and Edit Hairstyles
Weidong Yin
1
, Yanwei Fu
1∗
Yiqing Ma
1
, Yu-Gang Jiang
2
, Tao Xiang
3
, Xiangyang Xue
1,2
1
School of Data Science, Fudan University;
2
School of Computer Science, Fudan University;
3
Queen Mary University of London
ABSTRACT
Modeling hairstyles for classication, synthesis and image edit-
ing has many practical applications. However, existing hairstyle
datasets, such as the Beauty e-Expert dataset, are too small for
developing and evaluating computer vision models, especially the
recent deep generative models such as generative adversarial net-
work (GAN). In this paper, we contribute a new large-scale hairstyle
dataset called Hairstyle30k, which is composed of 30k images con-
taining 64 dierent types of hairstyles. To enable automated gener-
ating and modifying hairstyles in images, we also propose a novel
GAN model termed Hairstyle GAN (H-GAN) which can be learned
eciently. Extensive experiments on the new dataset as well as
existing benchmark datasets demonstrate the eectiveness of pro-
posed H-GAN model.
KEYWORDS
Hairstyle Dataset, Hairstyle Classication, Generative Adversarial
Networks
ACM Reference format:
Weidong Yin
1
, Yanwei Fu
1
and Yiqing Ma
1
, Yu-Gang Jiang
2
, Tao Xiang
3
,
Xiangyang Xue
1, 2
. 2017. Learning to Generate and Edit Hairstyles. In
Proceedings of MM’17, October 23–27, 2017, Mountain View, CA, USA., ,
9 pages.
DOI: https://doi.org/10.1145/3123266.3123423
1 INTRODUCTION
Hairstyle can express one’s personalities, self-condence, and at-
titudes. It is thus an important aspect of personal appearance. A
computer vision model that enables recognition, synthesis, and
modication of hairstyles in images is of great practical use. For ex-
ample, with such as model, customer can take a photo of him/herself
and then synthesize dierent hairstyles before going to the hair-
dresser’s to make the most satisfactory one a reality. In addition, an
automated hairstyle recognition model can be used for recognizing
person’s identity for security applications.
Existing eorts on hairstyle modeling have been focused on rec-
ommending the most suitable hairstyles [
18
], or interactively users’
editing [
7
,
22
,
32
]. However, there is no attempt so far to systemat-
ically study hairstyles in images and no model available that can
∗
Dr. Yanwei Fu is the corresponding author. Email: yanweifu@fudan.edu.cn
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for prot or commercial advantage and that copies bear this notice and the full citation
on the rst page. Copyrights for components of this work owned by others than ACM
must be honored. Abstracting with credit is permitted. To copy otherwise, or republish,
to post on servers or to redistribute to lists, requires prior specic permission and/or a
fee. Request permissions from permissions@acm.org.
MM’17, October 23–27, 2017, Mountain View, CA, USA.
© 2017 ACM. ISBN 978-1-4503-4906-2/17/10...$15.00
DOI: https://doi.org/10.1145/3123266.3123423
address various hairstyle modeling task in a comprehensive manner.
One of the reasons is that there are large variations in hairstyles
and in order to model these variations, large-scale datasets are
needed. Unfortunately, such a large-scale hairstyle dataset does not
exist. In Multimedia and computer vision communities, hairstyles
are often labeled as attributes for face datasets. However, such
annotation is often crude, focusing mostly hair length and color.
On the other hand, existing specialized hairstyle datasets such as
Beauty e-Expert dataset [
18
] are too small to represent the diversity
of human hairstyles in the wild.
In this paper, we introduce the rst large-scale hairstyle dataset
– Hairstyle30
K
to the community and hope that this will greatly
boost the research into hairstyle modeling. Images in the dataset
(see Fig. 1 for examples) are collected from the Web via search
engines using keywords corresponding a hairstyle ontology. This
results in 64 dierent types of hairstyles in 30
K
images. On average,
each hairstyle class has around 480 images. The newly proposed
dataset is used to train the H-GAN model proposed in this paper.
Importantly, with 64 hairstyle classes, this is a ne-grained dataset
presenting a challenging recognition task, as veried by our exper-
iments.
Apart from releasing a new dataset, we also present a Hairstyle
Generative Adversarial Network (H-GAN) model for automati-
cally generating or modifying/editing hairstyles given an input
image. Our H-GAN has three components: an encoder-decoding
sub-network, a GAN and a recognition subnetwork. Particularly,
the encoder-decoding network is a variant of Variational Auto-
Encoders (VAE) [
12
]; the recognition sub-network shares the same
networks as the discriminator of GAN as in InfoGAN [
5
]. The
model is unique in that once trained, it can be used to perform
various tasks including recognition, synthesis and modication.
Extensive experiments of our H-GAN algorithm on the proposed
dataset and other general-purpose benchmark datasets validate the
ecacy of our model.
Contributions
. We make several contributions in this paper. Firstly,
to study the hairstyle related problems, we contribute a new large-
scale hairstyle dataset – Hairstyle30
k
to the community. To the best
of our knowledge, this is the largest hairstyle dataset, especially in
terms of the number of hairstyle classes. Secondly, we present a
new deep generative model called – H-GAN which can eectively
and eciently generate and modify the hairstyles of person images.
Extensive experiments demonstrate that our H-GAN is superior to
a number of state-of-the-art alternative models.
2 RELATED WORK
2.1 Image Editing and Synthesis
Editing image with interaction.
Recent advances in interactive
image segmentation have signicantly simplied the tasks of object
MM’17, October 23-27, 2017, Mountain View, CA, USA