Hybrid Quantum–Classical Image Classifier
Genetic optimization over parameterized “quantum angles,” collapsed into bits and decoded into weights for a lightweight classifier on synthetic 16×16 images.
PythonQiskitGenetic AlgorithmOptimizationSynthetic Data
Role: Researcher & Developer • Fall 2025
Input
16×16 images
Synthetic shapes → pixel tensor
Search
Genetic algorithm
Optimizes non-differentiable params
Hybrid layer
Bits → weights
Collapse + decode into Dense layers
Interactive dashboard
Latest generation
Gen 3
From experiment logs
Best-so-far loss
0.2812
Lower is better
Average loss
0.6089
Population mean
Average accuracy
61.20%
Population mean
Trendline controls
Extend to
Gen 12
Dashed-region values are an illustrative linear trendline based on observed points.
Loss (best-so-far vs average)
Solid = observed • Dashed divider = trendline region
Accuracy (%)
Solid = observed • Dashed divider = trendline region
Evaluation loop
- Each generation evaluates a population of candidate angle vectors.
- Angles are collapsed into bits, decoded into weights, then scored via a forward pass.
- Best-so-far loss tracks the top candidate; averages summarize population behavior.
Problem
- Some parameterizations introduce discrete steps or non-differentiable components, making gradient-based training unreliable.
- The model’s intermediate representation can be naturally expressed as probabilistic bits that must be decoded into usable weights.
- A population-based optimizer provides a practical way to search parameters without backpropagation through those steps.
Approach
- Generate synthetic images (hollow circles/squares) and downsample to 16×16 for fast iteration.
- Represent candidates as “quantum angles”; collapse maps angles to bits via sin²(θ/2).
- Decode groups of bits into continuous weights/biases to form Dense layers.
- Evolve candidate angle vectors with a genetic algorithm; track best-so-far loss and population statistics over generations.