Trade Compliance Insights

Can AI Do HTS Classification?

Title graphic for the article Can AI Do HTS Classification? by Surajit Roy

Partly. By October 2024, an AI model I had trained on Chapter 82 of the US Harmonized Tariff Schedule (HTS) could take an image, a description, a product name or a URL and return an HTS code that made sense. It was not perfect. Getting that far took four years of self-taught experiments, two pauses (one for lack of technical skills, one for lack of funding), and a lot of trial and error. This article describes that work, the test reports, and what I wanted the tool to become.

I have worked in HTS classification since 2017. Classification decides how goods are treated for customs duties, taxes and trade compliance, and it means reading a product down to small details and applying the legal rules to them. The question I kept asking was whether a machine could do that reliably.

Why HTS classification is hard for AI

Classification is more than matching product names to codes. It needs the General Rules for the Interpretation of the Harmonized System (GRIs), knowledge of national and international trade rules, and a correct reading of the product’s specifications. Every product has its own attributes, and the classifier has to interpret them against the legal text.

AI can process large amounts of data. The difficulty is getting it to follow the reasoning behind a classification, especially when a product could fit more than one heading. The legal framework also changes often, and each country has its own national tariff on top of the six-digit HS. Teaching a model to handle all of this is a large task.

How the project started

I came to AI by accident. I had been working as an HS classifier since 2017, and during the COVID-19 pandemic, working from home, I had spare time to follow an old curiosity about robotics and automation. My academic background is in Bengali literature, so this was new ground. I was not a tech person.

By December 2020 I had finished a course on Robotic Process Automation (RPA) using UiPath, and I wanted to learn more. I tried Python and machine learning, but they were too technical for me at the time and I made little progress.

In mid-2021 I got access to OpenAI’s beta. It showed me that AI might be able to help with HTS classification, and I began testing how it handled commodities with the tools I had. My limited Python and machine learning skills held me back, though, and in July 2022, after leaving my job at Avalara, I paused the project.

ChatGPT’s public release in November 2022 brought me back. I used several AI tools to understand how they worked, first for text, image and video generation, since content creation had become a hobby. I also started thinking about how a model could be fine-tuned to classify commodities. The money needed was large: my estimate for developing an AI tool for HTS classification was close to $2 million.

I wrote a proposal and presented it on LinkedIn, but I could not raise funding. Investors and CEOs contacted me, but without a working prototype they saw the project as too risky. That was a low point, and I paused the research again.

In December 2023 I lost my job and was unemployed for the next seven months. Severance pay from STTAS and UPS gave me enough to live on, and I used that time to go back to research and development. This time I made progress. At the time of writing I was working towards a functional prototype, which still needed around $30,000 in additional funding.

Why I chose Chapter 82 for testing

I can’t fully explain why I picked Chapter 82 of the HTS for the first tests. Chapter 82 covers tools, implements, cutlery, spoons and forks of base metal, and parts of them. Its structure and the variety of products drew me in. Looking back, it was a good choice, because the range of products gave the model plenty to get wrong.

Technology and data used to train the model

Building the model went far beyond my original skills. I relied on GitHub, YouTube and Stack Overflow to put together the Python and JavaScript code I needed. AWS was the server, and I pulled data from 17 different types of databases, including PDFs, CSVs, text files and image files, to teach the model how to interpret and classify products.

Training it on the basic concepts of Chapter 82 and the GRIs took a lot of trial and error. Eventually the model started to respond to user instructions in a way that made sense. It wasn’t perfect, but it worked.

How it works now

The model is trained on the basic classification rules for Chapter 82. It follows user instructions and returns HTS codes based on the data it has been given, and it can recognize a commodity from an image, a description, a name or a URL. The test reports below give more detail on how the system performed.

Support the future of AI-driven trade compliance

Third test report, 12 July 2025

Later test reports were added to this article as the work continued. The tool was launched in July 2025 as Tariff Wolf, an AI-powered HS classification tool.

Second test report, 9 February 2025

First test report, 2 October 2024

What the prototype was designed to do

The prototype focused on classifying Chapter 82 products for import into the United States. Users could upload an image of the commodity, give a product description, enter the commodity name or share a product URL, and the model would analyze the input and suggest a classification. The longer-term aim was a tool that could classify all commodities for all countries, which would help e-commerce platforms, where wrong HTS codes are common.

What I want to build

My aim is an AI tool that can suggest HTS codes for any commodity, in any country, from several input types: an API, product titles, CSV lists, or text and PDF files. The main users I had in mind were e-commerce businesses, especially smaller companies without their own classification teams, for whom classification is slow manual work.

A rough estimate of the market

To size the opportunity in 2024, I used Amazon’s order volume as an example. An often-quoted (unofficial) estimate is that Amazon handles around 66,000 orders per hour, or 1.58 million orders per day. If an AI tool classified just 10% of those orders, it would process 158,400 commodities a day. Assuming a price of $0.35 per HS code (my assumption, not a published Amazon rate), that would come to about $55,000 per day from Amazon’s orders alone. These are my assumptions, not published figures, so treat the result as a rough illustration.

Also read: Challenges I have faced in developing AI-based HS classification tools

Made in India

When I wrote this in 2024, I did not know of any trade compliance tool made in India. By God’s grace, this AI-based HTS classification tool could be one of the first built here. I want it to serve India’s growing e-commerce industry and give small business owners an affordable way to manage classification.

Where this leaves the question

AI can already suggest HTS codes for a limited chapter when it is trained on the rules and the right data, but building a tool that does this well is slow and expensive, and it still needs a classifier to check the result. I have had technical problems, money problems and personal setbacks on the way, and I am still working on it. For a wider view of where classification work is heading, read my article on the future of HTS classification.

Trade Compliance Insights Would you like to receive notifications on latest updates? No Yes