Abstract
This paper is focused on the automatic extraction of persons and their attributes (gender, year of born) from album of photos and videos. We propose the two-stage approach, in which, firstly, the convolutional neural network simultaneously predicts age/gender from all photos and additionally extracts facial representations suitable for face identification. We modified the MobileNet, which is preliminarily trained to perform face recognition, in order to additionally recognize age and gender. In the second stage of our approach, extracted faces are grouped using hierarchical agglomerative clustering techniques. The born year and gender of a person in each cluster are estimated using aggregation of predictions for individual photos. We experimentally demonstrated that our facial clustering quality is competitive with the state-of-the-art neural networks, though our implementation is much computationally cheaper. Moreover, our approach is characterized by more accurate video-based age/gender recognition when compared to the publicly available models.
Introduction
As personal digital media libraries explode in size, the need for automated organization—grouping photos by person and tagging them with attributes—has become urgent. Traditionally, this requires a pipeline of three separate, heavy-duty deep learning models: one for face recognition (who is this?), one for age estimation, and one for gender classification.
Running three independent CNNs is computationally expensive, memory-intensive, and slow, making it nearly impossible to perform "on-device" processing for mobile users without draining the battery or lagging. Furthermore, specialized age/gender models are often trained on small, noisy datasets, limiting their generalizability. This research proposes a unified representation that is both fast and accurate.
Methods
Architecture
The core of the proposal is a Multi-output CNN built on a MobileNet v1 backbone. The base MobileNet is pre-trained on the massive VGGFace2 dataset to learn "identity features" (facial embeddings). A shared hidden layer with dropout is added, followed by two specialized "heads": a 100-node softmax layer for age probabilities and a single-node sigmoid layer for male gender probability. To preserve the rich identity features, the MobileNet base weights are frozen while the age and gender heads are fine-tuned using the IMDB-Wiki and Adience datasets.
The Processing Pipeline
The system follows a structured workflow to process both static photos and video sequences:
- Detection: Faces are localized using the MTCNN (Multi-task Cascaded Convolutional Networks) framework.
- Extraction: The multi-output CNN generates identity embeddings and age/gender predictions in a single pass.
- Clustering: Faces are grouped into identities using Hierarchical Agglomerative Clustering (HAC).
- Refinement: The system employs specific heuristics to improve quality, such as ensuring faces from the same photo are not clustered together and using the predicted "birth year" (photo date minus predicted age) as a stable clustering feature.
- Age Aggregation: Instead of relying on a single top prediction, the system calculates an expected mean age using the top $L$ predictions, which helps smooth out individual errors.
Key Insights
- Identity Features are "Rich": Features learned for face recognition are inherently descriptive enough to provide a significant advantage for predicting age and gender. This domain adaptation leads to better results than training an age/gender model from scratch.
- Efficiency via Multi-tasking: By solving three problems with one backbone, the model reduces inference time by 5–10x compared to using standard VGG or ResNet ensembles.
- Birth Year as a Constant: While a person's age changes across a 10-year photo album, their birth year does not. Converting age to birth year using photo metadata provides a stable attribute to assist in grouping faces of the same person as they age.
Key Results
The proposed model demonstrates significant improvements in both speed and accuracy:
- Speed: On a modern smartphone (Samsung S9+), the model takes only 61–69ms to process a face, making real-time album organization feasible.
- Accuracy: On the UTKFace dataset, the model achieved 94.1% gender accuracy and a Mean Absolute Error (MAE) of 5.44 years for age, outperforming larger models like the VGG16-based DEX.
- Clustering: The approach proved competitive with state-of-the-art identity grouping on the GFW dataset, achieving a BCubed F-measure of 0.751, while being significantly faster and using lower-dimensional feature vectors (1024 vs. 4096).
Conclusion
While the system is highly efficient, aging remains a challenge for clustering. If an album spans many years, standard clustering often splits the person into multiple groups. Future work will focus on more complex aggregation techniques, such as learnable pooling or attention mechanisms, to better weigh the "best" facial images within a cluster when making final decisions on a person's age or gender.
Summary updated