Image recognition tasks the machine in recognising and classifying objects displayed in images, outputting the object's label and confidence level from a fixed set of categories. The machine trains to recognise objects in images with changes of orientation, lighting, scale, etc. In this repository, I tested the model on 20 different image. Some examples are listed below with their level of confidence.
Due to my lack of training data, I will be using the pre-trained VGG 19 model for Keras from VGG(visual geometric group), along with the relevant model weights.
- Python3
- numpy
- matplotlib
- keras
- tensorflow (for keras machine learning)
- OpenCV
Run predict.py from models, and type in the desired file to be tested on. Must be located within the folder data. The function returns the most likely label of the object in the picture.
: "purse" (conf. = 7.63%) The label is wrong, which may be attributed to the tissue taking up a small proportion of the image, and is around the same colour of the desk.
: "digital, watch" (conf. = 50.62%) The label is correct.
: "purse" (conf. = 53.18%) The label is correct.
: "tripod" (conf. = 10.94%) The label is wrong, which may be attributed to the metalic look of the pen looking more similiar to the leg of a tripod.
: "traffic, light, traffic, signal, stoplight" (conf. = 10.77%) The label is wrong, which may be attributed to the training data being confined to the more modest image of a computer. The bright lights and screens of this computer may be confused with traffic signs and signals.
: "lion, Panthera, leo" (conf. = 98.32%%) The label is correct.
: "restaurant, eating, house, eating, place, eatery" (conf. = 19.08%) The label is correct. Although the picture shows a church, the small size of the building makes it quite indistinguishable from a normal house.
: "pot, flowerpot" (conf. = 23.33%) The label is correct.
: "crane" (conf. = 50.43%) The label is correct.
models.py: The KGG 19 model which i will be using.