Is my avocado ripe? Let's find out with Machine Learning!
1. Gather Data - As you all know for any machine learning you need
have a data and it needs to be properly labeled. For my ML model I was
looking for proper labeled images for ripe and non ripe avocados. I ended up
finding that a set of images here on
Kaggle.
Following best practices for training a model, I divided data set into two
categories
- Training Data - Data that you use to train your model. In our case these are list of labeled images of ripe and non ripe avocados.
- Testing Data - Data that will be testing the accuracy of trained model. In our case this is just a subset of all the images.
2. Train & Testing Data Now I have the data ready for training,
how do I actually train the model. Being an iOS Mobile Engineer I used
Create ML tool which ships as part of Xcode developer tools as mentioned
in
WWDC 2019 video. This is a quick walkthrough of how I this works!
Once you are happy with your model, we can export it by literary dragging and dropping as shown below
3. Consume Trained Model - Now that we have the trained model
exported all we need to do is consume it in our app. So, I created an
app to see the process through...
Want to try the code for yourself -- checkout the gist here.
References
- https://developer.apple.com/videos/play/wwdc2019/430/
- https://www.kaggle.com/moltean/fruits