⚡️ Note:
This Arduino sketch demonstrates a simple artificial neural network (ANN) that learns to recognize patterns using backpropagation. It includes Ethernet initialization for potential network connectivity, though the main focus is on training the neural network with example input/output data. Training progress and results are displayed via the serial terminal, making it easy to monitor how the ANN learns over time.Perfect for experimenting with basic neural networks on Arduino hardware!
Welcome to the Arduino Nano Neural Network Project! This guide provides detailed instructions and information on setting up a neural network using an Arduino Nano and ENC28J60 Ethernet module.
- Support and References
- Project Overview
- Required Hardware
- Code Explanation
- Additional Resources
- Stay Tuned
Support the UniversalBit Project and explore related topics:
This project demonstrates how to set up and train an artificial neural network using an Arduino Nano. The network is configured to process inputs, calculate outputs, and optimize weights using backpropagation.
Key features include:
- MAC Address Configuration: Customize the network using a unique MAC address.
- Network Training: Use training patterns to achieve a low error rate.
- Real-time Monitoring: Display network training progress via the serial terminal.
To build this project, you need the following:
- Arduino Nano
- Mini ENC28J60 Ethernet Module
The provided Arduino script includes the following:
- Network Configuration: Set up IP addresses, MAC addresses, and server details.
- Neural Network Architecture:
- Input Nodes: 7
- Hidden Nodes: 8
- Output Nodes: 4
- Training Parameters:
- Learning Rate: 0.3
- Momentum: 0.9
- Success Threshold: 0.0004
byte mac[] = { 0xDE, 0xAF, 0xCF, 0xEF, 0xFE, 0xBD };Input and target patterns for training:
const byte Input[PatternCount][InputNodes] = {
{ 1, 1, 1, 1, 1, 1, 0 }, // 0
{ 0, 1, 1, 0, 0, 0, 0 }, // 1
{ 1, 1, 0, 1, 1, 0, 1 }, // 2
...
};
const byte Target[PatternCount][OutputNodes] = {
{ 0, 0, 0, 0 },
{ 0, 0, 0, 1 },
{ 0, 0, 1, 0 },
...
};The training loop randomizes input patterns, calculates errors, and updates weights using backpropagation:
for (TrainingCycle = 1; TrainingCycle < MAX_CYCLES; TrainingCycle++) {
// Randomize input patterns
// Compute activations
// Backpropagate errors
// Update weights
}Monitor training progress and outputs via the serial terminal:
void toTerminal() {
Serial.print("Training Pattern: ");
Serial.print(p);
Serial.print(" Output: ");
for (i = 0; i < OutputNodes; i++) {
Serial.print(Output[i], 5);
Serial.print(" ");
}
}For the full implementation, refer to the script provided in this repository.
Explore related references:
Stay updated with the latest developments in this project!