← all repositories
ahmedfgad/NumPyCNN

A CNN that barely learns, on purpose

NumPy-only forward pass with no backprop, designed to be trained by genetic algorithms instead of gradient descent.

600 stars Python ML FrameworksComputer Vision
NumPyCNN
Not currently ranked — collecting fresh signals.
star history

What it does

NumPyCNN implements convolutional neural networks from scratch in a single cnn.py module, using only NumPy. It handles the full forward pass—convolution, ReLU, pooling, flatten, dense layers—enough to run classification on single-label samples. But there’s a catch: no backpropagation, no real learning algorithm. Just a learning rate nudging weights after each epoch, which the author notes is “better than leaving the weights unchanged.”

The interesting bit

The project is deliberately half-finished: it’s a skeleton waiting for a brain transplant. The intended brain is PyGAD, a genetic algorithm library by the same author, meant to evolve CNN weights instead of training them with gradients. That’s an unusual hybrid—deep learning architecture meets evolutionary computation.

Key highlights

  • Pure NumPy implementation, no TensorFlow or PyTorch dependencies
  • Single-file module (cnn.py) with all layer classes
  • Supports Conv2D, pooling, ReLU/Sigmoid, flatten, and dense layers
  • Designed for integration with PyGAD genetic algorithm training
  • Includes example code for building and running a model

Caveats

  • Forward pass only; current “training” is essentially weight perturbation, not meaningful learning
  • Single-label classification only
  • README is mostly PyGAD documentation and donation links; CNN-specific details are sparse
  • Genetic algorithm training appears aspirational—no working GA-CNN example shown in the README

Verdict

Worth a look if you’re curious about CNN internals or want to experiment with neuroevolution. Skip it if you need something that actually trains today, or if you want modern autograd and GPU support.

Frequently asked

What is ahmedfgad/NumPyCNN?
NumPy-only forward pass with no backprop, designed to be trained by genetic algorithms instead of gradient descent.
Is NumPyCNN open source?
Yes — ahmedfgad/NumPyCNN is an open-source project tracked on heatdrop.
What language is NumPyCNN written in?
ahmedfgad/NumPyCNN is primarily written in Python.
How popular is NumPyCNN?
ahmedfgad/NumPyCNN has 600 stars on GitHub.
Where can I find NumPyCNN?
ahmedfgad/NumPyCNN is on GitHub at https://github.com/ahmedfgad/NumPyCNN.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.