The accurate assignment and validation of Harmonized System (HS) codes for traded goods is critical for customs and indirect tax administration to prevent revenue leakages through commodity misclassification. This research aligns with the IndiaAI mission’s objective to foster AI innovation for public sector governance, as India processes 4.7 million import declarations annually. Traditional automated systems face severe limitations: conventional machine learning approaches lack semantic understanding, exhibit bias toward historical data, and cannot handle extreme class imbalances, making them unsuitable for real-time validation environments requiring accurate interpretation of complex customs terminology. This study presents CustomsBERT, a production-ready framework for real-time validation of electronic trade declarations, combining root-representative hybrid clustering with domain-specific BERT fine-tuning to deliver accurate, scalable HS code validation. To address severe class imbalance in the NCTC Customs Import Dataset (5.9M samples across 7,683 HS code classes), we developed a hybrid clustering approach combining BM25 lexical similarity and cross-encoder semantic similarity. Three transformer architectures DistilBERT-base-uncased, ModernBERT-base, and RoBERTa-base were fine-tuned on filtered data (100–1,000 samples/class) using 72-token sequence lengths. RoBERTa-base achieved superior performance with 70.94% validation accuracy and 0.7071 F1-score, demonstrating 12.1% improvement over baseline DistilBERT. This framework enables seamless integration with existing customs filing systems, providing tax administrations with automated HS code validation that enhances revenue protection while facilitating legitimate trade.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

CustomsBERT: A Production-Ready Transformer Framework with Hybrid Clustering for Automated HS Code Classification and Real-Time Validation in Indirect Tax Administration and Trade Assistance Systems

  • Ramesh Moorthy,
  • Shivam Dhamanikar,
  • Kopal Tandon,
  • Prashant Gidde,
  • Suresh Kannan Nadar

摘要

The accurate assignment and validation of Harmonized System (HS) codes for traded goods is critical for customs and indirect tax administration to prevent revenue leakages through commodity misclassification. This research aligns with the IndiaAI mission’s objective to foster AI innovation for public sector governance, as India processes 4.7 million import declarations annually. Traditional automated systems face severe limitations: conventional machine learning approaches lack semantic understanding, exhibit bias toward historical data, and cannot handle extreme class imbalances, making them unsuitable for real-time validation environments requiring accurate interpretation of complex customs terminology. This study presents CustomsBERT, a production-ready framework for real-time validation of electronic trade declarations, combining root-representative hybrid clustering with domain-specific BERT fine-tuning to deliver accurate, scalable HS code validation. To address severe class imbalance in the NCTC Customs Import Dataset (5.9M samples across 7,683 HS code classes), we developed a hybrid clustering approach combining BM25 lexical similarity and cross-encoder semantic similarity. Three transformer architectures DistilBERT-base-uncased, ModernBERT-base, and RoBERTa-base were fine-tuned on filtered data (100–1,000 samples/class) using 72-token sequence lengths. RoBERTa-base achieved superior performance with 70.94% validation accuracy and 0.7071 F1-score, demonstrating 12.1% improvement over baseline DistilBERT. This framework enables seamless integration with existing customs filing systems, providing tax administrations with automated HS code validation that enhances revenue protection while facilitating legitimate trade.