Computer Vision News - May 2019
Image classification is a basic task in computer vision and in many cases, using a pre-trained model can help us avoid the hard work of training and evaluating our models. Luckily, numerous pre-trained models are available online. In this article, we will review the Keras applications; deep learning models available on Keras, alongside with pre-trained weights. We will start with a quick introduction to Keras and its deep learning models for image classification, then implement a ResNet50 network on Keras applications, and finally demonstrate the performance of the model by classifying some real-world images. Introduction Keras is a Python library, that provides a high-level deep learning API that works on top of existing libraries such as TensorFlow, CNTK, and Theano. In practice, this means that instead of writing lengthy, low-level programs with any of these libraries, we can implement our model in a much more concise way. For example, training a basic model on TensorFlow requires us to define the loss manually, then the optimizer with its parameters, then split the data to batches and then iterate through the batches and epochs to train the network. Any additional configurations need to be defined separately. With Keras however, training a model after setting the structure of the model object can been done by two lines of code: where X, Y are the features and the target respectively. Another advantage of Keras is the availability of widely-used architectures as part of the API. Within Keras application, one can find image classification architectures such as: Xception, VGG16, VGG19, ResNet, Inception, MobileNet, DenseNet and more. This article will demonstrate the popular ResNet50 application and the power of skip connection. The architecture of ResNet can be seen in the following figure: 22 We Tried for You: Image Classification Tool by Amnon Geifman Image Classification Using Keras Pre-trained Models Computer Vision News model.compile(loss= 'mean_squared_error' , optimizer=optimizers.SGD(lr= 0.01 , decay= 1e-6 , momentum= 0.9 ), metrics=[ 'accuracy' ]) model.fit(X, Y, epochs= 5 , batch_size= 32 , validation_split= 0.3 )
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=