# Cross validation for convolutional neural network

I am using Keras to create a CNN model, and I would to use K-fold cross-validation to train the dataset.

The dataset contains images and I am using flow_from_directory function.

Do you have any idea how to use K-fold cross-validation in Keras to create a CNN model??

• Very expensive, this is why we use a validation set. – Bashar Haddad Sep 24 '18 at 6:33
• Do you mean Cross-validation method is very expensive? – N.IT Sep 24 '18 at 12:09
• Yes cross validation is considered expensive for dnn , because you have to do the training , testing k times – Bashar Haddad Sep 24 '18 at 14:52
• I want to do cross validation, even if it is expensive – N.IT Oct 2 '18 at 5:02