Computer Vision DBSCAN Clustering Flask & MongoDB

One View: Smart Facial Clustering for Event Photos

Oct 10, 2024 2 min read

Event photo sharing is a historically terrible user experience. A photographer uploads a Google Drive link containing 800 photos, and you have to manually scroll through hundreds of strangers just to find the three pictures you are actually in.

To solve this, our group built One View: an event management system that automatically organizes and routes event photos to the correct attendees using unsupervised machine learning.

The Architecture & ML Pipeline

Tech Stack

  • > Computer Vision: OpenCV, face_recognition
  • > Machine Learning: DBSCAN (Density-Based Clustering)
  • > Backend: Python, Flask
  • > Database: MongoDB

Solving the "Who is Who" Problem

The core intelligence of One View lives in our clustering pipeline. When an event host bulk-uploads photos, the system does not require anyone to manually tag faces. Instead, we extract facial embeddings (high-dimensional vector representations of a face) from every single person in every single photo.

Because we do not know in advance how many unique people attended the event, standard K-Means clustering would not work (since K-Means requires you to pre-define the number of clusters). Instead, we utilized DBSCAN (Density-Based Spatial Clustering of Applications with Noise). DBSCAN looks at the vector space and automatically groups dense clusters of highly similar faces together, naturally discovering the unique individuals present at the event.

One View Gallery UI
The One View starting page showing event navigation (Ongoing, New, Past) and onboarding steps for creating an event, sharing details, and uploading photos.

Once the clustering is complete, the Flask backend maps those clusters to registered users. When an attendee logs in, they are not hit with a massive, disorganized folder-they are instantly presented with a private gallery containing only the photos they appear in.