Group-Adaptive Threshold Optimization for Robust AI-Generated Text Detection