Training the CNNs and saving the trained models