# Machine learning predicts the fill or piece weight from upstream process data and adjusts the filler or extruder before the checkweigher sees a drift: overfill giveaway cut by 50% on Unilever's Hellmann's mayonnaise line, weight variability cut by 50% on a Hershey Twizzlers line (Unilever, Hershey)

> ML predicts fill weight from process data and corrects the filler: 50% less overfill giveaway at Unilever Hellmann's, 50% less weight variability at Hershey.

- Canonical URL: https://aiagentsformanufacturing.com/use-cases/ai-fill-weight-giveaway-reduction-overfill-filler-extruder-control-unilever-hellmanns-hershey/
- Department: Production (https://aiagentsformanufacturing.com/departments/production/)
- Evidence level: Verified. Real deployment at a named or precisely described company, with a measured result from a primary source.
- Added: 2026-12-02
- Last updated: 2026-12-02
- Publisher: AI Agents for Manufacturing (https://aiagentsformanufacturing.com)
- Manufacturers named: Unilever (https://aiagentsformanufacturing.com/companies/unilever/), Hershey (https://aiagentsformanufacturing.com/companies/hershey/)
- AI tools deployed: Rockwell Automation FactoryTalk LogixAI (https://aiagentsformanufacturing.com/tools/rockwell-automation-factorytalk-logixai/), Microsoft Azure Machine Learning (https://aiagentsformanufacturing.com/tools/microsoft-azure-machine-learning/)
- Glossary terms: Edge computing (https://aiagentsformanufacturing.com/glossary/#edge-computing), Giveaway (overfill) (https://aiagentsformanufacturing.com/glossary/#giveaway), Model drift and retraining (https://aiagentsformanufacturing.com/glossary/#model-drift), Soft sensor (virtual sensor) (https://aiagentsformanufacturing.com/glossary/#soft-sensor)

## Role

Prediction of the next jar, bottle or piece weight (or fill level) from upstream process variables, with automatic adjustment of the filler or extruder settings to run closer to the declared quantity without underfills. Typical users: packaging or filling line engineer, process engineer, production manager, quality manager (net weight compliance), continuous improvement and automation team, plant controller (giveaway cost)

## The problem

Food and drink makers must never sell less than the declared net weight or volume, so they usually fill a little more to be safe, and that giveaway costs ingredients on every pack. At Unilever's Pouso Alegre food plant near São Paulo, Brazil, the Hellmann's mayonnaise line fills 320 to 350 jars a minute with a 500 g target, 499 g underfills are scrap and so are overfills above 508 g; the PID loop corrected the filler from downstream checkweigher feedback, a reactive approach that sometimes led to overfilling (Packaging World, 2024). At Hershey's Twizzlers plant in Lancaster, Pennsylvania, small temperature changes made the licorice lighter or heavier; operators weighed it every 15 minutes and adjusted the extruder about 12 times a day, so the line ran heavy and could produce an extra 100 grams of candy per minute (CNBC, 2017). On beverage fillers, Krones explains that the fill level depends on the filler bowl pressure, which operators adjust by hand as product temperature, CO2 content and vacuum change, which is especially hard at start-up.

## How AI helps

A model learns how upstream process variables drive the final weight or fill level, predicts the next result before the product is filled or extruded, and sends a correction to the controller. At Unilever, Rockwell Automation's FactoryTalk LogixAI Perfect Fill acts as a soft sensor: the team selected key variables from upstream mixing and filtering and from the filling itself with a correlation matrix, trained the model on historical and live data at the edge next to the equipment, and the model predicts the dosed weight of the next jar so the controller can correct an overfill of, for example, three or four grams; it runs in the Logix controller with Studio 5000 and ladder logic. At Hershey, a single Twizzlers line sent data from 22 to 23 sensors (temperature, pressure, rotations per minute) to Microsoft Azure, collecting more than 60 million data points over two months; Azure Machine Learning found which variables affected the licorice weight and the line now adjusts itself, built without a data scientist according to Hershey's George Lenhart. Krones offers an AI fill level control for its Dynafill filler: a model on the line's edge device uses product temperature, CO2 content and container vacuum, plus the fill level measured on every bottle by the inspector, to set the bowl pressure, with one model per product.

## Step by step

1. Export a few weeks of checkweigher data for one line with the target, the legal minimum and the reject limits, and compute today's average giveaway and its cost.
2. Collect the upstream process data for the same period (temperatures, pressures, speeds, tank levels, product changes) with matching timestamps.
3. Check which variables explain the weight variation, and fix simple causes first (a tank level, a worn nozzle, a slow feedback loop).
4. Train a prediction model and run it in advisory mode, comparing its predicted weights with the checkweigher before letting it adjust anything.
5. Close the loop on one line with limits on how far the model can move each setting, and keep the checkweigher as the final legal check.
6. Track average giveaway, standard deviation, underfill rejects and product changeover time for three months before extending to other lines or products.

## Tools

- Rockwell Automation FactoryTalk LogixAI Perfect Fill (edge soft sensor predicting fill weight, running with Logix controllers): used at Unilever Pouso Alegre
- Microsoft Azure Machine Learning with IoT sensors on the extrusion line: used at Hershey Lancaster
- Other tools to evaluate: Krones AI fill level control for the Dynafill filler, smart fill adjustment from your checkweigher supplier, or a soft sensor built by your own data team on PLC and historian data
- To start without new software: a few weeks of checkweigher data and filler or extruder settings, and any LLM (ChatGPT, Claude, Copilot, Gemini) with the prompt below to size the giveaway and plan a trial

## Result

Unilever Pouso Alegre (Packaging World report of a Unilever and Rockwell Automation presentation at Automation Fair, November 2024): finished goods overfill giveaway on the Hellmann's line reduced by 50%, with a tighter fill distribution closer to 500 g without going under. Hershey (CNBC, May 2017, quoting Hershey's George Lenhart): the line adjusts itself about 240 times a day instead of 12 manual adjustments, and weight variability fell by 50%; Lenhart told TechRepublic that every 1% of size brought closer to the precise weight in a 14,000-pound batch saves $500,000 in ingredients, and the sensors also revealed a tank level that caused variability, fixed by reprogramming the tank. Krones (Krones magazine, November 2024): the AI fill level control has been field-tested and is in use at a major unnamed customer on a Dynafill filling about ten products; a new product was set up in 15 minutes instead of the half hour planned; no reject or giveaway figure is published.

As reported by the source; most figures are vendor or self-reported and not independently verified.

## Human review: cautions

- The Unilever figure comes from a trade press report of a joint presentation with Rockwell Automation, the vendor; the Hershey figures come from press interviews with Hershey in 2017, and later results are not published.
- The 50% at Unilever is a reduction of overfill giveaway, and the 50% at Hershey is a reduction of weight variability; neither is a reduction of total product cost.
- Krones' customer is not named and no giveaway or reject figure is published.
- Net weight rules (average and minimum quantity, such as the e-mark system in Europe or NIST Handbook 133 in the US) still apply; keep the checkweigher and your legal controls as the final check.
- A model trained on one product, recipe or filler can drift after changes; monitor prediction error and retrain after recipe, supplier or equipment changes.

## Try it yourself (prompt)

```text
You are a process engineer on a filling or packing line in our food or beverage plant. I want to know how much product we give away above the declared weight and whether an AI model that predicts and corrects the fill would pay off.

I will paste: (1) 2 to 8 weeks of checkweigher data [timestamp, line, product, filler head if known, measured weight, rejected yes or no]; (2) the declared quantity, our target, the legal tolerance and our reject limits per product; (3) upstream process data for the same period [timestamp, temperatures, pressures, speeds, tank levels, product or batch changes]; (4) the cost of the product per kg or litre.

Do this:
1. Compute average giveaway, standard deviation and underfill rejects by line, product and filler head, and the yearly giveaway cost, with your calculation and assumptions.
2. Estimate how much giveaway could be saved if the standard deviation fell by 25% and by 50% while keeping the same underfill risk.
3. Look for patterns in the upstream data (start-ups, product changes, temperature, tank level) that go with weight drifts, and list simple fixes to try first.
4. Draft a three-month trial plan for one line: advisory mode first, limits on automatic adjustments, acceptance criteria and who signs off.
5. List questions for suppliers (data needed, edge or cloud, integration with our PLC and checkweigher, model per product, legal metrology).

Use only the data I paste in; if something is missing, write 'not found' or list it as a question instead of guessing. Do not send, order, post or change anything in any system: produce drafts for my review and approval.
```

## Related use cases

- [AI soft sensors predict lab quality values from process data every few minutes instead of waiting hours for samples, so operators correct the process sooner and the lab runs fewer analyses (Sasol, HPCL, LANXESS)](https://aiagentsformanufacturing.com/use-cases/ai-soft-sensor-virtual-analyzer-predict-lab-quality-continuous-process-sasol-hpcl-lanxess/)
- [AI reads the date code and checks the label on every pack at line speed, so the wrong label or code never ships (Ilchester Cheese, Del Monte Foods)](https://aiagentsformanufacturing.com/use-cases/ai-label-date-code-verification-ocr-packaging-line-ilchester-del-monte/)
- [Machine learning predicts the oxygen content, energy and slag of each electric arc furnace heat and adjusts burners, oxygen, carbon and lime: 4% lower energy use at Nucor Steel Arkansas, about 10 kWh per tonne less in EMSTEEL's optimisation study (Nucor, EMSTEEL)](https://aiagentsformanufacturing.com/use-cases/ml-electric-arc-furnace-eaf-energy-optimization-oxygen-control-nucor-steel-arkansas-emsteel/)
- [AI controls the tire building machine from sensor data on every green tire, adjusting for rubber that stretches and changes with temperature instead of relying on operator skill: more than 15% better uniformity and training time cut to a third at Bridgestone's Hikone plant (Bridgestone)](https://aiagentsformanufacturing.com/use-cases/ai-tire-building-machine-autonomous-control-green-tire-uniformity-bridgestone-examation/)

## Sources

- https://www.packworld.com/trends/digital-transformation/article/22926775/unilever-optimizes-hellmanns-mayo-fill-levels-with-rockwells-aibased-predictive-analytics
- https://www.cnbc.com/2017/05/21/hersheys-pennsylvania-twizzler-factory-uses-microsoft-artificial-intelligence.html
- https://www.techrepublic.com/article/how-hershey-used-the-cloud-to-deploy-iot-and-machine-learning-without-a-data-scientist/
- https://www.krones.com/en/company/press/krones-magazine/innovation/ai-ensures-accurate-fill-levels/

## How to cite this case

AI Agents for Manufacturing. (2026). Machine learning predicts the fill or piece weight from upstream process data and adjusts the filler or extruder before the checkweigher sees a drift: overfill giveaway cut by 50% on Unilever's Hellmann's mayonnaise line, weight variability cut by 50% on a Hershey Twizzlers line (Unilever, Hershey). Evidence level: Verified. Last updated December 2, 2026. https://aiagentsformanufacturing.com/use-cases/ai-fill-weight-giveaway-reduction-overfill-filler-extruder-control-unilever-hellmanns-hershey/

Short form: Unilever, Hershey, as reported in "Machine learning predicts the fill or piece weight from upstream process data and adjusts the filler or extruder before the checkweigher sees a drift: overfill giveaway cut by 50% on Unilever's Hellmann's mayonnaise line, weight variability cut by 50% on a Hershey Twizzlers line", AI Agents for Manufacturing (Verified evidence), https://aiagentsformanufacturing.com/use-cases/ai-fill-weight-giveaway-reduction-overfill-filler-extruder-control-unilever-hellmanns-hershey/

---
Please cite the canonical URL: https://aiagentsformanufacturing.com/use-cases/ai-fill-weight-giveaway-reduction-overfill-filler-extruder-control-unilever-hellmanns-hershey/
