This repository contains the code used for the experiments in the research report:
Improving Object Classification using Pose Information Hugo Penedones, Ronan Collobert, FranΓ§ois Fleuret, David Grangier Idiap Research Report Idiap-RR-30-2012, November 2012 https://hpenedones.me/publications/Penedones_Idiap-RR-30-2012.pdf
We investigate whether pose information can be used as a regularizer to improve object classification. The key idea is to train neural networks in a multi-task learning setup, where the network simultaneously predicts:
- The object class (classification task)
- The camera azimuth (pose estimation task)
The hypothesis is that forcing the network to learn a pose-aware representation will produce smoother, more generalizable features β and ultimately reduce classification error.
Experiments are conducted on the small-NORB dataset (LeCun et al., 2004), a collection of 24,300 stereo images of 50 toy objects across 5 categories, photographed at varying azimuths, elevations, and lighting conditions. NORB is well-suited for this study because it provides ground-truth pose labels and the texture-less objects require shape-based reasoning.
The multi-task approach consistently outperforms the single-task baseline:
| Classifier | Input | Test error |
|---|---|---|
| Linear (baseline) | raw 2Γ96Γ96 | 30.2% |
| 1-NN (baseline) | PCA 95 | 16.6% |
| SVM Gaussian (baseline) | PCA 95 | 13.3% |
| MLP + pose (multi-task) | raw 2Γ96Γ96 | ~12.0% |
| Conv Net 80 (baseline) | raw 2Γ96Γ96 | 6.6% |
| Conv Net + pose (multi-task) | raw 2Γ96Γ96 | ~5.4% |
Adding pose supervision reduced the convolutional network error from 6.6% to ~5.4%, and improved the MLP from ~13% (SVM level) down to ~12% β without any changes to the network architecture or hand-crafted features.
The network's pose output for class y is a 2D vector g_y(x). Predicting a 2D vector
(rather than a scalar angle) avoids boundary issues and naturally handles the 180Β°
symmetry of the NORB data. Two loss functions are explored:
- Cosine loss: maximizes the cosine similarity between the predicted vector and
r(ΞΈ) = (cos ΞΈ, sin ΞΈ). - L1/L2 regression loss: forces the predicted vector to have unit norm, which is more robust to numerical issues.
pose_embedding/
βββ data_utils/ # Dataset preparation (NORB, synthetic, faces, letters)
βββ embedder/ # Core neural network trainer (multi-task learning)
βββ includes/ # Shared Lua modules (utilities, dataset loading, visualization)
βββ norb-baseline/ # NORB-specific baselines (ranking, angle regression, push-based)
βββ pose_corrector/ # Pose-corrected classifier variants
βββ sge/ # SGE grid engine job submission scripts
βββ sketchup_scripts/ # Ruby scripts to render synthetic 3D training data via SketchUp
The main training code. embedder.lua trains a neural network with a combined
classification + pose regression loss using Torch7 and stochastic gradient descent
(backpropagation).
Several baseline approaches for the NORB dataset:
embedd.luaβ standard embeddingembedd-angle.luaβ angle regressionembedd-rank.luaβ ranking-based embeddingembedd-with-push.luaβ push-based contrastive embedding- Custom criteria:
AngleCriterion.lua,Atan2Criterion.lua,DistanceCriterion.lua
Experiments with lookup-table layers (LookupSpatialConvolution.lua,
LookupLinear.lua) to learn pose-conditioned classifiers, along with modulo-aware
rotation criteria (ModuloRotationCriterion.lua).
Scripts to load and preprocess NORB (including a MATLAB extractor), generate synthetic datasets from SketchUp 3D models, and create angle-predictor training sets.
Ruby scripts (get_view.rb, norb_view.rb) that automate SketchUp to render 3D objects
at controlled azimuths and elevations, enabling synthetic data augmentation.
- Torch7 β deep learning framework (Lua)
- SketchUp β 3D modeling (for synthetic data generation)
- MATLAB β for NORB data extraction
- Hugo Penedones (Idiap Research Institute)
- Ronan Collobert (Idiap Research Institute)
- FranΓ§ois Fleuret (Idiap Research Institute)
- David Grangier (NEC Laboratories, Princeton)