AICodeDetect: A Pipeline for Systematic Detection and Analysis of AI-Generated Code
摘要
The proliferation of AI code generation tools necessitates robust detection methods for software development, education, and security applications. We present CodeFusion, a multimodal framework for detecting AI-generated code that analyzes both linguistic patterns and visual formatting across programming languages. Our approach combines Vision Transformers with contrastive learning to align visual code structure with semantic content, evaluated on samples from GPT-3.5 Turbo and GPT-4o across Java, Python, and OCaml. Through systematic comparison of traditional machine learning, deep learning, and transformer-based architectures, we reveal that more sophisticated models like GPT-4o are consistently more detectable than GPT-3.5 Turbo, challenging assumptions about model evolution toward perfect human mimicry. CodeFusion achieves near-perfect detection performance (F1 greater than 0.99) on GPT-4o code across all languages while maintaining robust performance on earlier model generations. Our findings suggest that AI models develop distinctive stylistic signatures rather than converging toward indistinguishable human patterns, providing new insights into AI code generation behaviors and establishing a foundation for reliable detection systems.