# setting class weights for imbalanced dataset, how using EarlyStopping?

I want to train a CNN with Early Stopping (Keras). The data set is imbalanced, so I have set class_weights to 'balanced' like follows:

class_weights=class_weight.comput_class_weight('balanced', np.unique(y_train),y_train)


I would like also use Early Stopping, and here is the problem. Which metric for monitor should I use? Because I have still balanced the data set with the class weights, shouldn't it be ok when using val_loss?

Hoping for hints and thank you in advance