Abstract:Aiming to address the cross-scene generalization deficit of end-to-end CNN classifiers on the task of greenhouse whitefly damage grading in facility vegetable production, where standard models tended to fix on background-correlated cues such as illumination and plant growth stage rather than the physical signature of sooty mold, a color-prior-guided two-channel grading method (CPG-Fusion) was proposed.The core of the method was a color prior attention module (CPAM): the per-image relative darkness, computed as a scene-brightness-independent physical cue, was fed as the attention input signal of a ResNet-18 backbone so that the CNN was consistently guided toward the region that directly corresponded to sooty mold coverage and was steered away from background spurious features.A dataset of 260 images with 4-level hazard index annotations was collected from two solar greenhouses in Changping, Beijing;the CNN was trained under a 5-fold stratified cross-validation protocol, and the deployed prediction was obtained by softmax probability averaging across folds.On 58 cross-scene OOD images independently collected in a second greenhouse (GH2), CPAM raised the quadratic weighted Kappa (QWK) from 0.401 of the ResNet-18 baseline to 0.551, improved the recall of the light-damage level by 22 percentage points, and confined all misclassifications to adjacent levels.In the same-protocol horizontal comparison with four representative attention modules (SE-Net, CBAM, ECA and Coordinate Attention), CPAM matched the upper bound of accuracy of the four counterparts on the OOD ensemble while attaining the lowest across-fold standard deviation among the four self-attention modules, indicating better single-model reliability under small-sample weak supervision.Grad-CAM visualization and the near-zero marginal gain of late fusion between CPAM and the pixel prior channel jointly confirmed that the pixel color prior was internalized into the CNN feature map.The proposed method showed that injecting interpretable physical cues into the attention pathway can improve the robustness of deep learning models under complex agricultural environments, and can be directly deployed on existing canopy surveillance cameras without additional hardware or target-scene parameter tuning.