MIXCODE: Enhancing Code Classification by Mixup-Based Data Augmentation
Not on the map. Why?
Abstract (arXiv)
Inspired by the great success of Deep Neural Networks (DNNs) in natural language processing (NLP), DNNs have been increasingly applied in source code analysis and attracted significant attention from the software engineering community. Due to its data-driven nature, a DNN model requires massive and high-quality labeled training data to achieve expert-level performance. Collecting such data is often not hard, but the labeling process is notoriously laborious. The task of DNN-based code analysis even worsens the situation because source code labeling also demands sophisticated expertise. Data augmentation has been a popular approach to supplement training data in domains such as computer vision and NLP. However, existing data augmentation approaches in code analysis adopt simple methods, such as data transformation and adversarial example generation, thus bringing limited performance superiority. In this paper, we propose a data augmentation approach MIXCODE that aims to effectively supplement valid training data, inspired by the recent advance named Mixup in computer vision. Specifically, we first utilize multiple code refactoring methods to generate transformed code that holds consistent labels with the original data. Then, we adapt the Mixup technique to mix the original code with the transformed code to augment the training data. We evaluate MIXCODE on two programming languages (Java and Python), two code tasks (problem classification and bug detection), four benchmark datasets (JAVA250, Python800, CodRep1, and Refactory), and seven model architectures (including two pre-trained models CodeBERT and GraphCodeBERT). Experimental results demonstrate that MIXCODE outperforms the baseline data augmentation approach by up to 6.24% in accuracy and 26.06% in robustness.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 50 of its 79 references that are in the map. First posted on arXiv 6 Oct 2022.
Builds on
50 of 79 references.
References · 50
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2017Graph Attention Networkscited by 8,854
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2020WILDS: A Benchmark of in-the-Wild Distribution Shiftscited by 1,366
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2019AugMix: A Simple Data Processing Method to Improve Robustness and Uncertaintycited by 897
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2015Gated Graph Sequence Neural Networkscited by 792
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
38 more
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2021A Survey of Data Augmentation Approaches for NLPcited by 408
- 2018Deep Face Recognition: A Surveycited by 275
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2020Puzzle Mix: Exploiting Saliency and Local Statistics for Optimal Mixupcited by 260
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2017Learning to Represent Programs with Graphscited by 219
- 2020Data Augmentation for Graph Neural Networkscited by 200
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2020How Does Mixup Help With Robustness and Generalization?cited by 193
- 2020MixText: Linguistically-Informed Interpolation of Hidden Space for Semi-Supervised Text Classificationcited by 186
- 2020SaliencyMix: A Saliency Guided Data Augmentation Strategy for Better Regularizationcited by 149
- 2017Generalization in Deep Learningcited by 146
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
- 2021PixMix: Dreamlike Pictures Comprehensively Improve Safety Measurescited by 131
- 2021Co-Mixup: Saliency Guided Joint Mixup with Supermodular Diversitycited by 127
- 2019Augmenting Data with Mixup for Sentence Classification: An Empirical Studycited by 125
- 2020Graph-based, Self-Supervised Program Repair from Diagnostic Feedbackcited by 93
- 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
- 2020ResizeMix: Mixing Data with Preserved Object Information and True Labelscited by 68
- 2019Adversarial Examples for Models of Codecited by 61
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2020Deep Learning for Source Code Modeling and Generation: Models, Applications and Challengescited by 55
- 2020SeqMix: Augmenting Active Sequence Labeling via Sequence Mixupcited by 52
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2021SSMix: Saliency-Based Span Mixup for Text Classificationcited by 39
- 2020Adversarial Robustness for Codecited by 36
- 2020Exploring Software Naturalness through Neural Language Modelscited by 32
- 2022On the Importance of Building High-quality Training Datasets for Neural Code Searchcited by 30
- 2021Bridging Pre-trained Models and Downstream Tasks for Source Code Understandingcited by 27
- 2020InferCode: Self-Supervised Learning of Code Representations by Predicting Subtreescited by 23
- 2020Code Smells and Refactoring: A Tertiary Systematic Review of Challenges and Observationscited by 18
- 2021A Search-Based Testing Framework for Deep Neural Networks of Source Code Embeddingcited by 12
- 2021GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analysescited by 11
- 2016sk_p: a neural program corrector for MOOCscited by 10
- 2018Neural Guided Constraint Logic Programming for Program Synthesiscited by 6
- 2018The CodRep Machine Learning on Source Code Competitioncited by 4
- 2021CoCoFuzzing: Testing Neural Code Models with Coverage-Guided Fuzzingcited by 4
Built on by
Citing papers per year: 2024: 2; 2025: 2.
4 papers.
- 2024Data Quality Issues in Vulnerability Detection Datasetscited by 5
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understandingcited by 2
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2025LLM-based Vulnerable Code Augmentation: Generate or Refactor?cited by 0
- 2025LLM-based Vulnerable Code Augmentation: Generate or Refactor?9 Dec 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2024Data Quality Issues in Vulnerability Detection Datasets8 Oct 2024
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding24 Feb 2024