high accuracy on non trained class in tensorflow model
It is normal because the model has never seen such data so the probability for such unseen data is like random, it can be high or low.
You should add all other images (like the ones of tomato) into a new dedicated class OTHER where you will put everything which is not in the 4 original classes.
That way, for an image of tomato your model will give a high probability for the OTHER class, and low probability for the apple classes.