Addressing the challenges of extreme sample scarcity, complex underwater optical environments, and significant variations in lesion scales in real-world aquaculture, this paper proposes a small-sample grass carp disease recognition method, namely Swin Transformer with Supervised Contrastive Learning (ST-SCL), integrating dual-stream data augmentation and supervised contrastive learning. First, a frequency-spatial dual-stream augmentation strategy is constructed. In the frequency domain, the Amplitude-Mix technique is introduced to simulate diverse lighting and turbidity styles by mixing background amplitude spectra, thereby enhancing environmental generalization. In the spatial domain, a pathology-mask-guided instance-level Copy-Paste strategy is employed to directionally expand scarce lesion samples and address data imbalance. Second, the Swin Transformer is adopted as the backbone network, leveraging its hierarchical shifted window attention mechanism to effectively capture multi-scale features, balancing the detection of tiny parasites and extensive superficial ulcerations. Finally, supervised contrastive learning is incorporated to maximize intra-class compactness and minimize inter-class separability within the feature space, effectively reducing overfitting inherent to small-sample learning. Experimental results demonstrate that the proposed method achieves a macro-average F1-score of 95.86% across six disease categories. Compared with mainstream models such as ResNet and ConvNeXt, the ST-SCL exhibits notable performance improvements and enhanced robustness in small-sample scenarios, offering a promising technical path for precise fish disease diagnosis in complex aquatic environments.
Wang et al. (Sat,) studied this question.