Skip to content

Commit 821f83c

Browse files
committed
added transfer learning tutorial
1 parent edbb97c commit 821f83c

File tree

13 files changed

+168
-0
lines changed

13 files changed

+168
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
2626
- [How to Detect Human Faces in Python using OpenCV](https://www.thepythoncode.com/article/detect-faces-opencv-python). ([code](machine-learning/face_detection))
2727
- [Building a Speech Emotion Recognizer using Scikit-learn](https://www.thepythoncode.com/article/building-a-speech-emotion-recognizer-using-sklearn). ([code](machine-learning/speech-emotion-recognition))
2828
- [How to Make an Image Classifier in Python using Keras](https://www.thepythoncode.com/article/image-classification-keras-python). ([code](machine-learning/image-classifier))
29+
- [How to Use Transfer Learning for Image Classification using Keras in Python](https://www.thepythoncode.com/article/use-transfer-learning-for-image-flower-classification-keras-python). ([code](machine-learning/image-classifier-using-transfer-learning))
2930
- [Top 8 Python Libraries For Data Scientists and Machine Learning Engineers](https://www.thepythoncode.com/article/top-python-libraries-for-data-scientists).
3031

3132
- ### [General Python Topics](https://www.thepythoncode.com/topic/general-python-topics)
@@ -46,3 +47,4 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
4647
- [How to Extract Weather Data from Google in Python](https://www.thepythoncode.com/article/extract-weather-data-python). ([code](web-scraping/weather-extractor))
4748
- [How to Download All Images from a Web Page in Python](https://www.thepythoncode.com/article/download-web-page-images-python). ([code](web-scraping/download-images))
4849

50+
For any feedback, please consider pulling requests.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# [How to Use Transfer Learning for Image Classification using Keras in Python](https://www.thepythoncode.com/article/use-transfer-learning-for-image-flower-classification-keras-python)
2+
To run this:
3+
- `pip3 install -r requirements.txt`
4+
- To train the model (already trained and the optimal weights are in `results` folder):
5+
```
6+
python train.py
7+
```
8+
This will load the flower dataset, construct the `MobileNetV2` model with its weights and starts training.
9+
- 86% accuracy was achieved on 5 classes of flowers which are `daisy`, `dandelion`, `roses`, `sunflowers` and `tulips`.
10+
- To evaluate the model as well as visualizing different flowers and its corresponding predictions:
11+
```
12+
python test.py
13+
```
14+
This will **Outputs:**
15+
```
16+
23/23 [==============================] - 6s 264ms/step
17+
Val loss: 0.5659930361524
18+
Val Accuracy: 0.8166894659134987
19+
```
20+
and **plots**:
21+
![Predicted Flowers](predicted-flowers.png)
22+
Check the [tutorial](https://www.thepythoncode.com/article/use-transfer-learning-for-image-flower-classification-keras-python) for more information.
144 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tensorflow
2+
keras
3+
numpy

0 commit comments

Comments
 (0)