A simple neural network that learns to classify colors using ml5.js and p5.js. The model is trained on basic color data and can predict color categories based on RGB values selected through interactive sliders.
- Real-time color classification
- Interactive RGB sliders
- Adaptive text color based on background brightness
- Neural network training visualization
- Responsive color feedback
The application allows users to:
- Adjust RGB values using sliders
- See real-time color predictions
- View confidence scores for predictions (check console logs)
- Experience automatic text color adjustment for readability
- p5.js for graphics and interaction
- ml5.js for neural network implementation
- HTML5/JavaScript
- Move the RGB sliders to create different colors
- The neural network will classify the color in real-time
- The prediction appears in the center of the screen
- Text color automatically adjusts for optimal visibility
The neural network is trained on a dataset of common colors including:
- Primary colors (red, green, blue)
- Secondary colors (yellow, magenta, cyan)
- Neutral colors (white, gray, black)
- Common variations (maroon, forest green, navy, pink, orange, purple)