Footfall Analysis β Age Attribute SVM Classifier
Classical computer vision age classifier that replicates the original PETA benchmark
methodology (Deng et al., 2014).
Part of the Footfall Analysis project.
Model Description
Each pedestrian crop is classified into one of four age buckets:
| Label | Age Range |
|---|---|
Age16-30 |
16 β 30 years |
Age31-45 |
31 β 45 years |
Age46-60 |
46 β 60 years |
AgeAbove61 |
61+ years |
How it works
- Feature extraction β The image is split into horizontal body regions.
Per region: 16-bin RGB and HSV colour histograms + uniform LBP texture histogram (radii 1, 2, 3), all L1-normalised. Regions are concatenated into one feature vector. - Per-attribute SVMs β One independent SVM is trained per age attribute (one-vs-rest).
Both a histogram-intersection kernel and an RBF kernel are grid-searched over C and gamma; the best configuration per attribute is selected using validation mean Accuracy (mA). - Inference β The four SVM scores are collected and the highest-confidence attribute that fires (score >= 0) is returned. If none fires, the attribute with the maximum decision score is returned as a fallback.
Performance
Evaluated on the held-out PETA test split using per-attribute mean Accuracy (mA):
| Attribute | mA |
|---|---|
| Age16-30 | ~0.84 |
| Age31-45 | ~0.82 |
| Age46-60 | ~0.84 |
| AgeAbove61 | ~0.84 |
| Average | ~0.835 |
File
| File | Description |
|---|---|
age_classifier_bundle.pkl |
Pickled dict: {attribute_name: sklearn SVM} |
Usage
from huggingface_hub import hf_hub_download
import pickle
# Download
pkl_path = hf_hub_download(
repo_id="abhshkp/footfall-analysis-age-svm",
filename="age_classifier_bundle.pkl"
)
with open(pkl_path, "rb") as f:
classifiers = pickle.load(f)
# classifiers is a dict: {"Age16-30": <SVM>, "Age31-45": <SVM>, ...}
# Pass your feature vector to each SVM:
# scores = {attr: clf.decision_function([feat_vec])[0] for attr, clf in classifiers.items()}
# prediction = max(scores, key=scores.get)
Note: You must extract features using the same region-based colour + LBP pipeline used during training (see age_classifier_v3.ipynb in the source repo).
Training Data
Trained on the PETA dataset (~14,000 pedestrian images) using the attributes: personalLess30, personalLess45, personalLess60, personalLarger60.
Citation
@inproceedings{deng2014peta,
title={Pedestrian Attribute Recognition At Far Distance},
author={Deng, Yubin and Luo, Ping and Loy, Chen Change and Tang, Xiaoou},
booktitle={ACM Multimedia},
year={2014}
}