Built an ML viscosity prediction model and a blend-search algorithm to recommend green-material mix plans in about 10 seconds as part of an AI master plan PoC.
Context
- LOTTE Fine Chemical blends semi-finished green-material lots and additives into finished grades, following a mix plan that sets which inventory to use and how much.
- The company selected this PoC as one of three under its company-wide AI master plan to improve finished-product quality and reduce the work of planning blends.
Problem
Scroll sideways to see the whole diagram
Components
- Before · manual: Mix plan input (Planner input); Check recipe, additive ratios; Draft combination, stock by hand; Viscosity map, lab lookup table; Confirm plan
- After · automated: Mix plan input, + preferences (Planner input); Filter inventory, rules applied (Automated step); Search space, candidate stock list (Automated step); Recommend mix, sort + grid search (Automated step); Confirm plan; Model training, 2018–23 records; Viscosity model, MAPE 3.4% (map 6.5%) (ML model)
Connections
- Mix plan input (Before · manual) to Check recipe
- Check recipe to Draft combination
- Draft combination to Viscosity map
- Viscosity map to Confirm plan (Before · manual)
- Viscosity map back to Draft combination
- Mix plan input (After · automated) to Filter inventory
- Filter inventory to Search space
- Search space to Recommend mix
- Recommend mix to Confirm plan (After · automated)
- Recommend mix to Viscosity model
- Viscosity model back to Recommend mix
- Model training to Viscosity model
- Planners needed at least 10 minutes to estimate finished-product viscosity with a lab-built viscosity map that required costly experiments and missed plant operating conditions.
- Planners spent about 20 minutes on each mix plan by hand, relying on trial and error, a few experts, and mixing rules that were neither written down nor standardized.
- An earlier system for automating mix planning with a solver took at least 300 seconds per run, ignored the planners' mixing rules, and often failed. The team could not maintain it because the solver was closed.
My role
- Led the PoC as project manager in a two-person team with a data scientist, reporting to the client's AI task force.
- Built the viscosity prediction pipeline and the MixPlanner combination algorithm, then handed over the pilot and trained users.
Approach
- Used about 180,000 raw rows to build a regression dataset of about 22,000 mixing records from 2018–2023 for viscosity prediction. Targeted a MAPE of 5% or less and predictions within one second.
- Implemented preprocessing and modeling as reusable data and model pipelines, compared five models, and selected Random Forest.
- Built MixPlanner, a Python package that applies planners' preferences and mixing rules to filter out unsuitable stock, rank candidates, and search near the best combination, rechecking viscosity until the plan meets spec.
- Tested the algorithm on 20 representative plans from 2023 records, checking output quantity, compliance with quality criteria, and run time.
Key decisions
| Decision | Why | Trade-off |
|---|---|---|
| Sorting and grid search instead of a commercial solver | The team applied the planners' mixing rules, cut run time from at least 300 seconds to about 10 by searching the most promising combinations first, and gave the client access to the code for maintenance. | Finds a good combination, not a proven optimum. |
| Training on plant operating records | The team used about 22,000 plant records in place of about 50 lab mixes to reflect real operating conditions and include inputs such as re-fed material and additives. | The team needs to maintain the quality of its operating data for reliable predictions. |
Architecture
Scroll sideways to see the whole diagram
Components
- Planning screen, settings in · recommended mix out (Planner input); Lab quality data, LIMS · viscosity; Mixing-plan DB, recipes · past plans; Inventory DB, WMS · MES
- Training program · offline: Labeled dataset, ≈22k mixes; Data pipeline, grade · outliers · gaps; Model pipeline, select · scale · encode; Viscosity model, Random Forest · MAPE 3.4% (ML model)
- MixPlanner engine: Initialize, recipes · inventory (MixPlanner step); Filter inventory, filter_search_space (MixPlanner step)
- Combination search: Base combination, find_base_combination (MixPlanner step); Viscosity prediction, predict_viscosity (MixPlanner step); Adjust combination, adjust_mix_plan (MixPlanner step)
Connections
- Planning screen with Initialize
- Labeled dataset to Data pipeline
- Data pipeline to Model pipeline
- Model pipeline to Viscosity model
- Viscosity model to Viscosity prediction
- Initialize to Filter inventory
- Filter inventory to Base combination
- Base combination to Viscosity prediction
- Viscosity prediction to Adjust combination
- Adjust combination back to Viscosity prediction
- Lab quality data to Training program · offline
- Mixing-plan DB to Training program · offline
- Mixing-plan DB to MixPlanner engine
- Inventory DB to MixPlanner engine
Service flow
Scroll sideways to see the whole diagram
Components
- Planner: Mix plan input, grade · quantity · batch (Planner input); Start mixing; Optimal and in spec?
- 1 New run: Preferences, stock age · re-feed ratio; Mixing rules, planner know-how
- 2 Load data: Mixing-plan DB, recipes · past plans; Inventory DB, WMS · MES
- 3 Narrow stock: Filter inventory, drop unfit stock (MixPlanner step); Search space, candidate stock list
- 4 Recommend: Combination search, sort + grid search (MixPlanner step); Viscosity prediction, ML model (ML model)
Connections
- Mix plan input to Preferences
- 1 New run to 2 Load data
- 2 Load data to 3 Narrow stock
- 3 Narrow stock to 4 Recommend
- Filter inventory to Search space
- Combination search to Viscosity prediction
- Viscosity prediction back to Combination search
- Combination search to Optimal and in spec?
- Optimal and in spec? to Start mixing
- Optimal and in spec? back to Preferences
Outcome
- Cut viscosity prediction error from 6.5% to 3.4% MAPE versus the viscosity map, and prediction time from at least 10 minutes to about one second.
- Generated mix plans in about 10 seconds instead of about 20 minutes by hand and found combinations for 18 of 20 simulated plans. Kept the calculated blends within 2% of recipe targets.
- Completed a pilot linked to the operating databases and handed over the source code and training to the client's AI task force.