
Back to Lab
Lab / Machine Learning•July 2025
Mushroom Classifier
Brain.jsClassificationMachine LearningAI
About the Project
This is a lightweight neural network classifier built with Vite and powered by Brain.js, designed to predict whether mushrooms are edible or poisonous based on their physical characteristics. It uses the UCI Mushroom Dataset, which contains 8,000+ samples of gilled mushrooms from the Agaricus and Lepiota families, each described by 22 categorical features such as cap shape, odor, gill color, and spore print color.
The project converts these categorical features into one-hot encoded input vectors suitable for training in Brain.js. A feedforward neural network is configured with a single hidden layer and trained entirely in the browser, leveraging Brain.js’s JavaScript-based GPU acceleration when available.
Once trained, the model can classify new mushroom samples with reasonable accuracy and immediate feedback. Everything runs client-side with zero dependencies beyond Brain.js and Vite, making it fast, interactive, and easy to experiment with directly in the browser.