Chao Yang, Qihang Liang, Zhongwen Guo, fang wang, Dapeng Liu
Aggressiveness is a key personality trait in swimming crabs ( Portunus trituberculatus ) that impacts survival and welfare in aquaculture. Accurately analyzing aggressiveness is crucial for informing trait-based selective breeding, reducing cannibalism, and promoting sustainable aquaculture practices. Existing studies often rely on heuristic, handcrafted methods that are neither scientifically rigorous nor objectively grounded, offering no principled way to justify their reasonableness. To address the limitations, we propose a data-driven framework for aggressiveness analysis that reverses the conventional screening-identification order by first identifying aggressiveness levels through unsupervised learning and then screening key behavioral factors. The framework consists of two main components: (1) the aggressiveness level identifier that uses a contrastive learning encoder and K-Means++ clustering to derive meaningful aggressiveness levels without prior labels or fixed thresholds; and (2) a key behavioral factor screener that employs a supervised gated weighting mechanism to quantify the importance of each behavioral factor. The proposed identifier enhances representation quality and clustering performance via contrastive objectives and principled negative sample selection. The screener assigns interpretable weights to behavioral features guided by the identified aggressiveness levels. We validate our framework using a dataset of 1012 swimming crabs collected through standardized mirror tests. Experimental results demonstrate that our method consistently outperforms baseline approaches, achieving the highest Silhouette score (0.5057), the lowest DBI (0.7315), and the highest CH index (247.5898). Furthermore, the framework reliably identifies a compact subset of four key behavioral indicators, maintaining a high classification accuracy exceeding 0.95 while significantly reducing data processing overhead. This work establishes a novel paradigm that overcomes the subjectivity of arbitrary thresholds in traditional ethology, offering a scalable and biologically interpretable solution for intelligent behavior management in sustainable aquaculture. • A novel identify-before-screen framework is proposed for aggressiveness analysis in swimming crabs. • Unsupervised contrastive learning with K-Means++ identifies trait levels without prior labels. • A supervised gated weighting mechanism quantifies the importance of each behavioral factor. • The framework demonstrates superior performance in aggressiveness classification and interpretability. • Results reveal a compact and biologically meaningful subset of key behavioral indicators.