Human gloss perception reproduced by tiny neural networks.
The 19 matches · 5 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
- [1] § Methods › Exclusion criteria ↔ process_onlinedata.m, lines 1–31 · score 0.70 · catch trials, median response, online experiment, observers
- [2] § Results › Computational models ↔ fig3_model_comparison.m, lines 26–83 · score 0.67 · physical ground truth, cross validation, correlation coefficient, human responses, networks, layers
- [3] § Methods › Computational modelling › Manipulation of the pattern of specular reflection ↔ fig6_highlight_manipulation.m, lines 18–101 · score 0.66 · surface roughness, surface contrast, manipulations, translation, rotated, rotation
- [4] § ‘Tiny’ neural networks as interpretable data-driven models ↔ function/XYZToSRGBPrimary.m, the whole file · a weak match · score 0.61 · CIE XYZ, gamma correction, sRGB, linear, matching
- [5] § Results › Computational models ↔ fig3_model_comparison.m, lines 1–18 · score 0.60 · ResNet18, specular metrics, computational models, ground truth, Figure 3, networks
- [6] § Methods › Computational modelling › Luminance statistics models ↔ save_luminance_stats.m, the whole file · a weak match · score 0.59 · kurtosis, quartile, skewness, Q1, Q3, luminance
- [7] § Methods › Stimuli ↔ function/XYZToSRGBPrimary.m, the whole file · a weak match · score 0.57 · gamma correction, sRGB, monitors, XYZ, linear, matching
- [8] § Results › Gloss illusion caused by manipulated specular highlights ↔ fig6_highlight_manipulation.m, lines 1–16 · score 0.56 · highlight rotation, surface roughness, translations, manipulated, predicted, gloss
- [9] § Results › Analysis of single-kernel models ↔ fig4c_4d_S7bc_S9c_analyze_kernel.m, lines 1–18 · score 0.55 · daylight locus, chromatic distribution, gamut, space, kernel, training
- [10] § Results › Perceptual experiments ↔ fig2_online_exp_results.m, lines 1–15 · score 0.55 · Intra observer, inter observer, ground truth, online, Perceptual, correlations
- [11] § Methods › Procedure and task ↔ process_onlinedata.m, lines 63–159 · score 0.53 · catch trial, slider, Median, Pellacini, Observers
- [12] § Methods › Computational modelling › Network architectures ↔ train.py, the whole file · a weak match · score 0.53 · Adam optimizer, convolutional layer, error, trained, networks, model
- [13] § Results › Computational models ↔ fig3_model_comparison.m, lines 291–433 · score 0.52 · luminance model, tailed, Cohen, CI, regression, errors
- [14] § Results › Analysis of single-kernel models ↔ fig4g_1kernel_fittingResults.m, lines 43–69 · score 0.52 · Gaussian ridge, ridge functions, amplitude, orientation, fitted, filters
- [15] § Methods › Stimuli ↔ fig6_highlight_manipulation.m, lines 18–101 · score 0.52 · surface roughness, rotated, rotations, pixel, positioned, network
- [16] § Results › Real-world photographs ↔ fig8_real_photographs.m, lines 87–132 · score 0.51 · comparing model, single kernel model, boundaries, layer model, matte, scatter
- [17] § Results › Analysis of single-kernel models ↔ fig4c_4d_S7bc_S9c_analyze_kernel.m, lines 1–18 · score 0.51 · daylight locus, Chromatic distribution, gamut, component, convolution, kernel
- [18] § Results › Computational models ↔ save_luminance_stats.m, the whole file · a weak match · score 0.50 · luminance distributions, kurtosis, quartile, skewness, median, linear
- [19] § Results › Perceptual experiments ↔ fig2_online_exp_results.m, lines 1–15 · score 0.50 · intra observer, ground truth correlation, Histogram, Figure 2, Perceptual, gloss
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 532 lines · 22 KB · MIT · 3 matches
- %--------------------------------------------------------------------------
- % This script generates Figure 3 for the manuscript.
- % It compares computational model performance in gloss perception by:
- % - Loading human and model response data,
- % - Computing and comparing correlation coefficients for one-layer, three-layer,
- % and ResNet18-based networks (with/without additional training data),
- % - Including image statistics and specular metrics models,
- % - Visualizing the relationship between correlation-to-ground-truth and
- % correlation-to-human for all approaches in a single comprehensive plot.
- % The script saves the resulting figure in the 'figs' directory.
- %
- % Author: TM, 2025
- %--------------------------------------------------------------------------
- % Source code to generate figures
- clearvars; close all; % cleaning
- disp('Generating figure 3...')
- %% Load Data
- load(fullfile('data','onlineData'))
- load(fullfile('data','imageStats_corrCoeff'))
- load(fullfile('data','imgStats_multiRegression_corrCoeff'))
- load(fullfile('data','fig_parameters'))
- %% One-layer and three-la models: load correlation coefficient
- kernelN_list.onelayer = [1 2 4 9];
- kernelN_list.threelayer = [9 16 32 64];
- filedir.onelayer = fullfile('data','networks','onelayer_models');
- filedir.threelayer = fullfile('data','networks','threelayer_models');
- cvtypeList = {'shape','lighting'};
- traininglabelList = {'human','groundtruth'};
- for model = {'onelayer','threelayer'}
- for kernelN_idx = 1:length(kernelN_list.(model{1}))
- kernelN = kernelN_list.(model{1})(kernelN_idx);
- for traininglabel = traininglabelList
- for cvtype = cvtypeList % validation type (shape-based or lighting-based cross validation)
- for ii = 1:12
- % Determine label ordering for correlation
- if strcmp(traininglabel{1}, 'human')
- % correlation to human response (human), or correlation to
- % physical ground-truth (gt)
- corrlabelList = {'human', 'gt'};
- else
- corrlabelList = {'gt', 'human'};
- end
- for corr_label = corrlabelList
- fname = fullfile(filedir.(model{1}), [traininglabel{1},'_kernelN',num2str(kernelN), ...
- '_',cvtype{1}, num2str(ii),'/corrs_',corr_label{1},'.csv']);
- temp = readmatrix(fname);
- % Pick the max correlation row according to label type
- % and use the same id to get the correlation for the
- % other objective
- if (strcmp(traininglabel{1},'human') && strcmp(corr_label{1},'human')) || ...
- (strcmp(traininglabel{1},'groundtruth') && strcmp(corr_label{1},'gt'))
- [~,maxid] = max(temp(:,1));
- end
- corr_all.(model{1}).(traininglabel{1}).(corr_label{1})(ii,strcmp(cvtype{1},cvtypeList),kernelN_idx) = temp(maxid,1);
- end
- end
- end
- end
- end
- end
- % Reshape and average correlation results for plotting
- for traininglabel = {'human','groundtruth'}
- for corr_label = {'human','gt'}
- oneLayer_corr.(traininglabel{1}).(corr_label{1}) = mean(reshape(corr_all.onelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.onelayer)));
- oneLayer_corr_SD.(traininglabel{1}).(corr_label{1}) = std(reshape(corr_all.onelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.onelayer)));
- threeLayers_corr.(traininglabel{1}).(corr_label{1}) = mean(reshape(corr_all.threelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.threelayer)));
- threeLayers_corr_SD.(traininglabel{1}).(corr_label{1}) = std(reshape(corr_all.threelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.threelayer)));
- end
- end
- %% Visualization & Figure generation
- cnt = 0;lw = 0.2;symbolsize = 50;
- % set color codes
- c_human = [90 152 152]/255;
- c_human_mean = [160 212 212]/255;
- c_oneLayer_human = [78 85 246]/255;
- c_oneLayer_gt = [184 0 127]/255;
- c_specularStr = [151 217 92]/255;
- c_ResNet18 = c_oneLayer_gt;
- c_additionalImage = [248 92 1]/255;
- basedir_additional = fullfile('data','networks','additional_trainingimgs');
- % load ResNet18 trained on ground-truth (additional training)
- % additional 500,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_500000/corrs_gt.csv']);
- [ResNet18_additional500000.gt,maxid] = max(temp(:,1));
- temp = readmatrix(fullfile(basedir_additional,'groundtruth_ResNet18_kernelN64_addtrainingN_500000/corrs_human.csv'));
- ResNet18_additional500000.human = temp(maxid,1);
- % additional 100,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_100000/corrs_gt.csv']);
- [ResNet18_additional100000.gt,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_100000/corrs_human.csv']);
- ResNet18_additional100000.human = temp(maxid,1);
- % additional 10,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_10000/corrs_human.csv']);
- [ResNet18_additional10000.human,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_10000/corrs_gt.csv']);
- ResNet18_additional10000.gt = temp(maxid,1);
- % load three-layer models trained on ground-truth (additional training)
- % additional 500,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_500000/corrs_gt.csv']);
- [twoArea_additional500000.gt,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_500000/corrs_human.csv']);
- twoArea_additional500000.human =temp(maxid,1);
- % additional 100,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_100000/corrs_gt.csv']);
- [twoArea_additional100000.gt,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_100000/corrs_human.csv']);
- twoArea_additional100000.human = temp(maxid,1);
- % additional 10,000 imgs
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_10000/corrs_gt.csv']);
- [twoArea_additional10000.gt,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_10000/corrs_human.csv']);
- twoArea_additional10000.human = temp(maxid,1);
- % load ResNet18 trained on ground-truth (no additional training)
- basedir_ResNet18 = fullfile('data','networks');
- temp = readmatrix([basedir_ResNet18,'/groundtruth_ResNet18_kernelN64/corrs_gt.csv']);
- [ResNet18.gt,maxid] = max(temp(:,1));
- temp = readmatrix([basedir_ResNet18,'/groundtruth_ResNet18_kernelN64/corrs_human.csv']);
- ResNet18.human = temp(maxid,1);
- %% compute correlation to groundtruth and correlation to other participants for each participant
- groupN_summary = zeros(54,1);
- for N = 1:length(data)
- onlineData(:,:,N) = data(N).response_Pellacini_c;
- groupN_summary(N) = data(N).groupN;
- end
- for groupN = 1:54
- idx = find(groupN_summary == groupN);
- for N = 1:length(idx)
- response_group.(['group',num2str(groupN)])(:,N) = mean(data(idx(N)).response_Pellacini_c,2);
- if N == 1
- gt_group.(['group',num2str(groupN)])(:,1) = gt(idx(N)).Pellacini_c(1:84);
- end
- end
- end
- for groupN = 1:54
- for subjectN = 1:size(response_group.(['group',num2str(groupN)]),2)
- cnt = cnt + 1;
- obs1 = response_group.(['group',num2str(groupN)])(:,subjectN);
- obs_rest = mean(response_group.(['group',num2str(groupN)])(:,[1:subjectN-1,subjectN+1:end]),2);
- gt_temp = gt_group.(['group',num2str(groupN)]);
- human_human_corr(cnt) = corr(obs1,obs_rest);
- human_gt_corr(cnt) = corr(obs1,gt_temp);
- end
- end
- %% Generate figure
- fig = figure;
- ax = gca;
- % fill the figure panel with different colors and draw a diagonal line
- fill([0,0,1],[0,1,1],c_oneLayer_human,'FaceAlpha',0.05,'EdgeColor','none');hold on;
- fill([0,1,1],[0,0,1],c_oneLayer_gt,'FaceAlpha',0.05,'EdgeColor','none');hold on;
- line([0,100],[0,100],'Color','k','LineWidth',0.5)
- %%%%%% plot human participant %%%%%%
- scatter(human_gt_corr,human_human_corr,20,c_human,'o','filled','MarkerEdgeColor','none','LineWidth',lw,'MarkerFaceAlpha',0.4);hold on;
- scatter(mean(human_gt_corr),mean(human_human_corr),50,c_human_mean,'x','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',1,'LineWidth',1.5);hold on;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot one-Layer rgb (human label) %%%%%%
- for kernelN = 1:size(oneLayer_corr.human.human,2)
- scatter(mean(oneLayer_corr.human.gt(:,kernelN)),mean(oneLayer_corr.human.human(:,kernelN)),40,c_oneLayer_human,'^','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot one-Layer rgb (gt label) %%%%%%
- for kernelN = 1:size(oneLayer_corr.groundtruth.human,2)
- scatter(mean(oneLayer_corr.groundtruth.gt(:,kernelN)),mean(oneLayer_corr.groundtruth.human(:,kernelN)),40,c_oneLayer_gt,'^','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot two-Layers rgb (human label) %%%%%%
- for kernelN = 1:size(threeLayers_corr.human.human,2)
- scatter(mean(threeLayers_corr.human.gt(:,kernelN)),mean(threeLayers_corr.human.human(:,kernelN)),50,c_oneLayer_human,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- scatter(mean(threeLayers_corr.groundtruth.gt(:,kernelN)),mean(threeLayers_corr.groundtruth.human(:,kernelN)),50,c_oneLayer_gt,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot ResNet18 (no additional) %%%%%%
- scatter(ResNet18.gt,ResNet18.human,40,c_ResNet18,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot networks trained on additional images %%%%%%
- scatter(ResNet18_additional100000.gt,ResNet18_additional100000.human,40,c_additionalImage,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- scatter(ResNet18_additional500000.gt,ResNet18_additional500000.human,40,c_additionalImage,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- hold on;
- %scatter(twoArea_additional10000.gt,twoArea_additional10000.human,50,c_oneLayer_human,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- scatter(twoArea_additional100000.gt,twoArea_additional100000.human,50,c_additionalImage,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- scatter(twoArea_additional500000.gt,twoArea_additional500000.human,50,c_additionalImage,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot image statistics models %%%%%%
- for N = 1:length(corrCoeff_imgStats.label)
- x = corrCoeff_imgStats.gtvsmodel(N,:);
- y = corrCoeff_imgStats.humanvsmodel(N,:);
- scatter(mean(x),mean(y),40,[.8 .8 .8],'d','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',1,'LineWidth',lw);hold on;
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot image statistics Multiple regression models %%%%%%
- x = corrCoeff_imgStats_multiRegression.gtvsmodel;
- y = corrCoeff_imgStats_multiRegression.humanvsmodel;
- scatter(mean(x),mean(y),60,[.8 .8 .8],'p','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',1,'LineWidth',lw);hold on;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot image statistics Multiple regression models %%%%%%
- load(fullfile('data','specularMetrics_multiRegression_corrCoeff.mat'))
- x = corrCoeff_specularMetrics_multiRegression.gtvsmodel;
- y = corrCoeff_specularMetrics_multiRegression.humanvsmodel;
- scatter(mean(x),mean(y),60,c_specularStr,'p','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%% plot specular reflection models %%%%%%
- for modellabel = {'contrast','coverage','sharpness'}
- x = abs(corrCoeff_specularMetrics.gt.(modellabel{1}));
- y = abs(corrCoeff_specularMetrics.human.(modellabel{1}));
- scatter(mean(x),mean(y),40,c_specularStr,'v','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- xlim([0 1]);ylim([0 1]);axis square
- xlabel('Correlation to ground-truth','FontWeight', 'Bold');ylabel('Correlation to human','FontWeight', 'Bold');
- fig.Units = 'centimeters';
- fig.Position = [10,10,figp.twocolumn/2,figp.twocolumn/2];
- fig.Color = 'w';
- fig.InvertHardcopy = 'off';
- xticks(0:0.25:1)
- yticks(0:0.25:1)
- ax.XTickLabel = {'0.00','0.25','0.50','0.75','1.00'};
- ax.YTickLabel = {'0.00','0.25','0.50','0.75','1.00'};
- ax.FontName = 'Arial';
- ax.Color = ones(1,3);
- ax.FontSize = figp.fontsize;
- ax.XColor = 'k';ax.YColor = 'k';
- ax.LineWidth = 0.5;
- ax.Units = 'centimeters';
- ax.Position = [0.95 0.85 7.6 7.6];
- ticklengthcm(ax,0.0)
- grid minor
- box off
- exportgraphics(fig,fullfile('figs','fig3(model_comparison).pdf'),'ContentType','vector')
- disp('Done.')
- close all
- %% ============================================================
- % Stats tests (24 paired correlations; correlation to human responses)
- % (1) Multi-reg (all luminance stats) vs mean luminance only
- % (2) Multi-reg (contrast+coverage+sharpness) vs sub-band contrast only
- % (3) One-layer (1 kernel) vs Three-layer (64 kernels)
- %% ============================================================
- alpha = 0.05; % 95% CI
- % --- Helper: find mean-luminance model row in corrCoeff_imgStats.label ---
- labels = corrCoeff_imgStats.label;
- if iscell(labels)
- labels_lower = lower(string(labels));
- else
- labels_lower = lower(string(labels(:)));
- end
- % Prefer label containing both "mean" and "lum"
- idx_meanlum = find(contains(labels_lower, "mean"), 1, 'first');
- if isempty(idx_meanlum)
- idx_meanlum = find(contains(labels_lower, "mean luminance"), 1, 'first');
- end
- if isempty(idx_meanlum)
- idx_meanlum = find(contains(labels_lower, "luminance"), 1, 'first');
- end
- if isempty(idx_meanlum)
- error('Could not identify the mean-luminance model in corrCoeff_imgStats.label. Please check label strings.');
- end
- % ============================================================
- % (1) Luminance: multi-reg vs mean luminance-only
- % ============================================================
- % Positive diff => multi-reg > mean-luminance
- y_lum_multi = corrCoeff_imgStats_multiRegression.humanvsmodel(:);
- y_meanlum = corrCoeff_imgStats.humanvsmodel(idx_meanlum, :).';
- if numel(y_lum_multi) ~= numel(y_meanlum)
- error('Size mismatch: multi-reg luminance (%d) vs mean-luminance (%d).', numel(y_lum_multi), numel(y_meanlum));
- end
- y_lum_multi = abs(y_lum_multi);
- y_meanlum = abs(y_meanlum);
- diff_lum = y_lum_multi - y_meanlum;
- [~, p_lum, ~, stats_lum] = ttest(diff_lum, 0, 'Alpha', alpha, 'Tail', 'both');
- n_lum = numel(diff_lum);
- df_lum = stats_lum.df;
- t_lum = stats_lum.tstat;
- dz_lum = mean(diff_lum) / std(diff_lum);
- [deltaL_lum, deltaU_lum] = local_nct_delta_ci(t_lum, df_lum, alpha);
- dzL_lum = deltaL_lum / sqrt(n_lum);
- dzU_lum = deltaU_lum / sqrt(n_lum);
- % ============================================================
- % (2) Specular: multi-reg vs contrast-only
- % ============================================================
- % Positive diff => multi-reg > contrast-only
- y_spec_multi = corrCoeff_specularMetrics_multiRegression.humanvsmodel(:);
- y_contrast = corrCoeff_specularMetrics.human.contrast(:);
- if numel(y_spec_multi) ~= numel(y_contrast)
- error('Size mismatch: multi-reg specular (%d) vs contrast-only (%d).', numel(y_spec_multi), numel(y_contrast));
- end
- y_spec_multi = abs(y_spec_multi);
- y_contrast = abs(y_contrast);
- diff_spec = y_spec_multi - y_contrast;
- [~, p_spec, ~, stats_spec] = ttest(diff_spec, 0, 'Alpha', alpha, 'Tail', 'both');
- n_spec = numel(diff_spec);
- df_spec = stats_spec.df;
- t_spec = stats_spec.tstat;
- dz_spec = mean(diff_spec) / std(diff_spec);
- [deltaL_spec, deltaU_spec] = local_nct_delta_ci(t_spec, df_spec, alpha);
- dzL_spec = deltaL_spec / sqrt(n_spec);
- dzU_spec = deltaU_spec / sqrt(n_spec);
- % ============================================================
- % (3) One-layer (1 kernel) vs Three-layer (64 kernels)
- % ============================================================
- % Positive diff => three-layer(64) > one-layer(1)
- % Find kernel indices
- idx_1kernel = find(kernelN_list.onelayer == 1, 1, 'first'); % 1
- idx_64kernel = find(kernelN_list.threelayer == 64, 1, 'first'); % 4
- if isempty(idx_1kernel) || isempty(idx_64kernel)
- error('Could not find kernel indices: one-layer(1) or three-layer(64).');
- end
- % --- IMPORTANT: use RAW 24 values (not means) ---
- % corr_all.onelayer.human.human has size: (12 x 2 x 4)
- % reshape -> (24 x 4) where 24 = 12(shape) + 12(lighting)
- r_one_all = reshape(corr_all.onelayer.human.human, 24, length(kernelN_list.onelayer));
- r_three_all = reshape(corr_all.threelayer.human.human, 24, length(kernelN_list.threelayer));
- r_one1 = r_one_all(:, idx_1kernel); % 24x1
- r_three64 = r_three_all(:, idx_64kernel); % 24x1
- diff_net = r_three64 - r_one1;
- % Paired t-test + Cohen's dz + CI(dz)
- [~, p_net, ~, stats_net] = ttest(diff_net, 0, 'Alpha', alpha, 'Tail', 'both');
- n_net = numel(diff_net);
- df_net = stats_net.df;
- t_net = stats_net.tstat;
- dz_net = mean(diff_net) / std(diff_net);
- [deltaL_net, deltaU_net] = local_nct_delta_ci(t_net, df_net, alpha);
- dzL_net = deltaL_net / sqrt(n_net);
- dzU_net = deltaU_net / sqrt(n_net);
- % ============================================================
- % Print full stats
- % ============================================================
- fprintf('\n=== Requested paired comparisons (n = %d patterns) ===\n', n_lum);
- fprintf('\n(1) All luminance stats (multi-reg) vs mean luminance-only:\n');
- if p_lum < 1e-3
- fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_lum, t_lum, dz_lum, dzL_lum, dzU_lum);
- else
- fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_lum, t_lum, p_lum, dz_lum, dzL_lum, dzU_lum);
- end
- fprintf('\n(2) All specular stats (multi-reg: contrast+coverage+sharpness) vs contrast-only:\n');
- if p_spec < 1e-3
- fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_spec, t_spec, dz_spec, dzL_spec, dzU_spec);
- else
- fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_spec, t_spec, p_spec, dz_spec, dzL_spec, dzU_spec);
- end
- fprintf('\n(3) One-layer (1 kernel) vs Three-layer (64 kernels):\n');
- if p_net < 1e-3
- fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_net, t_net, dz_net, dzL_net, dzU_net);
- else
- fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
- df_net, t_net, p_net, dz_net, dzL_net, dzU_net);
- end
- function [deltaL, deltaU] = local_nct_delta_ci(tObs, df, alpha)
- % 100*(1-alpha)% CI for noncentrality parameter delta of noncentral t,
- % inverted from observed tObs (two-sided).
- %
- % Solve:
- % nctcdf(tObs; df, deltaL) = 1 - alpha/2
- % nctcdf(tObs; df, deltaU) = alpha/2
- if exist('nctcdf','file') ~= 2
- error('nctcdf not found. Requires Statistics and Machine Learning Toolbox.');
- end
- targetL = 1 - alpha/2; % 0.975
- targetU = alpha/2; % 0.025
- deltaL = local_solve_delta_robust(tObs, df, targetL);
- deltaU = local_solve_delta_robust(tObs, df, targetU);
- if deltaL > deltaU
- tmp = deltaL; deltaL = deltaU; deltaU = tmp;
- end
- end
- function delta = local_solve_delta_robust(tObs, df, target)
- % Robustly solve nctcdf(tObs; df, delta) = target for delta.
- % Avoids non-finite endpoints and uses a safe fallback if bracketing fails.
- fun = @(d) nctcdf(tObs, df, d) - target;
- % Start near a reasonable center; delta is typically on the order of tObs
- center = tObs;
- % Candidate bracket half-widths (grow gradually)
- widths = [0.5 1 2 5 10 20 50 100 200 500 1000 2000];
- lo = NaN; hi = NaN;
- flo = NaN; fhi = NaN;
- % Try to find a finite bracket with sign change
- for w = widths
- lo_c = center - w;
- hi_c = center + w;
- flo_c = fun(lo_c);
- fhi_c = fun(hi_c);
- if isfinite(flo_c) && isreal(flo_c) && isfinite(fhi_c) && isreal(fhi_c)
- if sign(flo_c) ~= sign(fhi_c)
- lo = lo_c; hi = hi_c;
- flo = flo_c; fhi = fhi_c;
- break;
- end
- end
- end
- % If still not bracketed, try asymmetric expansion (sometimes needed)
- if isnan(lo)
- for w = widths
- lo_c = center - w;
- hi_c = center + 5*w;
- flo_c = fun(lo_c);
- fhi_c = fun(hi_c);
- if isfinite(flo_c) && isreal(flo_c) && isfinite(fhi_c) && isreal(fhi_c)
- if sign(flo_c) ~= sign(fhi_c)
- lo = lo_c; hi = hi_c;
- flo = flo_c; fhi = fhi_c;
- break;
- end
- end
- end
- end
- % If we found a valid bracket, use fzero safely
- if ~isnan(lo)
- try
- delta = fzero(fun, [lo, hi]);
- return;
- catch
- % fall through to fallback
- end
- end
- % Fallback: bounded minimization of squared error on a safe delta range
- % (keeps code from crashing even in rare numeric corner cases)
- bound = 2000; % wide enough for typical cases, avoids nctcdf blowups
- obj = @(d) (fun(d)).^2;
- try
- delta = fminbnd(obj, center - bound, center + bound);
- catch
- % last resort: return center
- delta = center;
- end
- end
fig3_model_comparison.m at commit 884485d, under MIT · at the source
Overview
- Department of Psychology, Justus-Liebig-Universität Gießen, Giessen, Germany
- Department of Experimental Psychology, University of Oxford, Oxford, UK
- School of Psychology, University of Auckland, Auckland, New Zealand
Abstract
A key goal of visual neuroscience is to explain how our brains infer object properties such as colour, curvature or gloss. Here we used machine learning to identify computations underlying human gloss judgements—traditionally
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 19 matches between paragraphs and lines of code.
takuma929/gloss_tinynetworks
884485d02f73d1a9aa079d3355dc4c774d36c994, 6 February 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
40 files
- fig2_online_exp_results.
m — MATLAB, 313 lines, 2 matches - fig3_model_comparison.m — MATLAB, 532 lines, 3 matches
- fig4b_24kernels.m — MATLAB, 85 lines
- fig4c_4d_S7bc_S9c_analyz
e_kernel.m — MATLAB, 130 lines, 2 matches - fig4g_1kernel_fittingRes
ults.m — MATLAB, 126 lines, 1 match - fig4h_24kernel_fittingRe
sults.m — MATLAB, 180 lines - fig4i_region_of_max_acti
vation.m — MATLAB, 184 lines - fig5b_tSNEplot.m — MATLAB, 142 lines
- fig6_highlight_manipulat
ion.m — MATLAB, 101 lines, 3 matches - fig7_Serrano_dataset.m — MATLAB, 152 lines
- fig8_real_photographs.m — MATLAB, 220 lines, 1 match
- figS2ANDS3_make_thumbnai
ls.m — MATLAB, 65 lines - figS3b_lighting_colordis
tribution.m — MATLAB, 119 lines - figS4AND5_scatter_lighti
ng_shape.m — MATLAB, 179 lines - figS6_offlinevsonline.m — MATLAB, 218 lines
- figS7a_24kernels_groundt
ruth.m — MATLAB, 85 lines - figS8_effect_background.
m — MATLAB, 225 lines - figS9_texture_objects.m — MATLAB, 273 lines
- fit_kernel_gauss_ridges.
m — MATLAB, 212 lines - function/
MakeItS.m — MATLAB, 29 lines - function/
MakeItWls.m — MATLAB, 13 lines - function/
SRGBGammaUncorrect.m — MATLAB, 28 lines - function/
SRGBPrimaryToXYZ.m — MATLAB, 19 lines - function/
SToWls.m — MATLAB, 28 lines - function/
SplineCmf.m — MATLAB, 26 lines - function/
SplineRaw.m — MATLAB, 78 lines - function/
XYZToLab.m — MATLAB, 72 lines - function/
XYZToSRGBPrimary.m — MATLAB, 39 lines, 2 matches - function/
XYZToxyY.m — MATLAB, 20 lines - function/
XYZimgToSRGBimg.m — MATLAB, 7 lines - function/
brewermap.m — MATLAB, 535 lines - function/
gaussfitn.m — MATLAB, 233 lines - function/
gloss_spectraTotristimul — MATLAB, 55 linesusvals_400to720.m - function/
ticklengthcm.m — MATLAB, 23 lines - main.m — MATLAB, 79 lines
- process_onlinedata.m — MATLAB, 160 lines, 2 matches
- save_fig_parameters.m — MATLAB, 40 lines
- save_luminance_stats.m — MATLAB, 44 lines, 2 matches
- LICENSE — License, 21 lines
- README.md — Text, 121 lines
Hans1984/material-illumination-geometry
2e8dae1c7f6dd1a81b4b639c11ae79ed32156f8d, 27 April 2023Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
8 files
Zenodo 19511809
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
Code availability
All custom analysis codes used to reproduce figures in this Article are available via GitHub at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 44 scripts, each with its path and the digest of its content;
- 19 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
All behavioural data, stimulus images and model data are available via GitHub at https://
All custom analysis codes used to reproduce figures in this Article are available via GitHub at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: — → Nature Portfolio
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 2 keywords, 5 MeSH terms, 3 funders, 58 references.
Cite
This paper
Morimoto, T., Akbarinia, A., Storrs, K. R., Cheeseman, J. R., Smithson, H. E., Gegenfurtner, K. R., & Fleming, R. W. (2026). Human gloss perception reproduced by tiny neural networks. Nature human behaviour, 10(7), 1340-1355. https://
BibTeX
@article{morimoto2026hum
author = {Morimoto, Takuma and Akbarinia, Arash and Storrs, Katherine R and Cheeseman, Jacob R and Smithson, Hannah E and Gegenfurtner, Karl R and Fleming, Roland W},
title = {{Human gloss perception reproduced by tiny neural networks}},
journal = {Nature human behaviour},
year = {2026},
month = may,
volume = {10},
number = {7},
pages = {1340--1355},
publisher = {Nature Portfolio},
issn = {2397-3374},
doi = {10.1038/
url = {https://
pmid = {42120903},
pmcid = {PMC13388104}
}
RIS
TY - JOUR
AU - Morimoto, Takuma
AU - Akbarinia, Arash
AU - Storrs, Katherine R
AU - Cheeseman, Jacob R
AU - Smithson, Hannah E
AU - Gegenfurtner, Karl R
AU - Fleming, Roland W
TI - Human gloss perception reproduced by tiny neural networks
T2 - Nature human behaviour
J2 - Nat Hum Behav
PY - 2026
DA - 2026/
VL - 10
IS - 7
SP - 1340
EP - 1355
SN - 2397-3374
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Human gloss perception reproduced by tiny neural networks",
"container-title": "Nature human behaviour",
"author": [
{
"family": "Morimoto",
"given": "Takuma"
},
{
"family": "Akbarinia",
"given": "Arash"
},
{
"family": "Storrs",
"given": "Katherine R"
},
{
"family": "Cheeseman",
"given": "Jacob R"
},
{
"family": "Smithson",
"given": "Hannah E"
},
{
"family": "Gegenfurtner",
"given": "Karl R"
},
{
"family": "Fleming",
"given": "Roland W"
}
],
"container-title-short":
"volume": "10",
"issue": "7",
"page": "1340-1355",
"DOI": "10.1038/
"PMID": "42120903",
"PMCID": "PMC13388104",
"ISSN": "2397-3374",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
12
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: Optimization Toolbox, TensorFlow, OpenCV, 5 other tools
- [2] doi:10.1038/s41586-026-10631-3 [code]
- A prognostic human brain network for diffuse midline glioma.Journal: NatureIn common: Optimization Toolbox, TensorFlow, Image Processing Toolbox, 5 other tools
- [3] doi:10.1126/sciadv.aeh7220 [code]
- Central complex representations of self-movement are sufficient to compute wind direction in flight.Journal: Science advancesIn common: Optimization Toolbox, TensorFlow, Image Processing Toolbox, 5 other tools
- [4] doi:10.1038/s41593-026-02255-7 [code]
- Neural circuits encode prior knowledge of temporal statistics.Journal: Nature neuroscienceIn common: Optimization Toolbox, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 4 other tools, 1 reference
- [5] doi:10.1016/j.isci.2026.117375 [code]
- Motor priming is associated with widespread recruitment into neural ensembles and more rapid ensemble transitions.Journal: iScienceIn common: Optimization Toolbox, OpenCV, Image Processing Toolbox, 5 other tools
- [6] doi:10.1038/s41593-026-02232-0 [code]
- Entorhinal cortex represents task-relevant remote locations independently of CA1.Journal: Nature neuroscienceIn common: Optimization Toolbox, OpenCV, Image Processing Toolbox, 5 other tools
- [7] doi:10.1162/imag.a.1266 [code]
- Multimodal subspace independent vector analysis effectively captures latent relationships between brain structure and function.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Optimization Toolbox, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 4 other tools, 1 reference
- [8] doi:10.1002/hbm.70602 [code]
- Neuroimaging Correlates of Post-Stroke Pain After Ischemic Stroke: Secondary Analysis of the INSPiRE-TMS Trial.Journal: Human brain mappingIn common: Optimization Toolbox, TensorFlow, Image Processing Toolbox, 4 other tools
- [9] doi:10.1080/07853890.2026.2685416 [code]
- Pulmonary and cerebral damage in COVID-19 survivors: is there any association?Journal: Annals of medicineIn common: Optimization Toolbox, TensorFlow, Image Processing Toolbox, 4 other tools
- [10] doi:10.1111/ene.70678 [code]
- Who Falls After a Stroke? Evidence From a Prospective Stroke Cohort.Journal: European journal of neurologyIn common: Optimization Toolbox, TensorFlow, Image Processing Toolbox, 4 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 3 repositories of the authors' code, each at its verified commit and with its license, 44 scripts, and 19 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:ab4679967020ca2b…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
