Towards accurate food safety risks prediction via context-enhanced heterogeneous GNN
Ying Tang, Yu Han, Weihua Zhou · Applied Food Research · 2025
Accurate prediction of food safety risks is crucial for protecting public health and optimizing regulatory processes. This study investigates the context-enhanced heterogeneous graph neural network (HGNN) to address the complexity of risk prediction. First, we devise a contrastive learning-based feature selection mechanism that identifies category-specific adulteration patterns, enabling automatic quantification of adulterant influence weights and risk values. Second, we construct a heterogeneous graph that connects food samples, geographical origins, and adulterants to model their complex interactions. Third, we introduce a meta-path contextualized HGNN that automatically identifies multi-level associations in data to generate context-aware subgraphs. This context-enhanced model effectively captures multi-hop heterogeneous relations while preserving node feature integrity. Additionally, an attention mechanism is integrated to aggregate multi-view node representations derived from meta-path contexts, facilitating the comprehensive fusion of heterogeneous semantic features. The experimental results show that the proposed method can effectively identify food safety risks and significantly improve the prediction accuracy.