Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 29, 2021 04:01 pm GMT

AlexNet

ImageNet Classification with Deep Convolutional Neural Networks

We trained a large, deep convolutional neural network to classify the 1.2 million high-resolution images in the ImageNet LSVRC-2010 contest into the 1000 different classes. On the test data, we achieved top-1 and top-5 error rates of 37.5% and 17.0% which is considerably better than the previous state-of-the-art. The neural network, which has 60 million parameters and 650,000 neurons, consists of five convolutional layers, some of which are followed by max-pooling layers, and three fully-connected layers with a final 1000-way softmax.

Paper

Implementations

In 2012, AlexNet significantly outperformed all the prior competitors and won the challenge by reducing the top-5 error from 26% to 15.3%. The second place top-5 error rate, which was not a CNN variation, was around 26.2%.

import kerasfrom keras.models import Sequentialfrom keras.layers import Dense, Activation, Dropout, Flatten, Conv2D, MaxPooling2Dfrom keras.layers.normalization import BatchNormalizationimport numpy as npnp.random.seed(1000)#Instantiate an empty modelmodel = Sequential()# 1st Convolutional Layermodel.add(Conv2D(filters=96, input_shape=(224,224,3), kernel_size=(11,11), strides=(4,4), padding=valid))model.add(Activation(relu))# Max Poolingmodel.add(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding=valid))# 2nd Convolutional Layermodel.add(Conv2D(filters=256, kernel_size=(11,11), strides=(1,1), padding=valid))model.add(Activation(relu))# Max Poolingmodel.add(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding=valid))# 3rd Convolutional Layermodel.add(Conv2D(filters=384, kernel_size=(3,3), strides=(1,1), padding=valid))model.add(Activation(relu))# 4th Convolutional Layermodel.add(Conv2D(filters=384, kernel_size=(3,3), strides=(1,1), padding=valid))model.add(Activation(relu))# 5th Convolutional Layermodel.add(Conv2D(filters=256, kernel_size=(3,3), strides=(1,1), padding=valid))model.add(Activation(relu))# Max Poolingmodel.add(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding=valid))# Passing it to a Fully Connected layermodel.add(Flatten())# 1st Fully Connected Layermodel.add(Dense(4096, input_shape=(224*224*3,)))model.add(Activation(relu))# Add Dropout to prevent overfittingmodel.add(Dropout(0.4))# 2nd Fully Connected Layermodel.add(Dense(4096))model.add(Activation(relu))# Add Dropoutmodel.add(Dropout(0.4))# 3rd Fully Connected Layermodel.add(Dense(1000))model.add(Activation(relu))# Add Dropoutmodel.add(Dropout(0.4))# Output Layermodel.add(Dense(17))model.add(Activation(softmax))model.summary()# Compile the modelmodel.compile(loss=keras.losses.categorical_crossentropy, optimizer=adam, metrics=[accuracy])

Author of the implementation: @engmrk

AlexNet

Other Resources


Original Link: https://dev.to/aipool3/alexnet-pga

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To