March 14, 2024

Exploring the Application of Large Language Models in Poultry Analytics

Note: This content was presented by Ancera at the 2024 IPPE TechTalks

Information opacity and microbial complexity add challenges to food supply chains. Some of the largest poultry companies in the U.S. are now partnering with data analytics vendors to improve food productivity and safety. Better data helps operators make better decisions when issues arise – and have the insight to prevent issues from happening altogether.

Augmenting data with open-source information is not a new strategy, but large language models (LLMs) are helping to revolutionize the space. Tapping into unstructured information sources such as press releases, news stories, images, and government reports can help poultry producers make more informed decisions.

Ancera is harnessing the power of LLMs, where appropriate, to ingest and transform vast amounts of unstructured data into actionable insights. With proper quality assurance techniques and decision-support software, these insights save time and money, increasing productivity and food safety. 

How it works: Simplifying disparate, complex data

Using GPT-4 integrated AI technology, LLMs process and interpret unstructured data at remarkable speeds, but achieving accuracy requires expert control and a small amount of manual review. In total, LLMs enable faster decision-making, automating the data analysis and interpretation process.

Above: Text-based generalized Large Language Models (LLMs) are built on transformers to predict the next word in a sentence.

To demonstrate the potential of LLMs, Ancera used open-source USDA data to analyze hundreds of product recall events and integrate them into our production modeling.

On its own, the unstructured data would be hard to parse – each recall from the dataset is written in paragraphs with recall reasons buried throughout the text. It would be time-consuming, tedious work to sift through this manually and the results would likely contain human errors. Instead, our trained system employs a predictive LLM knowledge engine to contextualize unstructured data, apply labels, and assign appropriate actions.

By structuring the request and specifying a standardized output, we can quickly extract relevant information from plain text. In the poultry industry, recall risks can vary by cause, and responses to import violations and product contamination can vary drastically. By categorizing 1355 USDA FSIS recall records from 2010 to 2024, we now have a robust dataset that can be used as a feedback loop to better understand and build early detection systems for food safety risks.

Analyzing the USDA FSIS Dataset

Above: An example of a USDA FSIS food recall. Note that data are unstructured.

The USDA classifies its recall reasons into 9 specific codes:

  • Unfit for Human Consumption
  • Produced Without Benefit of Inspection
  • Insanitary Conditions
  • Processing Defect
  • Product Contamination
  • Misbranding
  • Mislabeling
  • Import Violation
  • Unreported Allergens

An unstructured prompt in ChatGPT will retrieve an unstructured answer, so we designed a query using the ChatGPT 4.0 API to programmatically specify the output options and format.

Above: Ancera's data science team leverage the Chat-GPT 4.0 API to query a structured data output.

Upon analyzing the entire dataset and comparing it to a ground truth sample, we found that the model performed well for specificity (or the likelihood of false positives) but GPT-4 struggled with sensitivity (detecting true cases) for some recall categories.

Above: Heatmapping reveals the model's sensitivity and specificity in order to guide a human quality check.

One of the most common errors was the LLM confusing “Mislabeling” for “Misbranding.” As a generalized algorithm, we can anticipate errors such as these by tracking the rate of errors through “hot spot” monitoring and give the model more context to improve for future applications.

Note that even the USDA FSIS dataset is not free from human error and omissions, with cases where the model is more accurate than “true” labels.

The main value of the GPT-4 enabled data generation is significant time savings, where tedious manual data entry can be scaled by structuring raw information. We can also see the potential for cost savings by comparing the cost of the API versus paying minimum wage for 10 hours of data entry in this application.

Leveraging LLMs for faster, less expensive data

Above: Compared to traditional data entry models, an AI-assisted approach for categorizing USDA FSIS recalls are several times less costly in time and salary.

LLMs unlock new uses for unstructured data, but require careful integration and monitoring. This USDA FSIS recall categorization is just one example highlighting the time and cost saving benefits of AI-powered data generation. We see many future applications of this technology, such as integrators improving their compliance protocols, allied company vendors highlighting their product efficacy, and retailers monitoring consumer sentiment and trends.

We built a tool so food data enthusiasts can explore the model and categorize some of the USDA FSIS recalls. Each result shows how your answer compares to a USDA FSIS data entry specialist and GPT-4. Try it out!