Herbal medicines represent a significant global market, yet food safety remains threatened by counterfeit products morphologically resembling authentic samples. Models trained on limited datasets are prone to shortcut learning, relying on superficial features rather than intrinsic morphological characteristics. This study identified size-based shortcut learning as a critical factor degrading the classification of Ziziphus jujuba Mill. var. spinosa and its counterfeit Ziziphus mauritiana Lam., and demonstrated that focal loss alone can effectively mitigate this issue. Models trained on the internal dataset were evaluated on an external dataset acquired with the Herb-X. On the internal test set, all configurations achieved high classification accuracies (≥98%), thereby obscuring meaningful differences in external generalization. However, consistent performance degradation was observed on the external dataset. The cross-entropy model trained on background-removed data dropped to 82.08 ± 10.97%, while size-normalized models recovered to 84.17 ± 10.15% (upsizing) and 88.94 ± 6.76% (downsizing), confirming that suppressing size shortcuts improves external generalization. The focal loss model, without any preprocessing, achieved 90.88 ± 2.71%, reducing the internal–external generalization gap from 16.18 to 8.11 percentage points. Grad-CAM++ and loss analyses confirmed that the focal loss model attended to intrinsic morphological features rather than object size. This study provides a practical, preprocessing-free approach for reliable herbal-medicine authentication in field conditions.
Accurate identification of herbal medicines is essential for drug safety, yet organoleptic evaluation of cross-sections is subjective and limited by the declining number of experts. The engineering application addressed in this work is automated and auditable herbal medicine identification. Its artificial intelligence (AI) contribution is a framework that quantifies and improves the agreement between deep model attention and pharmacopoeia-defined diagnostic regions. These diagnostic regions are the anatomical structures designated by pharmacopoeia guidelines, such as the cambium, medullary rays, and pith. We convert these criteria into per-species radial location priors through automatic cambium detection and sigma-based boundary definition, and we measure the overlap between model activation maps and these priors using the Intersection over Union (IoU). Across four Polygonaceae species, five deep networks classified accurately (F1 score 0.88 to 0.97) on background-removed images, yet their attention showed low overlap with the pharmacopoeia priors (IoU 0.18 to 0.30) on held-out data. We then introduce an architecture-aware attention supervision loss that extracts the native attention of convolutional neural network and Transformer models and guides it toward the priors. Supervision raised the overlap in four of five models (for example ConvNeXt-B from 0.267 to 0.374 and DenseNet-121 from 0.245 to 0.355, false discovery rate corrected p < 0.001) while maintaining classification accuracy. The framework provides a reproducible and quantitative basis for auditing and improving the agreement between model attention and pharmacopoeia criteria in explainable herbal medicine identification.
Designing bio-based polymer nanocomposites requires balancing thermal processability and mechanical performance; nonetheless, conventional screening relies on destructive, time-consuming characterization of individual formulations. Although Fourier-transform infrared (FT-IR) spectroscopy captures formulation-sensitive molecular fingerprints, its use in polymer informatics has often been limited to qualitative band assignment or scalar endpoint prediction. In this study, we developed an FT-IR-guided framework for poly(butylene-co-poly(tetramethylene ether glycol) furanoate) (PBPF)–cellulose nanocrystal (CNC) nanocomposites by integrating response-curve prediction, explainable artificial intelligence, and multi-objective Bayesian optimization (MOBO). A paired dataset linking FT-IR spectra, encoded formulation descriptors, differential scanning calorimetry (DSC) measurements, and universal testing machine measurements was constructed at the formulation level. A gated multimodal fusion attention network reconstructed DSC heating and cooling curves and universal testing machine stress–strain response curves from FT-IR spectra and encoded formulation descriptors. The surrogate reproduced thermal and mechanical response profiles with near-target uncertainty coverage, supporting FT-IR-guided function-valued modeling as a structure-response strategy for polymer systems. Occlusion and integrated gradients analyses highlighted formulation-associated FT-IR regions consistent with spectral assignments for furan-based polyesters and CNCs. Retrospective MOBO recovered the same candidates prioritized by the measured-property reference optimization, selecting PBPF-91A-0.1 and PBPF-91P-0.1 under competing thermal and mechanical objectives. This study establishes routine infrared spectroscopy as a chemically interpretable input modality for function-valued thermomechanical prediction and inverse formulation design of polymer nanocomposites.