Hand-crafted Features

1. Purpose & Motivation

1.1 Why hand-crafted features exist

  • Before deep learning, models could not learn useful representations from raw data
  • Domain experts possess knowledge about what makes data informative
  • For many tasks, carefully designed features outperform generic learned features, especially with limited data

1.2 The core problem it solves

Manually design task-specific feature representations that encode domain knowledge, making raw data interpretable by classical machine learning algorithms.

2. Definition & Core Idea

2.1 Formal definition

Hand-crafted features are manually designed input representations created by domain experts using knowledge of the data structure, physics, or problem domain, rather than being learned automatically by the model.

2.2 Intuitive mental model

"A radiologist tells the model to look at edge sharpness, texture regularity, and shape symmetry rather than letting it figure out raw pixels on its own."

3. Classic Examples by Domain

3.1 Computer vision

Feature descriptor What it captures
SIFT Scale-invariant keypoints
HOG Histogram of oriented gradients
LBP Local binary patterns (texture)
Haar features Edge and region intensity differences
SURF Speeded-up robust features

3.2 Natural language processing

  • Bag-of-words, n-grams
  • TF-IDF weighted term vectors
  • Part-of-speech tag distributions
  • Handcoded sentiment lexicons

3.3 Audio and speech

  • Mel-Frequency Cepstral Coefficients (MFCCs)
  • Spectral centroid, bandwidth, rolloff
  • Zero-crossing rate
  • Chroma features for music

3.4 Tabular / domain-specific

  • Financial ratios (debt-to-equity, P/E ratio)
  • Engineered medical scores (BMI, APACHE)
  • Sensor signal statistics (mean, variance, peak frequency)

4. The Pipeline

4.1 Traditional ML workflow

Raw Data -> Hand-crafted Features -> Feature Vector -> Classifier (SVM, RF, etc.) -> Prediction

4.2 Contrast with deep learning

Raw Data -> Neural Network (learns features internally) -> Prediction

Deep learning replaces the manual feature design step with learned representations, but at the cost of requiring more data and compute.

5. When Hand-crafted Features Still Win

  • Small datasets: Not enough data for deep learning to learn good features
  • Constrained compute: Edge devices, real-time systems
  • Well-understood domains: Physics-based features encode known invariances
  • Interpretability requirements: Stakeholders need to understand each input
  • Hybrid approaches: Hand-crafted features combined with learned features

6. Strengths & Limitations

6.1 Strengths

  • Encode proven domain knowledge directly
  • Work well with small datasets
  • Fully interpretable and debuggable
  • Computationally lightweight at inference

6.2 Limitations

  • Require significant domain expertise and iteration
  • May miss patterns that are not obvious to humans
  • Do not transfer easily across domains
  • Largely superseded by deep learning for images, text, and audio

7. One-Sentence Summary

Hand-crafted features are manually designed input representations that encode domain expertise, serving as the foundation of classical machine learning pipelines.

8. Related Knowledge Pages