How to retrain an Image Classifier with new classes and keep old classes
up vote
0
down vote
favorite
I'm trying to make an image classifier that can identify how likely it is that an image is an image of a watermelon. To do this I followed the flower classifier example here: https://www.tensorflow.org/hub/tutorials/image_retrainin and trained the model using this command
python retrain.py --image_dir ~/flower_photos
The problem I found when trying this classifier out is that it only classifies among the new classes, that is the flower classes in this case. So when I tried to classify an image of a dog (which I know is present in the Inception module) it classified it as a rose
python label_image.py
--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt
--input_layer=Placeholder
--output_layer=final_result
--image=/images/dog.jpg
Result
roses 0.7626607
tulips 0.12247563
dandelion 0.071335025
sunflowers 0.028395686
daisy 0.0151329385
How could I use TensorFlow to extend the model with an additional class instead of creating a new model with only the new classes?
image tensorflow machine-learning
add a comment |
up vote
0
down vote
favorite
I'm trying to make an image classifier that can identify how likely it is that an image is an image of a watermelon. To do this I followed the flower classifier example here: https://www.tensorflow.org/hub/tutorials/image_retrainin and trained the model using this command
python retrain.py --image_dir ~/flower_photos
The problem I found when trying this classifier out is that it only classifies among the new classes, that is the flower classes in this case. So when I tried to classify an image of a dog (which I know is present in the Inception module) it classified it as a rose
python label_image.py
--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt
--input_layer=Placeholder
--output_layer=final_result
--image=/images/dog.jpg
Result
roses 0.7626607
tulips 0.12247563
dandelion 0.071335025
sunflowers 0.028395686
daisy 0.0151329385
How could I use TensorFlow to extend the model with an additional class instead of creating a new model with only the new classes?
image tensorflow machine-learning
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to make an image classifier that can identify how likely it is that an image is an image of a watermelon. To do this I followed the flower classifier example here: https://www.tensorflow.org/hub/tutorials/image_retrainin and trained the model using this command
python retrain.py --image_dir ~/flower_photos
The problem I found when trying this classifier out is that it only classifies among the new classes, that is the flower classes in this case. So when I tried to classify an image of a dog (which I know is present in the Inception module) it classified it as a rose
python label_image.py
--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt
--input_layer=Placeholder
--output_layer=final_result
--image=/images/dog.jpg
Result
roses 0.7626607
tulips 0.12247563
dandelion 0.071335025
sunflowers 0.028395686
daisy 0.0151329385
How could I use TensorFlow to extend the model with an additional class instead of creating a new model with only the new classes?
image tensorflow machine-learning
I'm trying to make an image classifier that can identify how likely it is that an image is an image of a watermelon. To do this I followed the flower classifier example here: https://www.tensorflow.org/hub/tutorials/image_retrainin and trained the model using this command
python retrain.py --image_dir ~/flower_photos
The problem I found when trying this classifier out is that it only classifies among the new classes, that is the flower classes in this case. So when I tried to classify an image of a dog (which I know is present in the Inception module) it classified it as a rose
python label_image.py
--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt
--input_layer=Placeholder
--output_layer=final_result
--image=/images/dog.jpg
Result
roses 0.7626607
tulips 0.12247563
dandelion 0.071335025
sunflowers 0.028395686
daisy 0.0151329385
How could I use TensorFlow to extend the model with an additional class instead of creating a new model with only the new classes?
image tensorflow machine-learning
image tensorflow machine-learning
asked Nov 7 at 12:15
OriginalUtter
1511922
1511922
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
What you can do is join the two datasets and train them together or just leave the classes of model you are retraining in the possible classes and add a few images of those classes to the dataset just for the model to not forget what it already learned.
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
What you can do is join the two datasets and train them together or just leave the classes of model you are retraining in the possible classes and add a few images of those classes to the dataset just for the model to not forget what it already learned.
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
add a comment |
up vote
0
down vote
What you can do is join the two datasets and train them together or just leave the classes of model you are retraining in the possible classes and add a few images of those classes to the dataset just for the model to not forget what it already learned.
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
add a comment |
up vote
0
down vote
up vote
0
down vote
What you can do is join the two datasets and train them together or just leave the classes of model you are retraining in the possible classes and add a few images of those classes to the dataset just for the model to not forget what it already learned.
What you can do is join the two datasets and train them together or just leave the classes of model you are retraining in the possible classes and add a few images of those classes to the dataset just for the model to not forget what it already learned.
answered Nov 7 at 14:56
Novak
66848
66848
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
add a comment |
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
I don't understand exactly how to do this. How do I join the datasets? Or how do I leave the classes of the inception model I'm retraining in the possible classes? :)
– OriginalUtter
Nov 9 at 12:47
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189299%2fhow-to-retrain-an-image-classifier-with-new-classes-and-keep-old-classes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown