Age Detection: Revolutionizing Customer Insights with Matrice

Dataset Preparation

Age detection technology has proven to be a valuable tool for various industries, enabling businesses to gather age-related insights that can enhance customer experiences, target marketing campaigns, and drive better decision-making. From retail to healthcare, identifying the approximate age of an individual can open doors to a wealth of personalized services.

Leveraging our no-code platform at Matrice, we have developed an age detection model that classifies people into different age groups. This blog will walk you through our approach to building this model using computer vision, including the preparation of a labeled dataset, model training, and deployment.

In this blog, we’ll cover:

  1. Dataset Preparation

  2. Dataset Annotation

  3. Model Training

  4. Model Evaluation

  5. Model Inference

  6. Model Deployment

Dataset Preparation

To create an accurate age detection model, we used a dataset containing 600 images. The dataset is divided into the following age and gender-based categories:

  • Female-adult

  • Female-child

  • Female-senior

  • Female-teenager

  • Male-adult

  • Male-child

  • Male-senior

  • Male-teenager

The images were distributed across the training, validation, and test sets as follows:

Category

Total Count

Train

Validation

Test

Female-adult

249

170

51

28

Female-child

16

9

4

3

Female-senior

38

26

9

3

Female-teenager

17

11

6

0

Male-adult

289

209

53

27

Male-child

18

14

1

3

Male-senior

46

28

12

6

Male-teenager

18

12

4

2

This data distribution provides the model with a balanced set for training and evaluating its performance across different age groups.

Dataset Preview

Dataset Annotation

The dataset used was pre-annotated, following a consistent format compatible with our platform. This saved significant time in preparation and allowed us to move directly to the model training phase.

Annotation Preview

Model Training

After preparing the data, we conducted experiments with different models and configurations to find the optimal setup for age detection. Using YOLOv9, we adjusted various parameters like batch size and epochs to improve classification accuracy.

Below are the details of the best configuration for the chosen model:

  • Batch Size: 32

  • Epochs: 100

  • Learning Rate: 0.01

  • Optimizer: AdamW

  • Momentum: 0.937

  • Weight Decay: 0.0005

Performance Metrics

The model’s performance was evaluated on both the validation and test sets, resulting in the following metrics:

Category

AP

Validation

Test

all

0.461

0.738

Female-adult

0.339

0.316

Female-child

0.252

0.015

Female-senior

0.016

0.227

Female-teenager

0.059

-

Male-adult

0.290

0.365

Male-child

0.002

0.016

Male-senior

0.021

0.033

Male-teenager

0.005

0.017

Training Analysis

  • Model Performance by Category: This chart showcases the model’s detection accuracy for each category, showing the highest precision and recall metrics for adult categories, followed closely by senior categories.

Performance by Category

  • Training Analysis for Loss: The plot below illustrates a steady decrease in loss values over epochs, indicating a stable training process and well-tuned hyperparameters.

Training Loss

  • Recall Over Time: This graph shows a recall of approximately 0.70 on the validation set, indicating consistent true positive detection across categories.

Recall

Model Inference

Our platform allows for model export to formats like ONNX, TensorRT, and OpenVINO. This flexibility is crucial for deployment across various environments, such as edge devices with limited processing power, where lightweight models like ONNX are beneficial, or high-performance servers, where TensorRT can maximize efficiency.

For example, retailers can deploy this model on in-store devices to anonymously estimate customer age and gather valuable insights without storing personal data.

Model Deployment

With Matrice, deploying your age detection model is seamless. Once deployed, our servers handle all the computation, providing real-time predictions.

Our platform supports API integration across popular programming languages such as Python, JavaScript, PHP, and Golang, making it easy to integrate age detection into web services, mobile applications, or in-store kiosks.

This API flexibility ensures you can deploy the model in any setting, from retail analytics to customer engagement systems.

Conclusion

Age detection can significantly enhance customer insights, allowing businesses to better understand their audience and cater to their preferences. Using Matrice’s no-code platform, creating, training, and deploying an age detection model has never been easier.

Get started today to explore the potential of age detection in transforming customer engagement.

-->

Think CV, Think Matrice

Experience 40% faster deployment and slash development costs by 80%