def evaluate_endtoend_identification(training = False, num_folds = 10, fcn_filters = 128, augm = False, augm_type=AugmentationType.RND): model_name = generate_model_name(representation_type=RepresentationType.EE, fcn_filters = fcn_filters, augm = augm, augm_type = augm_type) if training == True: df_idnet = pd.read_csv("input_csv_gait/idnet_raw.csv", header = None) if augm == True: df_idnet = get_augmented_dataset(df_idnet, augm_type) df_idnet = normalize_rows( df_idnet, st.NormalizationType.ZSCORE) train_model(df_idnet, model_name, fcn_filters = fcn_filters, representation_learning=True) df1 = pd.read_csv("input_csv_gait/zju_session1_frames_raw.csv", header = None) df2 = pd.read_csv("input_csv_gait/zju_session2_frames_raw.csv", header = None) df1 = normalize_rows( df1, st.NormalizationType.ZSCORE) df2 = normalize_rows( df2, st.NormalizationType.ZSCORE) features1 = get_model_output_features( df1, model_name) features2 = get_model_output_features( df2, model_name) print("\nSession 1") evaluate_identification_CV(features1, num_folds = num_folds) print("\nSession 2") evaluate_identification_CV(features2, num_folds = num_folds) print("\nCross-Session")
def evaluate_endtoend_identification(training=False, augm=False, augm_type=AugmentationType.RND): if augm == True: if augm_type == AugmentationType.RND: model_name = "gait_fcn_rnd.h5" else: model_name = "gait_fcn_cshift.h5" else: model_name = "gait_fcn.h5" if training == True: df_idnet = pd.read_csv("input_csv/idnet.csv", header=None) if augm == True: df_idnet = get_augmented_dataset(df_idnet, augm_type) df_idnet = normalize_rows(df_idnet, st.NormalizationType.ZSCORE) train_model(df_idnet, model_name) df1 = pd.read_csv("input_csv/zju_session1_frames_raw.csv", header=None) df2 = pd.read_csv("input_csv/zju_session2_frames_raw.csv", header=None) df1 = normalize_rows(df1, st.NormalizationType.ZSCORE) df2 = normalize_rows(df2, st.NormalizationType.ZSCORE) features1 = get_model_output_features(df1, model_name) features2 = get_model_output_features(df2, model_name) evaluate_identification_CV(features1, num_folds=10) evaluate_identification_CV(features2, num_folds=10) evaluate_identification_Train_Test(features1, features2)
def evaluate_autoencoder_authentication( training=False, augm=False, augm_type=AugmentationType.RND, verbose=False, filename='results/autoencoder_scores.csv'): if augm == True: if augm_type == AugmentationType.RND: model_name = "gait_autoencoder_fcn_rnd.h5" else: model_name = "gait_autoencoder_fcn_cshift.h5" else: model_name = "gait_autoencoder_fcn.h5" if training == True: df_idnet = pd.read_csv("input_csv/idnet.csv", header=None) df_idnet = normalize_rows(df_idnet, st.NormalizationType.ZSCORE) if augm == True: df_idnet = get_augmented_dataset(df_idnet, augm_type) train_autoencoder(df_idnet, model_name=model_name, num_epochs=100) encoder_name = "encoder_" + model_name df1 = pd.read_csv("input_csv/zju_session1_frames_raw.csv", header=None) df2 = pd.read_csv("input_csv/zju_session2_frames_raw.csv", header=None) df1 = normalize_rows(df1, st.NormalizationType.ZSCORE) df2 = normalize_rows(df2, st.NormalizationType.ZSCORE) features1 = get_autoencoder_output_features(df1, encoder_name) features2 = get_autoencoder_output_features(df2, encoder_name) auc1, eer1 = evaluate_authentication(features1, verbose) auc2, eer2 = evaluate_authentication(features2, verbose) auc_cross, eer_cross = evaluate_authentication_cross_day( features1, features2, verbose) # dictionary of lists dict = { 'AUC1': auc1, 'EER1': eer1, 'AUC2': auc2, 'EER2': eer2, 'AUC_cross': auc_cross, 'EER_cross': eer_cross } df = pd.DataFrame(dict) df.to_csv(filename, index=False)
def evaluate_autoencoder_authentication( training=False, fcn_filters=128, augm=False, augm_type=AugmentationType.RND, verbose=False, filename='results/autoencoder_scores.csv'): representation_type = RepresentationType.AE model_name = generate_model_name(representation_type, fcn_filters=fcn_filters, augm=augm, augm_type=augm_type) if training == True: df_idnet = pd.read_csv("input_csv_gait/idnet_raw.csv", header=None) df_idnet = normalize_rows(df_idnet, st.NormalizationType.ZSCORE) if augm == True: df_idnet = get_augmented_dataset(df_idnet, augm_type) train_autoencoder(df_idnet, model_name=model_name, fcn_filters=fcn_filters) encoder_name = "encoder_" + model_name df1 = pd.read_csv("input_csv_gait/zju_session1_frames_raw.csv", header=None) df2 = pd.read_csv("input_csv_gait/zju_session2_frames_raw.csv", header=None) df1 = normalize_rows(df1, st.NormalizationType.ZSCORE) df2 = normalize_rows(df2, st.NormalizationType.ZSCORE) features1 = get_autoencoder_output_features(df1, encoder_name) features2 = get_autoencoder_output_features(df2, encoder_name) roc_data_filename = 'results/roc_session1_' + str( representation_type.value) + '_' + str(data_type.value) + '.csv' auc1, eer1 = evaluate_authentication(features1, data_type, representation_type, verbose=verbose, roc_data=True, roc_data_filename=roc_data_filename) roc_data_filename = 'results/roc_session2_' + str( representation_type.value) + '_' + str(data_type.value) + '.csv' auc2, eer2 = evaluate_authentication(features1, data_type, representation_type, verbose=verbose, roc_data=True, roc_data_filename=roc_data_filename) roc_data_filename = 'results/roc_cross_session_' + str( representation_type.value) + '_' + str(data_type.value) + '.csv' auc_cross, eer_cross = evaluate_authentication_cross_day( features1, features2, data_type, representation_type, verbose=verbose, roc_data=True, roc_data_filename=roc_data_filename) scores_filename = 'results/auc_eer_users_' + str( representation_type.value) + '_' + str(data_type.value) + '.csv' dict = { 'AUC1': auc1, 'EER1': eer1, 'AUC2': auc2, 'EER2': eer2, 'AUC_cross': auc_cross, 'EER_cross': eer_cross } df = pd.DataFrame(dict) df.to_csv(scores_filename, index=False)