2

I have a CNN architecture that I train to recognize some objects that I need to eventually use in real time and then use the output of detected objects for further work. I have two questions regarding this that I need to have answered to evaluate the next step I need to make:

  1. As I studied CNN more, I found that there are different types of CNN such as faster CNN. So i want to know what type of architecture does Keras use when using its conv2d functions (I will provide a code for my CNN architecture below)

  2. The produced model helps me identify whether the object I am looking for is in the image or not, but I am looking to also find the region of the prediction in the image. Is this possible using this same architecture or do I need to use something else like YOLO?


classifier = Sequential()

classifier.add(Conv2D(32, (3, 3), input_shape= (128, 128, 3), activation = 'relu' ))

classifier.add(MaxPooling2D(pool_size = (2, 2)))

classifier.add(Conv2D(64, (3, 3), activation = 'relu' ))
classifier.add(MaxPooling2D(pool_size = (2, 2)))

classifier.add(Conv2D(128, (3, 3), activation = 'relu' ))
classifier.add(MaxPooling2D(pool_size = (2, 2)))

classifier.add(Flatten())

classifier.add(Dense(units = 128, activation = 'relu'))
classifier.add(Dense(units = 1, activation = 'sigmoid'))

classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])

EDIT: To be more specific, i want to know if what tensorflow or whatever backend keras is using provide a base CNN and the way we define the architecture is what define what type of CNN we are using such as regional CNN, fast CNN or faster CNN? or is it something defined at a different level?

I hope i made myself clear.

IonicSolutions
  • 2,559
  • 1
  • 18
  • 31
ibrahim.bond
  • 127
  • 1
  • 3
  • 12

1 Answers1

2

Regarding your first question: Keras is "just" a common API which can be used with different backends, namely TensorFlow, Theano, or CNTK.

Keras defines a number of different convolutional layers in layers.convolutional, all of which are documented here. Since you are using TensorFlow as your backend, you can have a look at backend.tensorflow_backend to find out which TensorFlow layers Keras is using.

However, note that R-CNN, Fast R-CNN etc. are not special types of convolutional layers, but CNN architectures (just as YOLO is). You can find out more about the general architectures in this blog post. You can find a Keras implementation of R-CNN on GitHub.

Regarding your second question: Your model works solely as an object detector. To identify where in the image your object is placed, you will indeed need a different architecture. Also, your training data will need to provide the object location.

IonicSolutions
  • 2,559
  • 1
  • 18
  • 31
  • in my case i am using tensorflow. i tried a simple google search, but did not find anything. do you have an idea or where i can find such info? – ibrahim.bond Apr 17 '19 at 09:40