Hello,
A newcomer both to this group and to neural nets in general...:)
I am trying to create a image classification network with code that looks like as follows:
==============code starts==============
from keras.applications.resnet50 import ResNet50
from keras.layers import GlobalMaxPooling2D, GlobalAveragePooling2D, Dense, BatchNormalization, Lambda, Dropout
from keras import Sequential
from keras.optimizers import RMSprop
import numpy as np
#(...)
a,b = map(int,input("Please enter the category type interval a, b to be run:").split(','))
base = ResNet50(weights='imagenet', include_top=False)
for layer in base.layers:
layer.trainable = False
model = Sequential()
model.add(base)
model.add(GlobalAveragePooling2D())
model.add(BatchNormalization())
model.add(Dense(256, activation='relu', trainable = True))
model.add(BatchNormalization())
model.add(Dense(b-a+1, activation='softmax', trainable = True))
model.compile(loss='categorical_crossentropy', optimizer=RMSprop(lr=2e-5), metrics=['accuracy'])
==============code ends==============
Here, I load Keras's ResNet50 with weights pre-trained on ImageNet with the parameter weights set as 'imagenet'. In this case, must this pre-training have been unsupervised--i.e. irrespective of the WordNet hierarchy that ImageNet follows?
This matters to me because I am trying to create a network that can be 'bilingually trained'; I would absolutely prefer the ResNet50 to have gone through unsupervised training, so that the network classifies images purely according to the images and not to the (English-specific) labels too.