Outbreaks of stored grain pests can pose significant threats to food security. In-depth analyses of sudden outbreaks are key to achieving effective prevention and control. To address the issue of models’ insufficient reasoning capability arising from complex causal relationships in stored grain pest events, this study proposes an Event Patterns Enhancing Causal Reasoning (EPECR) method incorporating category theory. Specifically, we focus on common pests such as Sitophilus zeamais (maize weevil) and Sitotroga cerealella (Angoumois grain moth). We formally map the domain ontology—including entities like environmental factors (e.g., temperature, humidity) and control measures (e.g., fumigation)—to categories, and represent their inter-relationships (e.g., inhibition, promotion) as functors. To handle complex scenarios, we model multi-cause events (e.g., high temperature and humidity jointly accelerating pest reproduction) using functor products, and represent multi-hop events (e.g., environmental changes leading to pest outbreak and subsequent grain loss) through functor compositions. This formal expression enables Large Language Models (LLMs) to extract reliable event patterns. Based on these patterns, this study constructed 1440 structured datasets and adopted the Low-Rank Adaptation (LoRA) strategy to fine-tune the LLMs. Experiments on the domain-specific Stored Grain Pest Events Dataset (SGPE) demonstrate that EPECR achieves a reasoning accuracy of 85.9% on in-distribution data and 79.9% on out-of-distribution data, effectively identifying correct causal chains for pest logic. This method significantly outperforms the state-of-the-art domain method-Naive Augmentations (NA)-by 4.9%, providing precise decision support for the early warning and control of specific pest incidents.
Wheat is a major staple crop, and storage mold growth poses a severe threat to grain safety and quality stability. Natural mold development in stored wheat exhibits subtle, localized, and highly heterogeneous characteristics. Existing unimodal methods and global fusion approaches generally suffer from insufficient local feature sensitivity, hindering fine-grained mold severity grading. To address this limitation, we propose a Mask-Guided Fine-Grained Fusion Network, a weakly supervised framework based on local RGB–HSI fusion. This framework employs a dynamic parallel A/B experimental design to construct time-matched proxy labels via weakly supervised learning. A standardized preprocessing pipeline including single-kernel extraction, foreground segmentation, and cross-modal registration is established to resolve RGB–HSI spatial misalignment, ensuring physical-level spatial consistency of multimodal features. The model incorporates a Foreground-Aware Spectral Recalibration (FASR) module to suppress background noise, a Mask-Guided Dilated Cross-modal Local Attention (MDCLA) mechanism to establish fine-grained local mappings between RGB visual phenotypes and hyperspectral responses, and a sample-level adaptive fusion strategy to dynamically weight features by modal reliability, enhancing representation of complex samples across all mold stages. Experiments show that the Mask-Guided Fine-Grained Fusion Network achieves 0.9689 classification accuracy, 0.9698 Macro-F1 score, and 0.0593 Mean Absolute Error (MAE), significantly outperforming state-of-the-art unimodal deep models and global attention fusion baselines. This work provides a proof-of-principle framework for fine-grained non-destructive mold risk assessment in stored wheat.