This project implements a neural network from scratch in pure Java 21. The neural network is capable of training and testing using the MNIST dataset for digit recognition.
- Neural Network Implementation: The core of the project is the neural network implementation found in
NeuralNetwork
. - Training and Testing: The network can be trained and tested using the MNIST dataset. The training is done using stochastic gradient descent, implemented in
StochasticGradientDescentTrainer
. - Cost Functions: Different cost functions are available, such as the cross-entropy cost function in
CrossEntropyCostFunction
and the quadratic cost function inQuadraticCostFunction
. - Activation Functions: The project includes various activation functions, such as the sigmoid function in
SigmoidFunction
. - Regularization: Regularization techniques like L1 and L2 regularization are implemented in
L1Regularization
andL2Regularization
. - Data Handling: Utilities for handling data, such as shuffling and subdividing datasets, are provided in
DataUtils
. - MNIST Data Loader: The MNIST dataset loader is implemented in
MNISTLoader
. - GUI: A graphical user interface for drawing digits and interacting with the neural network is implemented in
Frame
,ButtonPanel
, andDrawPanel
.
- Java 21
- Maven
To build the project, run the following command in the root directory:
mvn clean install
mvn exec:java -Dexec.mainClass="org.neural.network.testermodule.Frame"