OSCR

Human gloss perception reproduced by tiny neural networks.

Code ↔ Paper

19 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 19 matches · 5 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › Exclusion criteria ↔ process_onlinedata.m, lines 1 to 31 · score 0.70 · catch trials, median response, online experiment, observers · Report a mismatch
  2. [2] § Results › Computational models ↔ fig3_model_comparison.m, lines 26 to 83 · score 0.67 · physical ground truth, cross validation, correlation coefficient, human responses, networks, layers · Report a mismatch
  3. [3] § Methods › Computational modelling › Manipulation of the pattern of specular reflection ↔ fig6_highlight_manipulation.m, lines 18 to 101 · score 0.66 · surface roughness, surface contrast, manipulations, translation, rotated, rotation · Report a mismatch
  4. [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 · Report a mismatch
  5. [5] § Results › Computational models ↔ fig3_model_comparison.m, lines 1 to 18 · score 0.60 · ResNet18, specular metrics, computational models, ground truth, Figure 3, networks · Report a mismatch
  6. [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 · Report a mismatch
  7. [7] § Methods › Stimuli ↔ function/XYZToSRGBPrimary.m, the whole file · a weak match · score 0.57 · gamma correction, sRGB, monitors, XYZ, linear, matching · Report a mismatch
  8. [8] § Results › Gloss illusion caused by manipulated specular highlights ↔ fig6_highlight_manipulation.m, lines 1 to 16 · score 0.56 · highlight rotation, surface roughness, translations, manipulated, predicted, gloss · Report a mismatch
  9. [9] § Results › Analysis of single-kernel models ↔ fig4c_4d_S7bc_S9c_analyze_kernel.m, lines 1 to 18 · score 0.55 · daylight locus, chromatic distribution, gamut, space, kernel, training · Report a mismatch
  10. [10] § Results › Perceptual experiments ↔ fig2_online_exp_results.m, lines 1 to 15 · score 0.55 · Intra observer, inter observer, ground truth, online, Perceptual, correlations · Report a mismatch
  11. [11] § Methods › Procedure and task ↔ process_onlinedata.m, lines 63 to 159 · score 0.53 · catch trial, slider, Median, Pellacini, Observers · Report a mismatch
  12. [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 · Report a mismatch
  13. [13] § Results › Computational models ↔ fig3_model_comparison.m, lines 291 to 433 · score 0.52 · luminance model, tailed, Cohen, CI, regression, errors · Report a mismatch
  14. [14] § Results › Analysis of single-kernel models ↔ fig4g_1kernel_fittingResults.m, lines 43 to 69 · score 0.52 · Gaussian ridge, ridge functions, amplitude, orientation, fitted, filters · Report a mismatch
  15. [15] § Methods › Stimuli ↔ fig6_highlight_manipulation.m, lines 18 to 101 · score 0.52 · surface roughness, rotated, rotations, pixel, positioned, network · Report a mismatch
  16. [16] § Results › Real-world photographs ↔ fig8_real_photographs.m, lines 87 to 132 · score 0.51 · comparing model, single kernel model, boundaries, layer model, matte, scatter · Report a mismatch
  17. [17] § Results › Analysis of single-kernel models ↔ fig4c_4d_S7bc_S9c_analyze_kernel.m, lines 1 to 18 · score 0.51 · daylight locus, Chromatic distribution, gamut, component, convolution, kernel · Report a mismatch
  18. [18] § Results › Computational models ↔ save_luminance_stats.m, the whole file · a weak match · score 0.50 · luminance distributions, kurtosis, quartile, skewness, median, linear · Report a mismatch
  19. [19] § Results › Perceptual experiments ↔ fig2_online_exp_results.m, lines 1 to 15 · score 0.50 · intra observer, ground truth correlation, Histogram, Figure 2, Perceptual, gloss · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 532 lines · 22 KB · MIT · 3 matches

  1. %--------------------------------------------------------------------------
  2. % This script generates Figure 3 for the manuscript.
  3. % It compares computational model performance in gloss perception by:
  4. % - Loading human and model response data,
  5. % - Computing and comparing correlation coefficients for one-layer, three-layer,
  6. % and ResNet18-based networks (with/without additional training data),
  7. % - Including image statistics and specular metrics models,
  8. % - Visualizing the relationship between correlation-to-ground-truth and
  9. % correlation-to-human for all approaches in a single comprehensive plot.
  10. % The script saves the resulting figure in the 'figs' directory.
  11. %
  12. % Author: TM, 2025
  13. %--------------------------------------------------------------------------
  14. % Source code to generate figures
  15. clearvars; close all; % cleaning
  16. disp('Generating figure 3...')
  17. %% Load Data
  18. load(fullfile('data','onlineData'))
  19. load(fullfile('data','imageStats_corrCoeff'))
  20. load(fullfile('data','imgStats_multiRegression_corrCoeff'))
  21. load(fullfile('data','fig_parameters'))
  22. %% One-layer and three-la models: load correlation coefficient
  23. kernelN_list.onelayer = [1 2 4 9];
  24. kernelN_list.threelayer = [9 16 32 64];
  25. filedir.onelayer = fullfile('data','networks','onelayer_models');
  26. filedir.threelayer = fullfile('data','networks','threelayer_models');
  27. cvtypeList = {'shape','lighting'};
  28. traininglabelList = {'human','groundtruth'};
  29. for model = {'onelayer','threelayer'}
  30. for kernelN_idx = 1:length(kernelN_list.(model{1}))
  31. kernelN = kernelN_list.(model{1})(kernelN_idx);
  32. for traininglabel = traininglabelList
  33. for cvtype = cvtypeList % validation type (shape-based or lighting-based cross validation)
  34. for ii = 1:12
  35. % Determine label ordering for correlation
  36. if strcmp(traininglabel{1}, 'human')
  37. % correlation to human response (human), or correlation to
  38. % physical ground-truth (gt)
  39. corrlabelList = {'human', 'gt'};
  40. else
  41. corrlabelList = {'gt', 'human'};
  42. end
  43. for corr_label = corrlabelList
  44. fname = fullfile(filedir.(model{1}), [traininglabel{1},'_kernelN',num2str(kernelN), ...
  45. '_',cvtype{1}, num2str(ii),'/corrs_',corr_label{1},'.csv']);
  46. temp = readmatrix(fname);
  47. % Pick the max correlation row according to label type
  48. % and use the same id to get the correlation for the
  49. % other objective
  50. if (strcmp(traininglabel{1},'human') && strcmp(corr_label{1},'human')) || ...
  51. (strcmp(traininglabel{1},'groundtruth') && strcmp(corr_label{1},'gt'))
  52. [~,maxid] = max(temp(:,1));
  53. end
  54. corr_all.(model{1}).(traininglabel{1}).(corr_label{1})(ii,strcmp(cvtype{1},cvtypeList),kernelN_idx) = temp(maxid,1);
  55. end
  56. end
  57. end
  58. end
  59. end
  60. end
  61. % Reshape and average correlation results for plotting
  62. for traininglabel = {'human','groundtruth'}
  63. for corr_label = {'human','gt'}
  64. oneLayer_corr.(traininglabel{1}).(corr_label{1}) = mean(reshape(corr_all.onelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.onelayer)));
  65. oneLayer_corr_SD.(traininglabel{1}).(corr_label{1}) = std(reshape(corr_all.onelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.onelayer)));
  66. threeLayers_corr.(traininglabel{1}).(corr_label{1}) = mean(reshape(corr_all.threelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.threelayer)));
  67. threeLayers_corr_SD.(traininglabel{1}).(corr_label{1}) = std(reshape(corr_all.threelayer.(traininglabel{1}).(corr_label{1}),24,length(kernelN_list.threelayer)));
  68. end
  69. end
  70. %% Visualization & Figure generation
  71. cnt = 0;lw = 0.2;symbolsize = 50;
  72. % set color codes
  73. c_human = [90 152 152]/255;
  74. c_human_mean = [160 212 212]/255;
  75. c_oneLayer_human = [78 85 246]/255;
  76. c_oneLayer_gt = [184 0 127]/255;
  77. c_specularStr = [151 217 92]/255;
  78. c_ResNet18 = c_oneLayer_gt;
  79. c_additionalImage = [248 92 1]/255;
  80. basedir_additional = fullfile('data','networks','additional_trainingimgs');
  81. % load ResNet18 trained on ground-truth (additional training)
  82. % additional 500,000 imgs
  83. temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_500000/corrs_gt.csv']);
  84. [ResNet18_additional500000.gt,maxid] = max(temp(:,1));
  85. temp = readmatrix(fullfile(basedir_additional,'groundtruth_ResNet18_kernelN64_addtrainingN_500000/corrs_human.csv'));
  86. ResNet18_additional500000.human = temp(maxid,1);
  87. % additional 100,000 imgs
  88. temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_100000/corrs_gt.csv']);
  89. [ResNet18_additional100000.gt,maxid] = max(temp(:,1));
  90. temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_100000/corrs_human.csv']);
  91. ResNet18_additional100000.human = temp(maxid,1);
  92. % additional 10,000 imgs
  93. temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_10000/corrs_human.csv']);
  94. [ResNet18_additional10000.human,maxid] = max(temp(:,1));
  95. temp = readmatrix([basedir_additional,'/groundtruth_ResNet18_kernelN64_addtrainingN_10000/corrs_gt.csv']);
  96. ResNet18_additional10000.gt = temp(maxid,1);
  97. % load three-layer models trained on ground-truth (additional training)
  98. % additional 500,000 imgs
  99. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_500000/corrs_gt.csv']);
  100. [twoArea_additional500000.gt,maxid] = max(temp(:,1));
  101. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_500000/corrs_human.csv']);
  102. twoArea_additional500000.human =temp(maxid,1);
  103. % additional 100,000 imgs
  104. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_100000/corrs_gt.csv']);
  105. [twoArea_additional100000.gt,maxid] = max(temp(:,1));
  106. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_100000/corrs_human.csv']);
  107. twoArea_additional100000.human = temp(maxid,1);
  108. % additional 10,000 imgs
  109. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_10000/corrs_gt.csv']);
  110. [twoArea_additional10000.gt,maxid] = max(temp(:,1));
  111. temp = readmatrix([basedir_additional,'/groundtruth_threelayer_kernelN64_addtrainingN_10000/corrs_human.csv']);
  112. twoArea_additional10000.human = temp(maxid,1);
  113. % load ResNet18 trained on ground-truth (no additional training)
  114. basedir_ResNet18 = fullfile('data','networks');
  115. temp = readmatrix([basedir_ResNet18,'/groundtruth_ResNet18_kernelN64/corrs_gt.csv']);
  116. [ResNet18.gt,maxid] = max(temp(:,1));
  117. temp = readmatrix([basedir_ResNet18,'/groundtruth_ResNet18_kernelN64/corrs_human.csv']);
  118. ResNet18.human = temp(maxid,1);
  119. %% compute correlation to groundtruth and correlation to other participants for each participant
  120. groupN_summary = zeros(54,1);
  121. for N = 1:length(data)
  122. onlineData(:,:,N) = data(N).response_Pellacini_c;
  123. groupN_summary(N) = data(N).groupN;
  124. end
  125. for groupN = 1:54
  126. idx = find(groupN_summary == groupN);
  127. for N = 1:length(idx)
  128. response_group.(['group',num2str(groupN)])(:,N) = mean(data(idx(N)).response_Pellacini_c,2);
  129. if N == 1
  130. gt_group.(['group',num2str(groupN)])(:,1) = gt(idx(N)).Pellacini_c(1:84);
  131. end
  132. end
  133. end
  134. for groupN = 1:54
  135. for subjectN = 1:size(response_group.(['group',num2str(groupN)]),2)
  136. cnt = cnt + 1;
  137. obs1 = response_group.(['group',num2str(groupN)])(:,subjectN);
  138. obs_rest = mean(response_group.(['group',num2str(groupN)])(:,[1:subjectN-1,subjectN+1:end]),2);
  139. gt_temp = gt_group.(['group',num2str(groupN)]);
  140. human_human_corr(cnt) = corr(obs1,obs_rest);
  141. human_gt_corr(cnt) = corr(obs1,gt_temp);
  142. end
  143. end
  144. %% Generate figure
  145. fig = figure;
  146. ax = gca;
  147. % fill the figure panel with different colors and draw a diagonal line
  148. fill([0,0,1],[0,1,1],c_oneLayer_human,'FaceAlpha',0.05,'EdgeColor','none');hold on;
  149. fill([0,1,1],[0,0,1],c_oneLayer_gt,'FaceAlpha',0.05,'EdgeColor','none');hold on;
  150. line([0,100],[0,100],'Color','k','LineWidth',0.5)
  151. %%%%%% plot human participant %%%%%%
  152. scatter(human_gt_corr,human_human_corr,20,c_human,'o','filled','MarkerEdgeColor','none','LineWidth',lw,'MarkerFaceAlpha',0.4);hold on;
  153. 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;
  154. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  155. %%%%%% plot one-Layer rgb (human label) %%%%%%
  156. for kernelN = 1:size(oneLayer_corr.human.human,2)
  157. 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;
  158. end
  159. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  160. %%%%%% plot one-Layer rgb (gt label) %%%%%%
  161. for kernelN = 1:size(oneLayer_corr.groundtruth.human,2)
  162. 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;
  163. end
  164. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  165. %%%%%% plot two-Layers rgb (human label) %%%%%%
  166. for kernelN = 1:size(threeLayers_corr.human.human,2)
  167. 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;
  168. 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;
  169. end
  170. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  171. %%%%%% plot ResNet18 (no additional) %%%%%%
  172. scatter(ResNet18.gt,ResNet18.human,40,c_ResNet18,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  173. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  174. %%%%%% plot networks trained on additional images %%%%%%
  175. scatter(ResNet18_additional100000.gt,ResNet18_additional100000.human,40,c_additionalImage,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  176. scatter(ResNet18_additional500000.gt,ResNet18_additional500000.human,40,c_additionalImage,'>','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  177. hold on;
  178. %scatter(twoArea_additional10000.gt,twoArea_additional10000.human,50,c_oneLayer_human,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  179. scatter(twoArea_additional100000.gt,twoArea_additional100000.human,50,c_additionalImage,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  180. scatter(twoArea_additional500000.gt,twoArea_additional500000.human,50,c_additionalImage,'s','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  181. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  182. %%%%%% plot image statistics models %%%%%%
  183. for N = 1:length(corrCoeff_imgStats.label)
  184. x = corrCoeff_imgStats.gtvsmodel(N,:);
  185. y = corrCoeff_imgStats.humanvsmodel(N,:);
  186. scatter(mean(x),mean(y),40,[.8 .8 .8],'d','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',1,'LineWidth',lw);hold on;
  187. end
  188. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  189. %%%%%% plot image statistics Multiple regression models %%%%%%
  190. x = corrCoeff_imgStats_multiRegression.gtvsmodel;
  191. y = corrCoeff_imgStats_multiRegression.humanvsmodel;
  192. scatter(mean(x),mean(y),60,[.8 .8 .8],'p','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',1,'LineWidth',lw);hold on;
  193. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  194. %%%%%% plot image statistics Multiple regression models %%%%%%
  195. load(fullfile('data','specularMetrics_multiRegression_corrCoeff.mat'))
  196. x = corrCoeff_specularMetrics_multiRegression.gtvsmodel;
  197. y = corrCoeff_specularMetrics_multiRegression.humanvsmodel;
  198. scatter(mean(x),mean(y),60,c_specularStr,'p','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  199. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  200. %%%%%% plot specular reflection models %%%%%%
  201. for modellabel = {'contrast','coverage','sharpness'}
  202. x = abs(corrCoeff_specularMetrics.gt.(modellabel{1}));
  203. y = abs(corrCoeff_specularMetrics.human.(modellabel{1}));
  204. scatter(mean(x),mean(y),40,c_specularStr,'v','filled','MarkerEdgeColor',[0 0 0],'MarkerFaceAlpha',0.5,'LineWidth',lw);hold on;
  205. end
  206. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  207. xlim([0 1]);ylim([0 1]);axis square
  208. xlabel('Correlation to ground-truth','FontWeight', 'Bold');ylabel('Correlation to human','FontWeight', 'Bold');
  209. fig.Units = 'centimeters';
  210. fig.Position = [10,10,figp.twocolumn/2,figp.twocolumn/2];
  211. fig.Color = 'w';
  212. fig.InvertHardcopy = 'off';
  213. xticks(0:0.25:1)
  214. yticks(0:0.25:1)
  215. ax.XTickLabel = {'0.00','0.25','0.50','0.75','1.00'};
  216. ax.YTickLabel = {'0.00','0.25','0.50','0.75','1.00'};
  217. ax.FontName = 'Arial';
  218. ax.Color = ones(1,3);
  219. ax.FontSize = figp.fontsize;
  220. ax.XColor = 'k';ax.YColor = 'k';
  221. ax.LineWidth = 0.5;
  222. ax.Units = 'centimeters';
  223. ax.Position = [0.95 0.85 7.6 7.6];
  224. ticklengthcm(ax,0.0)
  225. grid minor
  226. box off
  227. exportgraphics(fig,fullfile('figs','fig3(model_comparison).pdf'),'ContentType','vector')
  228. disp('Done.')
  229. close all
  230. %% ============================================================
  231. % Stats tests (24 paired correlations; correlation to human responses)
  232. % (1) Multi-reg (all luminance stats) vs mean luminance only
  233. % (2) Multi-reg (contrast+coverage+sharpness) vs sub-band contrast only
  234. % (3) One-layer (1 kernel) vs Three-layer (64 kernels)
  235. %% ============================================================
  236. alpha = 0.05; % 95% CI
  237. % --- Helper: find mean-luminance model row in corrCoeff_imgStats.label ---
  238. labels = corrCoeff_imgStats.label;
  239. if iscell(labels)
  240. labels_lower = lower(string(labels));
  241. else
  242. labels_lower = lower(string(labels(:)));
  243. end
  244. % Prefer label containing both "mean" and "lum"
  245. idx_meanlum = find(contains(labels_lower, "mean"), 1, 'first');
  246. if isempty(idx_meanlum)
  247. idx_meanlum = find(contains(labels_lower, "mean luminance"), 1, 'first');
  248. end
  249. if isempty(idx_meanlum)
  250. idx_meanlum = find(contains(labels_lower, "luminance"), 1, 'first');
  251. end
  252. if isempty(idx_meanlum)
  253. error('Could not identify the mean-luminance model in corrCoeff_imgStats.label. Please check label strings.');
  254. end
  255. % ============================================================
  256. % (1) Luminance: multi-reg vs mean luminance-only
  257. % ============================================================
  258. % Positive diff => multi-reg > mean-luminance
  259. y_lum_multi = corrCoeff_imgStats_multiRegression.humanvsmodel(:);
  260. y_meanlum = corrCoeff_imgStats.humanvsmodel(idx_meanlum, :).';
  261. if numel(y_lum_multi) ~= numel(y_meanlum)
  262. error('Size mismatch: multi-reg luminance (%d) vs mean-luminance (%d).', numel(y_lum_multi), numel(y_meanlum));
  263. end
  264. y_lum_multi = abs(y_lum_multi);
  265. y_meanlum = abs(y_meanlum);
  266. diff_lum = y_lum_multi - y_meanlum;
  267. [~, p_lum, ~, stats_lum] = ttest(diff_lum, 0, 'Alpha', alpha, 'Tail', 'both');
  268. n_lum = numel(diff_lum);
  269. df_lum = stats_lum.df;
  270. t_lum = stats_lum.tstat;
  271. dz_lum = mean(diff_lum) / std(diff_lum);
  272. [deltaL_lum, deltaU_lum] = local_nct_delta_ci(t_lum, df_lum, alpha);
  273. dzL_lum = deltaL_lum / sqrt(n_lum);
  274. dzU_lum = deltaU_lum / sqrt(n_lum);
  275. % ============================================================
  276. % (2) Specular: multi-reg vs contrast-only
  277. % ============================================================
  278. % Positive diff => multi-reg > contrast-only
  279. y_spec_multi = corrCoeff_specularMetrics_multiRegression.humanvsmodel(:);
  280. y_contrast = corrCoeff_specularMetrics.human.contrast(:);
  281. if numel(y_spec_multi) ~= numel(y_contrast)
  282. error('Size mismatch: multi-reg specular (%d) vs contrast-only (%d).', numel(y_spec_multi), numel(y_contrast));
  283. end
  284. y_spec_multi = abs(y_spec_multi);
  285. y_contrast = abs(y_contrast);
  286. diff_spec = y_spec_multi - y_contrast;
  287. [~, p_spec, ~, stats_spec] = ttest(diff_spec, 0, 'Alpha', alpha, 'Tail', 'both');
  288. n_spec = numel(diff_spec);
  289. df_spec = stats_spec.df;
  290. t_spec = stats_spec.tstat;
  291. dz_spec = mean(diff_spec) / std(diff_spec);
  292. [deltaL_spec, deltaU_spec] = local_nct_delta_ci(t_spec, df_spec, alpha);
  293. dzL_spec = deltaL_spec / sqrt(n_spec);
  294. dzU_spec = deltaU_spec / sqrt(n_spec);
  295. % ============================================================
  296. % (3) One-layer (1 kernel) vs Three-layer (64 kernels)
  297. % ============================================================
  298. % Positive diff => three-layer(64) > one-layer(1)
  299. % Find kernel indices
  300. idx_1kernel = find(kernelN_list.onelayer == 1, 1, 'first'); % 1
  301. idx_64kernel = find(kernelN_list.threelayer == 64, 1, 'first'); % 4
  302. if isempty(idx_1kernel) || isempty(idx_64kernel)
  303. error('Could not find kernel indices: one-layer(1) or three-layer(64).');
  304. end
  305. % --- IMPORTANT: use RAW 24 values (not means) ---
  306. % corr_all.onelayer.human.human has size: (12 x 2 x 4)
  307. % reshape -> (24 x 4) where 24 = 12(shape) + 12(lighting)
  308. r_one_all = reshape(corr_all.onelayer.human.human, 24, length(kernelN_list.onelayer));
  309. r_three_all = reshape(corr_all.threelayer.human.human, 24, length(kernelN_list.threelayer));
  310. r_one1 = r_one_all(:, idx_1kernel); % 24x1
  311. r_three64 = r_three_all(:, idx_64kernel); % 24x1
  312. diff_net = r_three64 - r_one1;
  313. % Paired t-test + Cohen's dz + CI(dz)
  314. [~, p_net, ~, stats_net] = ttest(diff_net, 0, 'Alpha', alpha, 'Tail', 'both');
  315. n_net = numel(diff_net);
  316. df_net = stats_net.df;
  317. t_net = stats_net.tstat;
  318. dz_net = mean(diff_net) / std(diff_net);
  319. [deltaL_net, deltaU_net] = local_nct_delta_ci(t_net, df_net, alpha);
  320. dzL_net = deltaL_net / sqrt(n_net);
  321. dzU_net = deltaU_net / sqrt(n_net);
  322. % ============================================================
  323. % Print full stats
  324. % ============================================================
  325. fprintf('\n=== Requested paired comparisons (n = %d patterns) ===\n', n_lum);
  326. fprintf('\n(1) All luminance stats (multi-reg) vs mean luminance-only:\n');
  327. if p_lum < 1e-3
  328. fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  329. df_lum, t_lum, dz_lum, dzL_lum, dzU_lum);
  330. else
  331. fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  332. df_lum, t_lum, p_lum, dz_lum, dzL_lum, dzU_lum);
  333. end
  334. fprintf('\n(2) All specular stats (multi-reg: contrast+coverage+sharpness) vs contrast-only:\n');
  335. if p_spec < 1e-3
  336. fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  337. df_spec, t_spec, dz_spec, dzL_spec, dzU_spec);
  338. else
  339. fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  340. df_spec, t_spec, p_spec, dz_spec, dzL_spec, dzU_spec);
  341. end
  342. fprintf('\n(3) One-layer (1 kernel) vs Three-layer (64 kernels):\n');
  343. if p_net < 1e-3
  344. fprintf('t(%d) = %.2f, p < 0.001, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  345. df_net, t_net, dz_net, dzL_net, dzU_net);
  346. else
  347. fprintf('t(%d) = %.2f, p = %.3f, Cohen''s dz = %.3f, 95%% CI [%.3f, %.3f]\n', ...
  348. df_net, t_net, p_net, dz_net, dzL_net, dzU_net);
  349. end
  350. function [deltaL, deltaU] = local_nct_delta_ci(tObs, df, alpha)
  351. % 100*(1-alpha)% CI for noncentrality parameter delta of noncentral t,
  352. % inverted from observed tObs (two-sided).
  353. %
  354. % Solve:
  355. % nctcdf(tObs; df, deltaL) = 1 - alpha/2
  356. % nctcdf(tObs; df, deltaU) = alpha/2
  357. if exist('nctcdf','file') ~= 2
  358. error('nctcdf not found. Requires Statistics and Machine Learning Toolbox.');
  359. end
  360. targetL = 1 - alpha/2; % 0.975
  361. targetU = alpha/2; % 0.025
  362. deltaL = local_solve_delta_robust(tObs, df, targetL);
  363. deltaU = local_solve_delta_robust(tObs, df, targetU);
  364. if deltaL > deltaU
  365. tmp = deltaL; deltaL = deltaU; deltaU = tmp;
  366. end
  367. end
  368. function delta = local_solve_delta_robust(tObs, df, target)
  369. % Robustly solve nctcdf(tObs; df, delta) = target for delta.
  370. % Avoids non-finite endpoints and uses a safe fallback if bracketing fails.
  371. fun = @(d) nctcdf(tObs, df, d) - target;
  372. % Start near a reasonable center; delta is typically on the order of tObs
  373. center = tObs;
  374. % Candidate bracket half-widths (grow gradually)
  375. widths = [0.5 1 2 5 10 20 50 100 200 500 1000 2000];
  376. lo = NaN; hi = NaN;
  377. flo = NaN; fhi = NaN;
  378. % Try to find a finite bracket with sign change
  379. for w = widths
  380. lo_c = center - w;
  381. hi_c = center + w;
  382. flo_c = fun(lo_c);
  383. fhi_c = fun(hi_c);
  384. if isfinite(flo_c) && isreal(flo_c) && isfinite(fhi_c) && isreal(fhi_c)
  385. if sign(flo_c) ~= sign(fhi_c)
  386. lo = lo_c; hi = hi_c;
  387. flo = flo_c; fhi = fhi_c;
  388. break;
  389. end
  390. end
  391. end
  392. % If still not bracketed, try asymmetric expansion (sometimes needed)
  393. if isnan(lo)
  394. for w = widths
  395. lo_c = center - w;
  396. hi_c = center + 5*w;
  397. flo_c = fun(lo_c);
  398. fhi_c = fun(hi_c);
  399. if isfinite(flo_c) && isreal(flo_c) && isfinite(fhi_c) && isreal(fhi_c)
  400. if sign(flo_c) ~= sign(fhi_c)
  401. lo = lo_c; hi = hi_c;
  402. flo = flo_c; fhi = fhi_c;
  403. break;
  404. end
  405. end
  406. end
  407. end
  408. % If we found a valid bracket, use fzero safely
  409. if ~isnan(lo)
  410. try
  411. delta = fzero(fun, [lo, hi]);
  412. return;
  413. catch
  414. % fall through to fallback
  415. end
  416. end
  417. % Fallback: bounded minimization of squared error on a safe delta range
  418. % (keeps code from crashing even in rare numeric corner cases)
  419. bound = 2000; % wide enough for typical cases, avoids nctcdf blowups
  420. obj = @(d) (fun(d)).^2;
  421. try
  422. delta = fminbnd(obj, center - bound, center + bound);
  423. catch
  424. % last resort: return center
  425. delta = center;
  426. end
  427. end

fig3_model_comparison.m at commit 884485d, under MIT · at the source

Overview

  1. Department of Psychology, Justus-Liebig-Universität Gießen, Giessen, Germany
  2. Department of Experimental Psychology, University of Oxford, Oxford, UK
  3. School of Psychology, University of Auckland, Auckland, New Zealand
Institutions: Justus-Liebig-Universität Gießen (Germany); University of Oxford (United Kingdom); University of Auckland (New Zealand)
Journal: Nature human behaviour, volume 10, issue 7, pages 1340-1355
Dates: received 30 June 2025; accepted 13 March 2026; published online 12 May 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41562-026-02445-0 · PMID 42120903 · PMCID PMC13388104 · OpenAlex W4410396661
Open access: hybrid, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Machine learning, Physiology & signal measures
Keywords: Perception, Human behaviour
MeSH: Machine Learning*, Neural Networks, Computer*, Visual Perception*, Humans, Judgment (* major topic)
Topic: Hand Gesture Recognition Systems (Human-Computer Interaction, Computer Science), according to OpenAlex
Funding: Deutsche Forschungsgemeinschaft (German Research Foundation) (SFB-TRR-135 222641018, SFB-TRR-135, 222641018); Wellcome Trust (218657/Z/19/Z); European Research Council (884116)
Citations: cited by 3 papers (Europe PMC); 82 references in the paper

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 considered a challenging inference. We rendered thousands of objects with varied shapes using a Ward reflectance model across lighting and viewpoints, then obtained gloss ratings for each image. Observers’ judgements were consistent with one another, yet systematically deviated from reality. We compared these ratings with neural networks trained either to estimate physical reflectance (‘ground-truth networks’) or to reproduce human judgements (‘human-like networks’). While estimating physical reflectance required deep networks, shallow networks accurately replicated human judgements. Remarkably, even a single-filter network could predict human judgements better than the best ground-truth network and generalized to known gloss illusions. These results suggest that gloss perception relies on simple general-purpose computations, and demonstrate the power of interpretable ‘tiny‘ networks in understanding cognition.

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

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 884485d02f73d1a9aa079d3355dc4c774d36c994, 6 February 2026
Languages: MATLAB (38)
Size: 22,415 files, 38 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
40 files

Hans1984/material-illumination-geometry

License: GPL-2.0
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 2e8dae1c7f6dd1a81b4b639c11ae79ed32156f8d, 27 April 2023
Languages: Python (6)
Size: 22 files, 6 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, license file, environment (environment.yml)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (4 files), TensorFlow (4 files), pandas (2 files), scikit-learn (2 files), SciPy (2 files), OpenCV (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
8 files

Zenodo 19511809

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
At the source:

Code availability

All custom analysis codes used to reproduce figures in this Article are available via GitHub at https://github.com/takuma929/gloss_tinynetworks and via Zenodo at 10.5281/zenodo.19511809.

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://github.com/takuma929/gloss_tinynetworks under a non-restrictive MIT license and via Zenodo at 10.5281/zenodo.19511809 (ref. 82). Behavioural data and model data from the Serrano dataset, which were used to validate our models, are available at https://mig.mpi-inf.mpg.de/ (behavioural data) and via GitHub at https://github.com/Hans1984/material-illumination-geometry (model data).

All custom analysis codes used to reproduce figures in this Article are available via GitHub at https://github.com/takuma929/gloss_tinynetworks and via Zenodo at 10.5281/zenodo.19511809.

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: n/a → 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://doi.org/10.1038/s41562-026-02445-0

BibTeX

@article{morimoto2026human,
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/s41562-026-02445-0},
url = {https://doi.org/10.1038/s41562-026-02445-0},
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/05/12
VL - 10
IS - 7
SP - 1340
EP - 1355
SN - 2397-3374
PB - Nature Portfolio
DO - 10.1038/s41562-026-02445-0
UR - https://doi.org/10.1038/s41562-026-02445-0
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41562-026-02445-0",
"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": "Nat Hum Behav",
"volume": "10",
"issue": "7",
"page": "1340-1355",
"DOI": "10.1038/s41562-026-02445-0",
"PMID": "42120903",
"PMCID": "PMC13388104",
"ISSN": "2397-3374",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41562-026-02445-0",
"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/s41562-023-01601-0
Material category of visual objects computed from specular image structure.
Journal: Nature human behaviour
In common: cognitive, 16 references
[2] doi:10.1167/jov.22.7.6 [code]
Identifying specular highlights: Insights from deep learning.
Journal: Journal of vision
In common: cognitive, 11 references
[3] doi:10.1073/pnas.2503088122 [code]
Orientation fields predict human perception of 3D shape from shading.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: OpenCV, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 3 other tools, cognitive, 5 references, author Roland W Fleming
[4] doi:10.1364/josaa.479986
Modeling surface color discrimination under different lighting environments using image chromatic statistics and convolutional neural networks.
Journal: Journal of the Optical Society of America. A, Optics, image science, and vision
In common: 4 references, 2 authors
[5] doi:10.1038/s42003-025-08474-1 [code]
Human and artificial visual systems share a computational principle for transforming binocular disparity into depth representation.
Journal: Communications biology
In common: OpenCV, TensorFlow, Image Processing Toolbox, 5 other tools, 1 reference
[6] doi:10.1038/s41467-025-61458-x [code]
Computational models reveal that intuitive physics underlies visual processing of soft objects.
Journal: Nature communications
In common: OpenCV, scikit-learn, pandas, 2 other tools, 3 references
[7] doi:10.1126/sciadv.adj3906 [code]
Reconstructing visual illusory experiences from human brain activity.
Journal: Science advances
In common: OpenCV, TensorFlow, Image Processing Toolbox, 4 other tools, 1 reference
[8] doi:10.1038/s42003-026-09685-w [code]
Achieving more human brain-like vision via human EEG representational alignment.
Journal: Communications biology
In common: OpenCV, TensorFlow, Statistics and Machine Learning Toolbox, 4 other tools, cognitive, 1 reference
[9] doi:10.1038/s41467-024-45679-0 [code]
Improved modeling of human vision by incorporating robustness to blur in convolutional neural networks.
Journal: Nature communications
In common: OpenCV, TensorFlow, Image Processing Toolbox, 4 other tools, 1 reference
[10] doi:10.7554/elife.90256 [code]
Emergence of brain-like mirror-symmetric viewpoint tuning in convolutional neural networks.
Journal: eLife
In common: OpenCV, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 3 other tools, 2 references

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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0.svg)](https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0"><img src="https://openscicode.org/badge/doi/10.1038/s41562-026-02445-0.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.