The rapid advancement in smart agriculture has introduced significant challenges, including data scarcity, complex and diverse disease features, and substantial background interference in agricultural scenarios. To address these challenges, a disease detection method based on few-shot learning and diffusion generative models is proposed. By integrating the high-quality feature generation capabilities of diffusion models with the feature extraction advantages of few-shot learning, an end-to-end framework for disease detection has been constructed. The experimental results demonstrate that the proposed method achieves outstanding performance in disease detection tasks. Across comprehensive experiments, the model achieved scores of 0.94, 0.92, 0.93, and 0.92 in precision, recall, accuracy, and mean average precision (mAP@75), respectively, significantly outperforming other comparative models. Furthermore, the incorporation of attention mechanisms effectively enhanced the quality of disease feature representations and improved the model’s ability to capture fine-grained features.
In this study, a cross-hierarchical intelligent modeling framework integrating an ecological semantic encoder, a distribution-aligned contrastive loss, and a disturbance-aware attention mechanism was developed to address the semantic alignment challenge between aboveground vegetation and belowground seed banks within forest ecosystems. The proposed framework leverages artificial intelligence and deep learning to characterize the structural and functional coupling between vegetation and soil communities, thereby elucidating the ecological mechanisms that underlie forest regeneration and stability. Experiments using representative forest ecological plot datasets demonstrated that the model achieved a top-1 accuracy of 78.6%, a top-5 accuracy of 89.3%, a mean cosine similarity of 0.784, and a reduced Kullback–Leibler divergence of 0.128, while the Jaccard index increased to 0.512—surpassing traditional statistical and machine-learning baselines such as RDA, CCA, Procrustes, Siamese, and SimCLR. The model also reduced NMDS stress to 0.094 and improved the Sørensen coefficient to 0.713, reflecting high robustness and precision in reconstructing community structure and ecological distributions. Additionally, the integration of distribution alignment and disturbance-aware mechanisms allows the model to capture dynamic vegetation–soil feedbacks across environmental gradients and disturbance regimes. This enables more accurate identification of regeneration potential, resilience thresholds, and restoration trajectories in degraded forests. Overall, the framework provides a novel theoretical foundation and a data-driven pathway for applying artificial intelligence to forest ecosystem monitoring, degradation diagnosis, and adaptive management for sustainable recovery.