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??

Topic keras convolutional-neural-network tensorflow computer-vision deep-learning

Category Data Science


It is very common to use sklearn for cross validation.

The most known methods are KFold and cross_val_score imported from sklearn.model_selection.

You can then use tf.keras.wrappers.scikit_learn.KerasClassifier to implement the scikit-learn classifier with Keras model.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.