NNDigitKit is a digit recognition system designed to analyze 28x28 monochrome images using a multilayer perceptron trained on the popular MNIST dataset.
NNDigitKit makes training neural networks on the MNIST database simple, featuring a simple GUI to configure various parameters of the neural network, allowing quicker configuration and iterative improvement on neural network hyperparameters.
The repository includes comprehensive build settings for MSVC located in the .vcxproj
file.
To get started, follow these steps:
- Clone the repository:
git clone https://github.com/dmicz/NNDigitKit.git
- Open the
.vcxproj
file in Microsoft Visual Studio. - Build the project using either debug configuration for debugging or release for an optimized executable.
The default multilayer perceptron model is configurable through the GUI, which currently has options for layer count and size, training batch sizes, number of epochs, and learning rate.
The GUI allows fine-tuning of critical parameters. Parameters and their functions are listed below: Random seeding
- Seed: Integer passed to
srand()
to initialize parameters of neural network, clickUse time()
to replace the seed with the current Unix timestamp.
Layer settings
- Layer count: Number of total layers (hidden + 1 input + 1 output) of the network. Currently limited from 2 (no hidden layers) to 6.
- Layer x: Number of neurons in each hidden layer. Neurons in input/output layers currently cannot be edited (784 input for each pixel in 28x28 image, 10 output for each decimal digit). Currently limited from 1 neuron to 1000 neurons.
Other hyperparameters
- Mini-batch size: Size of mini-batch used in stochastic gradient descent, limited from 1 to 60000 (size of training data). If training set size isn't divisible my mini-batch size, the remaining examples are ignored (all training data is shuffled every epoch).
- Epochs: Number of iterations of SGD before terminating the training.
- Learning rate: Float value multiplied by SGD deltas to speed/slow learning. Must be at least 0, is scaled automatically by mini-batch size.
The model is saved in multilayer-perceptron.bin
according to the save_multilayerperceptron
in file.c
. Use the load_multilayerperceptron
in the main
function to load a model from file and continue training.
Contributions to enhance and extend NNDigitKit are welcome! Feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT license.
- GLFW is used for window and context management.
- Glad is used for OpenGL loading.
- cimgui is used for integrating Dear ImGui with C.
- Dear ImGui is used to create the GUI.