A lightweight Python library dedicated to building, training, and testing Convolutional Neural Network (CNN) models with simplicity and clarity. It focuses exclusively on CNN workflows, Designed for developers who want full control and transparency over CNN architecture and training.
pip install git+https://github.com/77AXEL/PyCNN.git
No deep learning frameworks
GPU acceleration support
Learn by implementation
Dataset integration
Get PyCNN up and running in minutes
Standard Installation
pip install git+https://github.com/77AXEL/PyCNN.git
With CUDA Support
pip install cupy-cuda118
Train your first CNN model in just a few lines of code. PyCNN handles all the complexity while maintaining transparency in how everything works under the hood.
from pycnn.pycnn import PyCNN
# Initialize model
pycnn = PyCNN()
pycnn.cuda(True) # Enable GPU
# Configure architecture
pycnn.init(
batch_size=32,
layers=[256, 128, 64],
learning_rate=0.0001,
epochs=100
)
# Use Adam optimizer
pycnn.adam()
# Load CIFAR-10 dataset
pycnn.dataset.hf(
"cifar10",
max_image=1000,
cached=True
)
# Train with visualization
pycnn.train_model(
visualize=True,
early_stop=10
)
# Save the trained model
pycnn.save_model("model.bin")
Everything you need to build, train, and deploy CNNs
Built entirely from scratch using NumPy, PIL, and SciPy. No TensorFlow or PyTorch dependencies for core functionality.
Optional GPU support via CuPy for significantly faster training and inference on compatible hardware.
Advanced optimization with Adam algorithm for improved convergence and training stability.
Define custom layer configurations dynamically. Experiment with different architectures easily.
Seamlessly load datasets from HuggingFace hub or local folders with automatic preprocessing.
Real-time plotting of accuracy and loss curves with Matplotlib during training sessions.
Save and load trained models easily. Continue training or deploy for inference anytime.
Export your PyCNN models to PyTorch format for production deployment and framework integration.
Built-in support for dataset augmentation techniques to improve model generalization.
Understanding the complete pipeline from data to predictions
Images are loaded, resized, normalized, and processed through custom convolution filters with ReLU activation and max-pooling operations.
Flattened feature maps from convolutional layers are passed through fully connected dense layers for high-level feature learning.
Gradients computed via cross-entropy loss flow backward through the network, updating weights using Adam or SGD optimizer.
Dense layer outputs are processed with softmax activation for multi-class probability distribution and final predictions.
Who benefits from PyCNN?
Learn deep learning fundamentals by examining transparent, readable source code. Perfect for courses on neural networks and computer vision.
Rapidly prototype CNN architectures and experiment with novel approaches without framework overhead. Full control over every component.
Build custom CNN solutions for specific problems. Export to PyTorch when ready for production deployment at scale.
Experience PyCNN in action with our interactive CIFAR-10 classification demo running on HuggingFace Spaces.
Launch Demo open_in_newComprehensive guides and references
Step-by-step setup instructions for all platforms with GCC compiler requirements.
Complete code examples for training, evaluation, and model deployment.
Explore the complete implementation on GitHub. Fork and customize for your needs.
PyCNN is open source and welcomes contributions. Whether you're fixing bugs, adding features, or improving documentation, your help makes PyCNN better for everyone.