Batch-Invariant Spectral Intelligence for Robust and Explainable Insect Authentication
Pith reviewed 2026-06-26 05:09 UTC · model grok-4.3
The pith
The Batch-Invariant Spectral Network suppresses batch-specific variation in near-infrared spectra before learning species features, reaching 0.93 accuracy on unseen production batches.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
BISN is an end-to-end framework that combines a learnable preprocessing module, initialised with Savitzky-Golay filtering, with an entropy-regularised adversarial objective to suppress batch-specific spectral variation before species-specific features are learned. Using 2,700 spectra from three species collected across three independent production batches, BISN achieves a mean leave-one-batch-out accuracy of 0.93 (standard deviation 0.04), outperforming the strongest baseline by four percent. Explainable AI shows that model decisions consistently rely on the lipid and protein absorption regions across all folds.
What carries the argument
The Batch-Invariant Spectral Network (BISN), an end-to-end architecture that applies entropy-regularized adversarial suppression of batch effects prior to species feature extraction on a learnable preprocessing module.
If this is right
- BISN outperforms domain-adversarial networks that apply adaptation only after feature extraction.
- Accuracy remains high on completely unseen production batches with low variance across folds.
- Explanations tie predictions to lipid and protein absorption regions in every cross-batch test.
- The method enables automated species authentication under realistic industrial batch variation.
Where Pith is reading between the lines
- The early-suppression design may transfer to other spectroscopic classification tasks that suffer from instrument or batch drift.
- Public release of code and data allows direct testing on new insect species or spectrometer models.
- If the method preserves species information while removing batch signals, similar preprocessing could shorten the data collection needed for new food-authentication problems.
Load-bearing premise
The entropy-regularized adversarial objective removes batch-specific spectral variation without discarding the information required for accurate species discrimination.
What would settle it
Retraining the model with the adversarial term removed or with its strength varied and observing whether leave-one-batch-out accuracy falls to or below the strongest baseline level.
Figures
read the original abstract
Edible insects offer an efficient source of alternative protein, requiring less land, water and emitting less greenhouse gas than conventional livestock. However, their successful integration into the food supply chain demands reliable species authentication to control allergen exposure, prevent adulteration, and meet regulatory standards. Near-infrared spectroscopy provides a rapid analytical tool, but its performance drops when applied to production batches unseen during training due to batch-to-batch variation in spectral measurements. We introduce the Batch-Invariant Spectral Network (BISN), an end-to-end framework that combines a learnable preprocessing module, initialised with Savitzky-Golay filtering, with an entropy-regularised adversarial objective to suppress batch-specific spectral variation. In contrast to Domain-Adversarial Neural Networks, which enforce domain adaptation only after feature extraction, BISN suppress batch-effects before species-specific features are learned. Using 2,700 spectra from three species (Acheta domesticus, Hermetia illucens, and Tenebrio molitor) collected across three independent production batches, BISN achieves a mean leave-one-batch-out accuracy of 0.93 (standard deviation 0.04), outperforming the strongest baseline by four percent. Further insights gained by using explainable AI confirm that model decisions consistently rely on the lipid and protein absorption regions across all folds, connecting predictive performance to known insect biochemistry. BISN addresses both cross-batch robustness and biochemical interpretability for automated insect species authentication under realistic industrial conditions. The source code and dataset are publicly available at https://github.com/majharB/bisn.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper introduces the Batch-Invariant Spectral Network (BISN), an end-to-end architecture that pairs a learnable Savitzky-Golay preprocessing module with an entropy-regularized adversarial objective to suppress batch effects in NIR spectra prior to species feature extraction. On 2,700 spectra from three insect species collected over three production batches, BISN reports a mean leave-one-batch-out accuracy of 0.93 (sd 0.04), a 4% improvement over the strongest baseline, with XAI attributions consistently highlighting lipid and protein absorption bands.
Significance. If the adversarial regularization demonstrably preserves species-discriminative information while removing batch variation, the work supplies a concrete, interpretable pipeline for industrial insect authentication that links model decisions to known biochemistry. Public code and data release is a clear strength that supports reproducibility and extension.
major comments (2)
- [Abstract / Method] Abstract and Method section: The central claim that the entropy-regularized adversarial objective removes batch-specific spectral variation before species features are learned rests on an unverified assumption. No quantitative check (post-preprocessing batch classification accuracy, mutual information with batch labels, or ablation over regularization strength) is reported despite only three batches being available; this directly affects whether the 0.93 LOO accuracy can be attributed to the proposed mechanism rather than the preprocessing module alone.
- [Results] Results section: With only three batches and three species, the leave-one-batch-out protocol provides limited statistical power; the reported standard deviation of 0.04 is given but no per-fold confusion matrices, per-batch accuracies, or statistical significance tests against baselines are described, weakening the robustness claim.
minor comments (2)
- [Abstract] Abstract: The number of spectra per species and per batch is not stated, making it difficult to assess class balance and batch-size effects.
- [Related Work / Experiments] The distinction from Domain-Adversarial Neural Networks is conceptually clear but would benefit from an explicit side-by-side result table showing whether pre-feature suppression yields gains beyond standard DANN.
Simulated Author's Rebuttal
We thank the referee for the constructive feedback on verifying the batch-invariance mechanism and the statistical details of the evaluation. We address each major comment below and outline planned revisions to strengthen the manuscript.
read point-by-point responses
-
Referee: [Abstract / Method] Abstract and Method section: The central claim that the entropy-regularized adversarial objective removes batch-specific spectral variation before species features are learned rests on an unverified assumption. No quantitative check (post-preprocessing batch classification accuracy, mutual information with batch labels, or ablation over regularization strength) is reported despite only three batches being available; this directly affects whether the 0.93 LOO accuracy can be attributed to the proposed mechanism rather than the preprocessing module alone.
Authors: We agree that the manuscript would benefit from explicit quantitative checks to support attribution of the performance gains to the adversarial objective. In the revised manuscript we will add post-preprocessing batch classification accuracy, estimates of mutual information between the learned features and batch labels, and an ablation over regularization strength. These additions will demonstrate that the entropy-regularized term contributes to batch-effect suppression beyond the learnable Savitzky-Golay preprocessing module alone. revision: yes
-
Referee: [Results] Results section: With only three batches and three species, the leave-one-batch-out protocol provides limited statistical power; the reported standard deviation of 0.04 is given but no per-fold confusion matrices, per-batch accuracies, or statistical significance tests against baselines are described, weakening the robustness claim.
Authors: We acknowledge that the small number of batches inherently limits statistical power. The revised manuscript will include per-fold confusion matrices, per-batch accuracies for each leave-one-batch-out fold, and statistical significance tests (e.g., McNemar’s test) comparing BISN against the baselines. These additions will provide greater transparency on variability across folds while noting the dataset constraints. revision: yes
Circularity Check
No significant circularity: empirical evaluation on external data with independent architecture
full rationale
The paper introduces BISN as an end-to-end architecture with learnable Savitzky-Golay preprocessing and entropy-regularized adversarial training, then reports an empirical leave-one-batch-out accuracy of 0.93 on a held-out dataset of 2700 spectra from three batches. This accuracy is obtained via standard cross-validation on external measurements rather than being defined by or reduced to the method's own parameters or equations. No self-citations, uniqueness theorems, or fitted-input-as-prediction patterns appear in the abstract or described claims. The XAI consistency with lipid/protein regions is an interpretive post-hoc analysis, not a load-bearing derivation step. The framework is self-contained against public data and code without reducing the central performance claim to a tautology.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption Adversarial training with entropy regularization can remove batch-specific information from spectra prior to species classification without degrading discriminative power for the target task.
Reference graph
Works this paper leans on
-
[1]
M.Psarianos,F.Aghababaei,O.K.Schlüter,Bioactivecompoundsinedibleinsects: aspectsofcultivation,processingandnutrition, FoodResearchInternational,203(2025)115802.https://doi.org/10.1016/j.foodres.2025.115802
-
[2]
K.W. Lange, Y. Nakamura, Edible insects as future food: chances and challenges,Journal of Future Foods, 1 (2021) 38–46. https://doi.org/10.1016/j.jfutfo.2021.10.001
-
[3]
G.Rossi,S.Ojha,J.Hankel,O.K.Schlüter,Insect-mediatedvalorisationofanaerobicallydigestedaquaculturewaste: bioconversion performances,nutritionalcompositionandmicrobialsafetyofblacksoldierflylarvae,SustainableFoodTechnology,3(2025) 811–821.https://doi.org/10.1039/D4FB00392F
-
[4]
F.A.Madau,B.Arru,R.Furesi,P.Pulina,F.Riu,Insectfarmingforfeedandfoodproductionfromacircularbusinessmodel perspective,Sustainability,12(2020)5418.https://doi.org/10.3390/su12135418
-
[5]
https://doi.org/10.3390/foods14050751
M.Wildbacher,J.Andronache,K.Pühringer,S.Dobrovolny,R.Hochegger,M.Cichna-Markl,AuthenticationofEU-authorized edible insect species in food products by DNA barcoding and high-resolution melting (HRM) analysis,Foods, 14 (2025) 751. https://doi.org/10.3390/foods14050751
-
[6]
K.G. Lawal, R.R. Kavle, T.O. Akanbi, M. Mirosa, D. Agyei, Lipid nutritional indices, regioisomeric distribution, and thermal propertiesofTenebriomolitorandHermetiaillucenslarvaefat,JournalofAsia-PacificEntomology,25(2022)101951. https: //doi.org/10.1016/j.aspen.2022.101951
-
[7]
L.Borrelli,L.Varriale,L.Dipineto,A.Pace,L.F.Menna,A.Fioretti,Insectderivedlauricacidaspromisingalternativestrategy to antibiotics in the antimicrobial resistance scenario,FrontiersinMicrobiology, 12 (2021) 620798.https://doi.org/10. 3389/fmicb.2021.620798
arXiv 2021
-
[8]
M. Laroche, V. Perreault, A. Marciniak, A. Gravel, J. Chamberland, A. Doyen, Comparison of conventional and sustainable lipid extraction methods for the production of oil and protein isolate from edible insect meal,Foods, 8 (2019) 572.https: //doi.org/10.3390/foods8110572
-
[9]
ISBN978-92-5-107596-8.https://www.fao.org/4/i3253e/i3253e.pdf
A.vanHuis,J.VanItterbeeck,H.Klunder,E.Mertens,A.Halloran,G.Muir,P.Vantomme,EdibleInsects: FutureProspectsfor FoodandFeedSecurity,FAOForestryPaper,vol.171,FoodandAgricultureOrganizationoftheUnitedNations,Rome,2013. ISBN978-92-5-107596-8.https://www.fao.org/4/i3253e/i3253e.pdf
2013
-
[10]
B.A.Rumpold,O.K.Schlüter,Nutritionalcompositionandsafetyaspectsofedibleinsects,MolecularNutrition&FoodResearch, 57(2013)802–823.https://doi.org/10.1002/mnfr.201200735
-
[12]
S. Chakrabarty, C.K. Deb, S. Marwaha, M.A. Haque, D. Kamil, R. Bheemanahalli, P.R. Shashank, Application of artificial intelligenceininsectpestidentification–areview,ArtificialIntelligenceinAgriculture,16(2026)44–61. https://doi.org/ 10.1016/j.aiia.2025.06.005
-
[13]
J.H. Qu, D. Liu, J.H. Cheng, D.W. Sun, J. Ma, H. Pu, X.A. Zeng, Applications of near-infrared spectroscopy in food safety evaluationandcontrol: areviewofrecentresearchadvances,CriticalReviewsinFoodScienceandNutrition,60(2020)2764–2796. https://doi.org/10.1080/10408398.2019.1651248
-
[14]
https://doi.org/10.1016/j.tifs.2021.11
L.Zhang,X.Huang,Z.Li,J.Zhao,Q.Zhang,Areviewofnear-infraredspectroscopyforfoodauthentication: challengesand perspectives,TrendsinFoodScience&Technology,118(2021)806–820. https://doi.org/10.1016/j.tifs.2021.11. 010
-
[15]
D.A.Burns,E.W.Ciurczak(Eds.),HandbookofNear-InfraredAnalysis,3rded.,CRCPress,BocaRaton,FL,USA,2007
2007
-
[17]
Y.Xu,T.Kong,Y.Ma,Y.Zhao,L.Chu,M.Zheng,Near-infraredspectroscopy: applicationinensuringfoodqualityandsafety, AnalyticalMethods,17(2025)3381–3406.https://doi.org/10.1039/D4AY02039A
-
[18]
https://doi.org/10.1016/j.saa.2024.125646
J.P.Cruz-Tirado,M.S.dosSantosVieira,R.S.B.Ferreira,J.M.Amigo,E.A.C.Batista,D.F.Barbin,Predictionoftotallipidsandfatty acidsinblacksoldierfly(HermetiaillucensL.)driedlarvaebyNIR-hyperspectralimagingandchemometrics,SpectrochimicaActa PartA:MolecularandBiomolecularSpectroscopy,329(2025)125646. https://doi.org/10.1016/j.saa.2024.125646
-
[19]
S.Tan,S.Hu,S.He,L.Zhu,Y.Qian,Y.Deng,Leveraginghyperspectralimagesforaccurateinsectclassificationwithanovel two-branchself-correlationapproach,Agronomy,14(2024)863.https://doi.org/10.3390/agronomy14040863
-
[20]
J.P. Cruz-Tirado, J.M. Amigo, D.F. Barbin, Determination of protein content in single black soldier fly (Hermetia illucens L.) larvae by near infrared hyperspectral imaging (NIR-HSI) and chemometrics,Food Control, 143 (2023) 109266.https: //doi.org/10.1016/j.foodcont.2022.109266
-
[21]
Å. Rinnan, F. van den Berg, S.B. Engelsen, Review of the most common pre-processing techniques for near-infrared spectra, TrACTrendsinAnalyticalChemistry,28(2009)1201–1222.https://doi.org/10.1016/j.trac.2009.07.007
-
[22]
Y.Zhao,J.Yu,P.Shan,Z.Zhao,X.Jiang,S.Gao,PLSsubspace-basedcalibrationtransferfornear-infraredspectroscopyquantitative analysis,Molecules,24(2019)1289.https://doi.org/10.3390/molecules24071289
-
[23]
D.Azzollini,A.Derossi,V.Fogliano,C.M.M.Lakemond,C.Severini,Effectsofformulationandprocessconditionsonmicrostruc- ture, texture and digestibility of extruded insect-riched snacks,Innovative Food Science & Emerging Technologies, 45 (2018) 344–353.https://doi.org/10.1016/j.ifset.2017.11.017
-
[24]
J.-B. Ni, S.-Y. Luo, Y.-X. Bi, S. Zielinska, C.-J. Ding, J.-L. Tao, Z. Ning, W.-L. Tian, W.-J. Peng, X.-M. Fang, The combined effectsofultrasoundandplasma-activatedwateronsilkwormpupae: physicochemicalproperties,microbiologicaldiversityand ultrastructure,UltrasonicsSonochemistry,107(2024)106927. https://doi.org/10.1016/j.ultsonch.2024.106927
-
[25]
https://doi.org/10.1021/ac00023a016
Y.Wang, D.J.Veltkamp, B.R.Kowalski, Multivariateinstrumentstandardization,AnalyticalChemistry, 63(1991)2750–2756. https://doi.org/10.1021/ac00023a016
-
[26]
R.Nikzad-Langerodi,W.Zellinger,E.Lughofer,S.Saminger-Platz,Domain-invariantpartial-least-squaresregression,Analytical Chemistry,90(2018)6693–6701.https://doi.org/10.1021/acs.analchem.8b00498
-
[27]
M.Babor,S.Liu,A.Arefi,A.Olszewska-Widdrat,J.Venus,B.Sturm,M.M.-C.Höhne,Interpretabledomainadaptationenables robust lactic acid fermentation monitoring from waste,Results in Engineering, 29 (2026) 108477.https://doi.org/10. 1016/j.rineng.2025.108477
arXiv 2026
-
[28]
S.Ö.Arik,T.Pfister,TabNet: attentiveinterpretabletabularlearning,in:Proceedingsofthe35thAAAIConferenceonArtificial Intelligence,35(2021)6679–6687.https://doi.org/10.1609/aaai.v35i8.16826
-
[29]
http://jmlr.org/papers/v17/15-239
Y.Ganin,E.Ustunova,H.Ajakan,P.Germain,H.Larochelle,F.Laviolette,M.Marchand,V.Lempitsky,Domain-adversarialtrain- ingofneuralnetworks,JournalofMachineLearningResearch,17(2016)1–35. http://jmlr.org/papers/v17/15-239. html
2016
-
[30]
https: //doi.org/10.1016/j.ijbiomac.2024.135057
X.Ni,C.Chen,R.Li,Q.Liu,C.Duan,X.Wang,M.Xu,Effectsofultrasonictreatmentonthestructureandfunctionalcharacteristics ofmyofibrillarproteinsfromblacksoldierfly,InternationalJournalofBiologicalMacromolecules,278(2024)135057. https: //doi.org/10.1016/j.ijbiomac.2024.135057
-
[31]
https://doi.org/10
A.M.Bashkatov,E.A.Genina,V.I.Kochubey,V.V.Tuchin,Opticalpropertiesofhumanskin,subcutaneousandmucoustissuesin thewavelengthrangefrom400to2000nm,JournalofPhysicsD:AppliedPhysics,38(2005)2543–2555. https://doi.org/10. 1088/0022-3727/38/15/004
2005
-
[32]
https://doi.org/10.1255/jnirs.869
R.Tsenkova,Aquaphotomics: waterabsorbancepatternasabiologicalmarker,NearInfraredSpectroscopy,17(2009)303–314. https://doi.org/10.1255/jnirs.869
-
[33]
R.J.Barnes,M.S.Dhanoa,S.J.Lister,Standardnormalvariatetransformationandde-trendingofnear-infrareddiffusereflectance spectra,AppliedSpectroscopy,43(1989)772–777.https://doi.org/10.1366/0003702894202201
-
[34]
A.Savitzky,M.J.E.Golay,Smoothinganddifferentiationofdatabysimplifiedleastsquaresprocedures,AnalyticalChemistry,36 (1964)1627–1639.https://doi.org/10.1021/ac60214a047. 19
-
[35]
A.Gretton,K.M.Borgwardt,M.J.Rasch,B.Schölkopf,A.Smola,Akerneltwo-sampletest,JournalofMachineLearningResearch, 13(2012)723–773.https://jmlr.org/papers/v13/gretton12a.html
2012
-
[36]
P.J.Rousseeuw,Silhouettes: agraphicalaidtotheinterpretationandvalidationofclusteranalysis,JournalofComputationaland AppliedMathematics,20(1987)53–65.https://doi.org/10.1016/0377-0427(87)90125-7
-
[37]
Martins, R.F
A.F.T. Martins, R.F. Astudillo, From softmax to sparsemax: a sparse model of attention and multi-label classification, in: Proceedingsofthe33rdInternationalConferenceonMachineLearning,PMLR48(2016)1614–1623. https://proceedings. mlr.press/v48/martins16.html
2016
-
[38]
R.A.Fisher,Theuseofmultiplemeasurementsintaxonomicproblems,AnnalsofEugenics,7(1936)179–188. https://doi. org/10.1111/j.1469-1809.1936.tb02137.x
-
[39]
https: //gaussianprocess.org/gpml
C.E.Rasmussen, C.K.I.Williams,GaussianProcessesforMachineLearning, MITPress, Cambridge, MA,USA,2006. https: //gaussianprocess.org/gpml
2006
-
[40]
M. Barker, W. Rayens, Partial least squares for discrimination,Journal of Chemometrics, 17 (2003) 166–173.https://doi. org/10.1002/cem.785
-
[41]
P. Fu, Y. Wen, Y. Zhang, L. Li, Y. Feng, L. Yin, H. Yang, SpectraTr: a novel deep learning model for qualitative analysis of drug spectroscopy based on transformer structure,Journal of Innovative Optical Health Sciences, 15 (2022) 2250021.https: //doi.org/10.1142/S1793545822500213
-
[42]
N.Singh,S.Kaur,S.R.Padhi,R.John,A.Kumar,J.C.Rana,R.Bhardwaj,A.Riar,NIRCoreVision: anoveldeeplearning-based framework with GUI integration for core set selection from NIRS data using 1D CNN and k-means clustering,Journal of AgricultureandFoodResearch,24(2025)102390.https://doi.org/10.1016/j.jafr.2025.102390
-
[43]
Hollmann, S
N. Hollmann, S. Müller, L. Purucker, A. Krishnakumar, M. Körfer, S.B. Hoo, R.T. Schirrmeister, F. Hutter, Accurate pre- dictions on small data with a tabular foundation model,Nature, 637 (2025) 1043–1049.https://doi.org/10.1038/ s41586-024-08328-6
2025
-
[44]
https://doi.org/10.1016/j.foodcont.2023.110268
D.Ni,J.L.D.Nelis,A.L.Dawson,N.Bourne,P.Juliano,M.L.Colgrave,A.Juhász,U.Bose,Applicationofnear-infraredspectroscopy andchemometricsfortherapiddetectionofinsectproteinadulterationfromasimulatedmatrix,FoodControl,159(2024)110268. https://doi.org/10.1016/j.foodcont.2023.110268
-
[45]
X.Zhang,F.Yang,J.Xiao,H.Qu,N.F.Jocelin,L.Ren,Y.Guo,Analysisandcomparisonofmachinelearningmethodsforspecies identificationutilizingATR-FTIRspectroscopy,SpectrochimicaActaPartA:MolecularandBiomolecularSpectroscopy,308(2024) 123713.https://doi.org/10.1016/j.saa.2023.123713
-
[46]
Spectroscopic investigation of the tungsten deuteride sputtering in the EAST divertor
Z.Ma,M.Di,T.Hu,X.Wang,J.Zhang,Z.He,Visible-NIRhyperspectralimagingbasedoncharacteristicspectraldistillationused forspeciesidentificationofsimilarcrickets,Optics&LaserTechnology,183(2025)112420. https://doi.org/10.1016/j. optlastec.2025.112420
work page doi:10.1016/j 2025
-
[47]
https://proceedings.mlr.press/v70/sundararajan17a
M.Sundararajan,A.Taly,Q.Yan,Axiomaticattributionfordeepnetworks,in:Proceedingsofthe34thInternationalConferenceon MachineLearning(ICML),PMLR70(2017)3319–3328. https://proceedings.mlr.press/v70/sundararajan17a. html
2017
-
[48]
https://doi.org/10.1007/s11947-024-03510-0
N.Muñoz-Seijas,H.Fernandes,J.M.Domínguez,J.M.Salgado,RecentadvancesinbiorefineryofTenebriomolitoradoptinggreen technologies,FoodandBioprocessTechnology18,1061–1078(2025). https://doi.org/10.1007/s11947-024-03510-0
-
[49]
Samples = 50
E. Hoffer, R. Banner, I. Golan, D. Soudry, Train longer, generalise better: closing the generalisation gap in large batch train- ing of neural networks, in:Advances in Neural Information Processing Systems (NeurIPS), 30 (2017) 1731–1741.https: //proceedings.neurips.cc/paper/2017/file/a5e0ff62be0b08456fc7f1e88812af3d-Paper.pdf. 20 SupplementaryMaterials S1...
2017
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.