Skip to content

Article kind of wrapper for a mushroom classifier project made for a college project laboratory

Notifications You must be signed in to change notification settings

ger0nymo/mushroom-classifier-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Mushroom Classifier

Introduction:

Embarking on a college project, I found inspiration in a mushroom image dataset while exploring public Kaggle datasets. The challenge was intriguing: to classify mushrooms using machine learning. Armed with Google Colab Premium's robust GPU support, including Tesla T4 and NVIDIA A100, I aimed to expedite the training process for my models, which proved to be immensely beneficial.

Dataset Exploration:

The dataset, comprising around 7000 labeled images, initially posed a challenge as it was formatted for object detection. To make it suitable for training classification models, I wrote a python script that used the COCO-formatted JSON to create subdirectories for each class and put the images in them accordingly. After converting it to the correct format, I resplit them so that 80% of the images would be used for training purposes, leaving 20% for validation or testing.

Model Training Attempts:

With minimal machine learning knowledge, I delved into object detection and classification. My first attempt involved building a custom model using TensorFlow. Although the process was straightforward, the model's output yielded only a 40% accuracy on the validation dataset, far from satisfactory for this project's standards.

Shift to Existing Models:

Undeterred, I shifted my focus to existing classification models. Detectron2, an initial choice, faced dependency version conflicts on Colab, prompting me to explore alternatives. The contenders were EfficientNetV2 and YOLOv8. While EfficientNetV2 reached a 70% accuracy, YOLOv8 outperformed it with a top1 accuracy of 90% and a top5 accuracy exceeding 98% on the validation dataset.

Model Implementation and Backend Development:

Having chosen YOLOv8 for its superior performance, the next step was implementing the trained model. I opted for Flask, a Python-based backend technology, to set up an HTTP endpoint. This endpoint receives image inputs from a frontend, runs predictions using the model, and sends the results back to the client. The backend's simplicity and compatibility made it an ideal choice for seamless integration.

Frontend Development:

To complement the backend, I designed a mobile app for user convenience. Leveraging my prior experience, I chose Flutter for its cross-platform capabilities. Utilizing BLoC state management, I crafted a clean and sophisticated user interface. The mobile app enables users to capture images, sending them to the backend for predictions through the trained model.

Conclusion:

In summary, the mushroom classifier project has reached its conclusion with the integration of the Flutter app. Users can easily capture images through the mobile app and receive accurate-enough predictions from the trained model. Although not intended for production use, the attained accuracy makes it able to see the goal of the project.

Subproject-repositories:

Resources:

About

Article kind of wrapper for a mushroom classifier project made for a college project laboratory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages