License: Custom


Real-world Affective Faces Database (RAF-DB) is a large-scale facial expression database with around 30K great-diverse facial images downloaded from the Internet. Based on the crowdsourcing annotation, each image has been independently labeled by about 40 annotators. Images in this database are of great variability in subjects' age, gender and ethnicity, head poses, lighting conditions, occlusions, (e.g. glasses, facial hair or self-occlusion), post-processing operations (e.g. various filters and special effects), etc. RAF-DB has large diversities, large quantities, and rich annotations, including:

  • 29672 number of real-world images,
  • a 7-dimensional expression distribution vector for each image,
  • two different subsets: single-label subset, including 7 classes of basic emotions; two-tab subset, including 12 classes of compound emotions,
  • 5 accurate landmark locations, 37 automatic landmark locations, bounding box, race, age range and gender attributes annotations per image,
  • baseline classifier outputs for basic emotions and compound emotions.

To be able to objectively measure the performance for the followers' entries, the database has been split into a training set and a test set where the size of training set is five times larger than test set, and expressions in both sets have a near-identical distribution.

Sample Images


Contect preview

  • Single-label Subset (Basic emotions) Single-label Subset

  • Two-tab Subset (Compound emotions) Two-tab Subset

For more details of the dataset, please refer to the paper Reliable Crowdsourcing and DeepLocality-Preserving Learning for Expression Recognition in the Wild here".
* Please note that the RAF database is partially public. And the other 10k images are neither basic nor compound emotions which will be released afterwards.

Data Collection

At the very beginning, the images’URLs collected from Flickr were fed into an automatic open-source downloader to download images in batches. Considering that the results returned by Flickr’s image search API were in well-structured XML format, from which the URLs can be easily parsed, we then used a set of keywords (for example: smile, giggle, cry, rage, scared, frightened, terrified, shocked, astonished, disgust, expressionless) to pick out images that were related with the six basic emotions plus the neutral emotion. At last, a total of 29672 real-world facial images are presented in our database. Figure 2 shows the pipeline of data collection

Figure 2. Overview of construction and annotation of RAF-DB.

Overview of construction and annotation of RAF-DB.

Data Annotation

Annotating nearly 30000 images of expression is an extremely difficult and time-consuming task. Considering the compounded property of real-world expressions, multiple views of images’ expression state should be collected from different labelers. We therefore employed 315 annotators (students and staffs from universities) who have been instructed with one-hour tutorial of psychological knowledge on emotion for an online facial expression annotation assignment, where they were asked to classify the image into the most apparent one from seven classes. We developed a website for RAF-DB annotation, which shows each image with exclusive attribute options. Images were randomly and equally assigned to each labeler, ensuring that there were no direct correlation among the images labeled by one person. And each image was assured to be labeled by about 40 independent labelers. After that, a multi-label annotation result is obtained for each image, i.e., a seven dimensional vector that each dimension indicates the votes of relevant emotion.


Please use the following citation when referencing the dataset:

  title={Reliable Crowdsourcing and Deep Locality-Preserving Learning for Expression Recognition
in the Wild},
  author={Li, Shan and Deng, Weihong and Du, JunPing},
  booktitle={2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  title={Reliable Crowdsourcing and Deep Locality-Preserving Learning for Unconstrained
Facial Expression Recognition},
  author={Li, Shan and Deng, Weihong},
  journal={IEEE Transactions on Image Processing},



Data Summary
Provided by
Weihong Deng
Pattern Recognition and Intelligent System Laboratory (PRIS Lab), Beijing University of Posts and Telecommunications.
Start Building AI Now