Extra experiments with AUs.

This commit is contained in:
Tadas Baltrusaitis 2017-10-23 20:59:54 +01:00
parent c9061824c5
commit 5003f74fba
3 changed files with 23 additions and 12 deletions

View file

@ -1,5 +1,7 @@
if(exist('D:/Datasets/Bosphorus/', 'file')) if(exist('D:/Datasets/Bosphorus/', 'file'))
Bosphorus_dir = 'D:\Datasets\Bosphorus/'; Bosphorus_dir = 'D:\Datasets\Bosphorus/';
elseif(exist('E:/Datasets/Bosphorus/', 'file'))
Bosphorus_dir = 'E:\Datasets\Bosphorus/';
else else
fprintf('Bosphorus dataset location not found (or not defined)\n'); fprintf('Bosphorus dataset location not found (or not defined)\n');
end end

View file

@ -125,6 +125,8 @@ end
%% %%
f = fopen('results/BP4D_valid_res_class.txt', 'w'); f = fopen('results/BP4D_valid_res_class.txt', 'w');
f1s_class = zeros(1, numel(aus_BP4D));
for au = 1:numel(aus_BP4D) for au = 1:numel(aus_BP4D)
if(inds_au_class(au) ~= 0) if(inds_au_class(au) ~= 0)
@ -137,7 +139,7 @@ for au = 1:numel(aus_BP4D)
recall = tp./(tp+fn); recall = tp./(tp+fn);
f1 = 2 * precision .* recall ./ (precision + recall); f1 = 2 * precision .* recall ./ (precision + recall);
f1s_class(au) = f1;
fprintf(f, 'AU%d class, Precision - %.3f, Recall - %.3f, F1 - %.3f\n', aus_BP4D(au), precision, recall, f1); fprintf(f, 'AU%d class, Precision - %.3f, Recall - %.3f, F1 - %.3f\n', aus_BP4D(au), precision, recall, f1);
end end
@ -195,8 +197,10 @@ end
%% %%
f = fopen('results/BP4D_valid_res_int.txt', 'w'); f = fopen('results/BP4D_valid_res_int.txt', 'w');
ints_cccs = zeros(1, numel(aus_BP4D));
for au = 1:numel(aus_BP4D) for au = 1:numel(aus_BP4D)
[ accuracies, F1s, corrs, ccc, rms, classes ] = evaluate_au_prediction_results( preds_all_int(valid_ids, inds_au_int(au)), labels_gt(valid_ids,au)); [ accuracies, F1s, corrs, ccc, rms, classes ] = evaluate_au_prediction_results( preds_all_int(valid_ids, inds_au_int(au)), labels_gt(valid_ids,au));
ints_cccs(au) = ccc;
fprintf(f, 'AU%d results - rms %.3f, corr %.3f, ccc - %.3f\n', aus_BP4D(au), rms, corrs, ccc); fprintf(f, 'AU%d results - rms %.3f, corr %.3f, ccc - %.3f\n', aus_BP4D(au), rms, corrs, ccc);
end end
fclose(f); fclose(f);

View file

@ -100,6 +100,7 @@ end
f = fopen('results/Bosphorus_res_class.txt', 'w'); f = fopen('results/Bosphorus_res_class.txt', 'w');
labels_gt_bin = labels_gt; labels_gt_bin = labels_gt;
labels_gt_bin(labels_gt_bin > 1) = 1; labels_gt_bin(labels_gt_bin > 1) = 1;
f1s_class = zeros(1, numel(aus_Bosph));
for au = 1:numel(aus_Bosph) for au = 1:numel(aus_Bosph)
tp = sum(labels_gt_bin(:,au) == 1 & labels_pred(:, au) == 1); tp = sum(labels_gt_bin(:,au) == 1 & labels_pred(:, au) == 1);
@ -111,6 +112,7 @@ for au = 1:numel(aus_Bosph)
recall = tp./(tp+fn); recall = tp./(tp+fn);
f1 = 2 * precision .* recall ./ (precision + recall); f1 = 2 * precision .* recall ./ (precision + recall);
f1s_class(au) = f1;
fprintf(f, 'AU%d class, Precision - %.3f, Recall - %.3f, F1 - %.3f\n', aus_Bosph(au), precision, recall, f1); fprintf(f, 'AU%d class, Precision - %.3f, Recall - %.3f, F1 - %.3f\n', aus_Bosph(au), precision, recall, f1);
@ -180,10 +182,13 @@ end
%% %%
f = fopen('results/Bosphorus_res_int.txt', 'w'); f = fopen('results/Bosphorus_res_int.txt', 'w');
cccs_reg = zeros(1, numel(aus_Bosph));
for au = 1:numel(aus_Bosph) for au = 1:numel(aus_Bosph)
[ ~, ~, corrs, ccc, rms, ~ ] = evaluate_regression_results( labels_pred(:, au), labels_gt(:, au)); [ ~, ~, corrs, ccc, rms, ~ ] = evaluate_regression_results( labels_pred(:, au), labels_gt(:, au));
cccs_reg(au) = ccc;
fprintf(f, 'AU%d intensity, Corr - %.3f, RMS - %.3f, CCC - %.3f\n', aus_Bosph(au), corrs, rms, ccc); fprintf(f, 'AU%d intensity, Corr - %.3f, RMS - %.3f, CCC - %.3f\n', aus_Bosph(au), corrs, rms, ccc);
end end