-1

Let's say that I wanted to train a ConvNet to tell me if in a photo it is raining or not, how will the procedures be?

Given that I have two train variables, trainX and trainY, the trainX will be the photo and trainY will be the labels (e.g. rain or no-rain).

The goal of the network is to output the "right" answer. The question is: do I just need to run the model.predict() function and expect valid results?

Thank you for any help in advance.

sxeros
  • 668
  • 6
  • 21
Jerome Ariola
  • 135
  • 1
  • 11
  • first, you need to create the model structure and then fit it on your data. then only you can do model.predict() – SrGrace Jan 28 '20 at 10:45

1 Answers1

2

1) Build your CNN Model: Layers, Activation-Functions...

2) Train it with your existing trainX and trainY-Dataset. (use Augmentation to get better results in the end)

3) Validate with another Dataset, lets say they are called: testX and testY

4) Modify the settings of your Model until your accuracy and loss are high enough for what you need them...

5) enjoy your CNN

This could help you on your way: Building a CNN with Keras

sxeros
  • 668
  • 6
  • 21
  • Two things: by "settings" you mean like the batch size, momentum? For the X and Y am I right though? X is photos and Y is labels? – Jerome Ariola Jan 28 '20 at 12:00
  • 1
    With X and Y you are right, X is photos and Y is labels... But by Settings, I would focus on modifying the Model itself. adding new layers, getting rid of unnecessary layers, changing kernel-size, padding,dropout-rate, the number of filters...all the parameters you have to enter when you are building your own CNN. There is no 'right' amount of kernels or layers... it's more like trial and error...Batch-Size and Momentum are also variable and you can keep an eye on them, but optimization usually starts way earlier – sxeros Jan 28 '20 at 12:06