Flow Moods: Recommending Music by Moods on Deezer

Théo Bontempelli, Benjamin Chapus, François Rigaud, Mathieu Morlon, Marin Lorant, Guillaume Salha-Galvan

Abstract

Personalized music recommendation systems often struggle with situational context, leading to the "wrong time" problem where high-quality recommendations conflict with a user's current activity or emotional state. This paper details "Flow Moods," an enhancement to Deezer’s signature personalized radio feature. By integrating collaborative filtering with audio-based deep learning and expert human annotations, Flow Moods allows users to filter their personalized streams through six distinct emotional and contextual lenses. Since its global rollout in 2021, the system has demonstrated significant usage patterns tied to temporal cycles and improved user engagement.

1. Introduction

A primary challenge in music recommendation is the "wrong time" problem. While collaborative filtering (CF) is highly effective at identifying tracks a user is likely to enjoy based on historical preferences, it is often "mood-blind." For instance, a user who enjoys both high-intensity metal and ambient lo-fi may find a metal track jarring while trying to sleep.

Deezer’s "Flow" feature originally provided an infinite, personalized stream based on user history. To address the lack of situational awareness, "Flow Moods" was developed to give users a mechanism to signal their current state of mind—defined broadly as both emotional states (e.g., Melancholy) and activity-based contexts (e.g., Focus, Party).

2. System Architecture and Methodology

The Flow Moods system employs a hybrid architecture that combines user-specific personalization with large-scale audio classification.

2.1 Personalization via Collaborative Filtering

The foundation of the system is a latent model that learns vector representations (embeddings) for users and songs. Proximity within this embedding space indicates shared musical preferences. This ensures that recommendations remain grounded in the user's unique taste.

2.2 Audio-Based Mood Classification

To categorize the vast Deezer catalog of 90 million tracks, the team utilized a multi-step classification pipeline:

  1. Expert Ground Truth: Professional music curators manually annotated thousands of tracks to establish a high-quality training dataset for six moods: Chill, Party, Focus, Motivation, Melancholy, and You & Me (Romance).
  2. Feature Extraction: A VGG-like convolutional neural network (CNN) from the musicnn library was used to extract 256-dimensional embeddings directly from the audio signals.
  3. Random Forest Classifiers: These audio embeddings were fed into six independent Random Forest binary classifiers. Each classifier generates a "mood score" (0 to 1), representing the probability that a track fits a specific category.

2.3 Real-Time Recommendation Generation

When a user selects a mood, the system filters the candidate tracks generated by the collaborative filtering model. Only tracks that exceed a predefined mood score threshold are retained. This ensures the output is both personalized to the user and contextually appropriate.

3. Infrastructure and Scalability

To serve millions of active users across 180 countries, the system utilizes Faiss (Facebook AI Similarity Search) for efficient approximate nearest neighbor retrieval. The production environment is built on a Kubernetes-managed stack using Scala and Go, ensuring the low-latency response required for a seamless user experience.

4. Key Insights and Results

Flow Moods was deployed globally in October 2021. Analysis of user interaction data revealed distinct temporal patterns in how different moods are consumed:

  • Motivation: The most consistently streamed mood overall.
  • Party: Usage spikes predictably on Friday and Saturday nights.
  • Focus: Usage peaks during standard work hours on weekdays.
  • Chill: Shows a notable increase in popularity on Sundays.

The introduction of mood-based filtering led to an improvement in the "penetration rate" of the Flow feature, suggesting that providing users with contextual control increases the overall utility of personalized radio.

5. Limitations and Future Directions

While successful, the current iteration of Flow Moods has several areas for improvement. The reliance on audio signals alone can miss nuances captured in lyrics, particularly for moods like "Melancholy." Future work aims to incorporate natural language processing (NLP) of lyrics to refine classification.

Additionally, the system faces a "cold start" problem for niche moods where a user may have few neighbors in the embedding space. The team is also exploring the addition of seasonal moods (e.g., Christmas) and conducting cross-cultural research to determine how mood perceptions vary globally.

6. Conclusion

Flow Moods demonstrates that music recommendation is most effective when it balances long-term user preference with immediate situational context. By combining deep learning audio analysis with expert human curation, Deezer has created a scalable solution to the "wrong time" problem, allowing for a more intuitive and responsive discovery experience.

Summary updated

BibTeX
@inproceedings{bontempelli2022flow,
  author = {Théo Bontempelli and Benjamin Chapus and François Rigaud and Mathieu Morlon and Marin Lorant and Guillaume Salha-Galvan},
  title = {{Flow Moods: Recommending Music by Moods on Deezer}},
  booktitle = {RecSys},
  year = {2022},
  doi = {10.1145/3523227.3547378},
}
Figure