Skip to content

Doberman12/CNNfromScratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of a Convolutional Neural Network Using CuPy

Build status Codacy Badge Test coverage Made with Python Made with CuPy License

Table of Contents


Overview

This project presents a complete implementation of a Convolutional Neural Network (CNN) from first principles using the CuPy library, enabling efficient GPU-accelerated computation in Python. It aims to explore the internal workings of CNNs beyond the abstraction provided by widely used frameworks such as TensorFlow or PyTorch. You can read


About CuPy

CuPy is an open-source array library for GPU-accelerated computing with Python. It offers a NumPy-compatible interface and leverages NVIDIA CUDA libraries such as cuBLAS, cuDNN, and cuFFT to perform high-speed numerical operations on the GPU. CuPy enables seamless transition from CPU-based NumPy code to GPU execution, making it ideal for scientific computing and deep learning research.


Objectives

  • Develop essential CNN components (e.g., convolutional layers, pooling, activation functions, fully connected layers, dropout, and loss functions) as modular Python classes
  • Employ optimization strategies like im2col, col2im, and memory-efficient techniques such as as_strided for convolution operations
  • Construct a training pipeline using a custom Sequential model and implement the AdamOptimizer for gradient-based learning
  • Validate the model using the MNIST dataset by assessing classification accuracy, loss, and training time across various batch sizes

Methodology

  • Preprocess MNIST images: convert to grayscale .png format and normalize input values
  • Implement forward and backward propagation without loops, leveraging matrix operations and GPU acceleration
  • Analyze model performance through validation curves and confusion matrices

Conclusion

This implementation confirms the feasibility of building a performant CNN purely with CuPy, highlighting both computational efficiency and the educational value of low-level deep learning architectures. It provides a foundation for extending the model to more complex datasets and deeper network designs.---


Documentation

A full project report detailing methodology, implementation, results, and analysis is available in the DOCS folder:

Project Report (PDF)


Track the progress of the project here: GitHub Project Board


About

Convolutional Neural Networ implemented using CuPy library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors