{"id":1404,"date":"2026-08-19T02:00:31","date_gmt":"2026-08-19T02:00:31","guid":{"rendered":"https:\/\/mestric.com\/napovedovanje-izmeta\/"},"modified":"2026-08-19T02:00:31","modified_gmt":"2026-08-19T02:00:31","slug":"napovedovanje-izmeta","status":"publish","type":"post","link":"https:\/\/mestric.com\/sl\/napovedovanje-izmeta\/","title":{"rendered":"Napovedovanje izmeta: an ML guide for production managers"},"content":{"rendered":"<\/p>\n<p>Yes, you can predict scrap before it happens, and modern machine learning makes it practical for most factories running MES-connected equipment. <strong>Napovedovanje izmeta<\/strong> (Slovenian for \u201cscrap prediction\u201d) uses process data, production models like <a href=\"http:\/\/hdl.handle.net\/20.500.12556\/DKUM-90015\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">XGBoost, CatBoost and decision trees<\/a> to flag at-risk production cycles before they finish. A Slovenian master\u2019s thesis on <strong>Talum<\/strong>\u2019s aluminium casting lines demonstrated this in a real factory setting, and the approach translates to most discrete and process manufacturing.<\/p>\n<p>Start with three things this week:<\/p>\n<ul>\n<li>Audit your existing sensor and quality data for completeness and timestamp accuracy.<\/li>\n<li>Run a small pilot on one production line rather than the whole plant.<\/li>\n<li>Connect PLC signals directly into your MES so the model sees cycle-level detail, not batch averages.<\/li>\n<\/ul>\n<p>Done properly, this typically cuts undetected scrap incidents and shortens the time between a defect forming and someone noticing it, with Mestric\u2019s real-time tracking acting as the delivery layer for the alerts.<\/p>\n<h2 id=\"key-takeaways\">Key Takeaways<\/h2>\n<p>Scrap prediction works when clean cycle-level data, an interpretable model and a trusted alert pathway all operate together, not in isolation.<\/p>\n<table>\n<thead>\n<tr>\n<th>Point<\/th>\n<th>Details<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Start with tree ensembles<\/td>\n<td>Random forests and XGBoost balance accuracy and interpretability better than deep neural networks for most factories.<\/td>\n<\/tr>\n<tr>\n<td>Fix your data first<\/td>\n<td>Cycle-level PLC integration and consistent scrap labelling matter more than algorithm choice.<\/td>\n<\/tr>\n<tr>\n<td>Pilot on one line<\/td>\n<td>Test predictions against real outcomes for 4 to 8 weeks before touching plant-wide rollout.<\/td>\n<\/tr>\n<tr>\n<td>Choose thresholds by cost<\/td>\n<td>Bias towards recall when missed defects cost more than false alarms.<\/td>\n<\/tr>\n<tr>\n<td>Mestric closes the loop<\/td>\n<td>Its MES connects PLC data to real-time alerts, turning predictions into operator action on the shop floor.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"table-of-contents\">Table of Contents<\/h2>\n<ul>\n<li><a href=\"#what-the-talum-case-study-teaches-about-napoved-izmeta\">What the Talum case study teaches about napoved izmeta<\/a><\/li>\n<li><a href=\"#which-machine-learning-models-work-best-for-scrap-prediction\">Which machine-learning models work best for scrap prediction<\/a><\/li>\n<li><a href=\"#data-sources-you-need-for-reliable-scrap-prediction\">Data sources you need for reliable scrap prediction<\/a><\/li>\n<li><a href=\"#how-to-evaluate-models-and-prove-the-roi\">How to evaluate models and prove the ROI<\/a><\/li>\n<li><a href=\"#rolling-out-a-pilot-without-disrupting-production\">Rolling out a pilot without disrupting production<\/a><\/li>\n<li><a href=\"#where-scrap-prediction-models-go-wrong\">Where scrap prediction models go wrong<\/a><\/li>\n<li><a href=\"#how-mestric-turns-predictions-into-shop-floor-action\">How Mestric turns predictions into shop floor action<\/a><\/li>\n<li><a href=\"#frequently-asked-questions\">Frequently asked questions<\/a><\/li>\n<li><a href=\"#sources\">Sources<\/a><\/li>\n<\/ul>\n<h2 id=\"what-the-talum-case-study-teaches-about-napoved-izmeta\">What the Talum case study teaches about napoved izmeta<\/h2>\n<p>A DKUM-published master\u2019s thesis built predictive models for <strong>Talum<\/strong>, the Slovenian aluminium producer, aiming to reduce <strong>izmet<\/strong> (scrap) in casting production. The thesis used exploratory data analysis, feature engineering from process parameters, and k-fold cross-validation to test several algorithms against real production records.<\/p>\n<p>The researchers reported that tree-based and neural network approaches, including decision trees, deep neural networks, XGBoost and CatBoost, achieved strong accuracy predicting scrap in aluminium casting. A separate steel production analysis found a genetic-programming model outperformed simple linear regression by roughly 1.57 times on its test dataset, a reminder that non-linear methods often earn their complexity in scrap prediction work.<\/p>\n<p>Three lessons carry over to almost any factory:<\/p>\n<ul>\n<li>Feature engineering from raw process parameters mattered more than any single algorithm choice.<\/li>\n<li>Cross-validation exposed models that looked good on training data but failed on unseen batches.<\/li>\n<li>The point of the model was preventive action mid-cycle, not a post-mortem report.<\/li>\n<\/ul>\n<p><strong>Pro Tip:<\/strong> <em>Before you touch an algorithm, replicate the thesis\u2019s exploratory data analysis step on your own data. You will usually find your biggest quality gaps before you find your biggest modelling gains.<\/em><\/p>\n<h2 id=\"which-machine-learning-models-work-best-for-scrap-prediction\">Which machine-learning models work best for scrap prediction<\/h2>\n<p>Most factories should start with tree ensembles, not neural networks. Decision trees and random forests handle mixed sensor and categorical data without heavy pre-processing, and they show you which features drove a prediction, something operators actually trust on the shop floor.<\/p>\n<p>XGBoost and CatBoost push accuracy further once you have clean, labelled data, often matching or beating the accuracy reported in the Talum thesis for casting scrap. Deep neural networks can outperform both when you have very large datasets and complex, non-linear interactions between process variables, but they cost more to maintain and are harder to explain to a line supervisor asking \u201cwhy did it flag this batch?\u201d<\/p>\n<table>\n<thead>\n<tr>\n<th>Model family<\/th>\n<th>Interpretability<\/th>\n<th>Data needed<\/th>\n<th>Maintenance effort<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Logistic regression<\/td>\n<td>High<\/td>\n<td>Low<\/td>\n<td>Low<\/td>\n<\/tr>\n<tr>\n<td>Decision trees \/ random forest<\/td>\n<td>High<\/td>\n<td>Moderate<\/td>\n<td>Low to moderate<\/td>\n<\/tr>\n<tr>\n<td>XGBoost \/ CatBoost<\/td>\n<td>Moderate<\/td>\n<td>Moderate to high<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<tr>\n<td>Deep neural networks<\/td>\n<td>Low<\/td>\n<td>High<\/td>\n<td>High<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/csuxjmfbwmkxiegfpljm.supabase.co\/storage\/v1\/object\/public\/blog-images\/organization-16618\/1786957566647_Comparison-chart-of-machine-learning-models-for-scrap-prediction.jpeg\" alt=\"Comparison chart of machine learning models for scrap prediction\"><\/p>\n<p>Begin with a random forest or logistic regression baseline. Move to XGBoost only if accuracy plateaus and you have the labelled volume to support it.<\/p>\n<p><strong>Pro Tip:<\/strong> <em>Explainability isn\u2019t a nice-to-have here. If an operator can\u2019t see which parameter tripped the alert, they\u2019ll ignore the next ten alerts too.<\/em><\/p>\n<h2 id=\"data-sources-you-need-for-reliable-scrap-prediction\">Data sources you need for reliable scrap prediction<\/h2>\n<p>Reliable <strong>scrap forecasting<\/strong>, sorry, reliable scrap forecasting for factories depends entirely on the quality of what you feed the model. Weak inputs produce a model that looks precise and predicts nothing useful.<\/p>\n<p>Capture these signals as a minimum:<\/p>\n<ul>\n<li>PLC sensor streams (temperature, pressure, vibration, speed)<\/li>\n<li>Machine setpoints and cycle times per batch<\/li>\n<li>Material batch IDs and supplier lot numbers<\/li>\n<li>Furnace or temper data where heat treatment applies<\/li>\n<li>Tool condition and wear indicators<\/li>\n<li>In-line quality readings plus final inspection labels<\/li>\n<\/ul>\n<p>Build your pipeline in this order:<\/p>\n<ol>\n<li>Synchronise timestamps across every PLC and MES source so events line up correctly.<\/li>\n<li>Resample raw signals to cycle level rather than shift or batch averages.<\/li>\n<li>Engineer rolling statistics and deltas (rate of change, not just raw values).<\/li>\n<li>Align quality labels precisely to the cycle that produced them.<\/li>\n<li>Decide a consistent rule for handling missing readings before training starts.<\/li>\n<\/ol>\n<p>Scrap events are usually rare compared to good production, so class imbalance needs deliberate handling: resampling techniques or cost-sensitive training rather than a plain accuracy target. Direct PLC capture through your MES matters because <a href=\"https:\/\/www.3tav.si\/storitve-in-resitve\/informacijska-podpora-proizvodnje-industrija-4-0\/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">batch-level logs hide the micro-fluctuations<\/a> that actually cause defects, and cycle-level resolution is what separates a useful model from a decorative one.<\/p>\n<h2 id=\"how-to-evaluate-models-and-prove-the-roi\">How to evaluate models and prove the ROI<\/h2>\n<p>Accuracy alone will mislead you. If only <a href=\"https:\/\/en.wikipedia.org\/wiki\/Confusion_matrix\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">3%<\/a> of cycles produce scrap, a model that predicts \u201cno scrap\u201d every time scores 97% accuracy and catches nothing.<\/p>\n<p>Precision tells you how many flagged cycles were genuinely scrap; recall tells you how many actual scrap events the model caught. For scrap detection, recall usually matters more, missing a real defect costs more than double-checking a false alarm, but pushing recall too far floods operators with noise. F1 and AUC give you a single number to compare model versions over time.<\/p>\n<table>\n<thead>\n<tr>\n<th>Metric<\/th>\n<th>What it measures<\/th>\n<th>Best used for<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Precision<\/td>\n<td>Share of flagged cycles that were true scrap<\/td>\n<td>Reducing false alarms<\/td>\n<\/tr>\n<tr>\n<td>Recall<\/td>\n<td>Share of actual scrap events caught<\/td>\n<td>Minimising missed defects<\/td>\n<\/tr>\n<tr>\n<td>F1 score<\/td>\n<td>Balance of precision and recall<\/td>\n<td>Comparing model versions<\/td>\n<\/tr>\n<tr>\n<td>AUC<\/td>\n<td>Overall separability of scrap vs non-scrap<\/td>\n<td>Threshold tuning<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Set your decision threshold based on cost, not convenience: if a false negative costs ten times more than a false positive, bias the threshold towards recall. Validate with time-series splits rather than random k-fold alone, since production data drifts, and always hold out a genuinely unseen production period as your final test. Once the model performs, translate results into <a href=\"https:\/\/mestric.com\/sl\/predictive-analytics-manufacturing-efficiency-costs\/\" target=\"_blank\" rel=\"noopener\">material cost saved and rework hours avoided<\/a> so finance sees the same numbers engineering does.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/csuxjmfbwmkxiegfpljm.supabase.co\/storage\/v1\/object\/public\/blog-images\/organization-16618\/1786957614220_How-to-evaluate-models-and-prove-the-ROI-overview-diagram.jpeg\" alt=\"How to evaluate models and prove the ROI \u2014 overview diagram\"><\/p>\n<h2 id=\"rolling-out-a-pilot-without-disrupting-production\">Rolling out a pilot without disrupting production<\/h2>\n<p>Moving from a promising model to a working plant system takes discipline, not speed. Rush the rollout and you\u2019ll get an alert system nobody trusts by week three.<\/p>\n<ol>\n<li><strong>Data audit (2 to 3 weeks).<\/strong> Confirm sensor coverage, timestamp accuracy and label reliability before writing a single line of model code.<\/li>\n<li><strong>Feature engineering and offline development (3 to 5 weeks).<\/strong> Build and cross-validate candidate models against historical production data.<\/li>\n<li><strong>Single-line pilot (4 to 8 weeks).<\/strong> Run the model live on one line, comparing its flags against actual outcomes without changing operator behaviour yet.<\/li>\n<li><strong>Alert integration into MES (2 to 4 weeks).<\/strong> Surface predictions as decision support inside the <a href=\"https:\/\/mestric.com\/sl\/how-to-improve-manufacturing-efficiency-mes-tools\/\" target=\"_blank\" rel=\"noopener\">existing MES dashboard<\/a> operators already check.<\/li>\n<li><strong>Closed-loop extension (ongoing).<\/strong> Once trust is established, extend to automatic adjustments on select, well-understood parameters.<\/li>\n<\/ol>\n<p>Each phase needs a gate: a data quality gate before modelling starts, a baseline accuracy gate before the pilot goes live, and a safety gate before any closed-loop action touches equipment automatically. Assign a data engineer for pipeline work, an automation engineer for PLC integration, a process engineer or line manager who understands the physical process, a QA lead for label accuracy, and an IT\/OT liaison to keep both worlds talking. Present every prediction as a recommendation for a human to check first: the Talum research itself treated predictions as triggers for operator review, not unsupervised machine control, and that framing earns operator buy-in faster than any accuracy figure will.<\/p>\n<h2 id=\"where-scrap-prediction-models-go-wrong\">Where scrap prediction models go wrong<\/h2>\n<p>Most failed pilots die from data problems, not algorithm problems. Sensor drift, where a calibration slips slowly over months, can quietly poison months of training data before anyone notices the pattern has shifted.<\/p>\n<p>Watch for these specific failure modes:<\/p>\n<ul>\n<li>Poor label quality, where \u201cscrap\u201d was recorded inconsistently across shifts or inspectors.<\/li>\n<li>Concept drift, where the relationship between process parameters and defects changes as material suppliers or product mixes change.<\/li>\n<li>Overfitting to one product variant, so the model fails the moment the line switches to a different part.<\/li>\n<li>Sensor resolution too coarse to catch the micro-fluctuations that actually cause defects.<\/li>\n<\/ul>\n<p>Retrain on a fixed schedule rather than waiting for performance to visibly degrade, and monitor prediction distributions for drift between retraining cycles. Set conservative thresholds early and loosen them only as operator trust grows, otherwise alert fatigue kills adoption faster than any technical flaw. When an early warning fires, pair it with a targeted mechanical check, a press force balance or guide wear inspection, because many real-world defects trace back to mechanical interactions a sensor alone won\u2019t catch.<\/p>\n<p><strong>Pro Tip:<\/strong> <em>An alert that fires correctly but too often is functionally the same as an alert that never fires. Tune for precision on the alerts operators actually act on.<\/em><\/p>\n<h3 id=\"a-practitioners-note-on-what-actually-works\">A practitioner\u2019s note on what actually works<\/h3>\n<p>The models rarely fail on the shop floor. The rollouts fail when nobody trusts the alert enough to act on it. A rapid data audit that flags gaps in week one saves months of wasted model tuning later, and operators who help label early scrap events end up defending the system to their own colleagues.<\/p>\n<h2 id=\"how-mestric-turns-predictions-into-shop-floor-action\">How Mestric turns predictions into shop floor action<\/h2>\n<p>A model sitting in a data scientist\u2019s notebook doesn\u2019t stop scrap. Mestric is built to close that gap: it connects directly to your machinery, pulls PLC signals in real time, and displays <a href=\"https:\/\/mestric.com\/sl\/quality-monitoring-role-manufacturing-excellence\/\" target=\"_blank\" rel=\"noopener\">quality KPIs<\/a> alongside AI-driven alerts your line supervisors can actually act on during a shift, not after it.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/csuxjmfbwmkxiegfpljm.supabase.co\/storage\/v1\/object\/public\/blog-images\/organization-16618\/1771068359718_mestric.jpg\" alt=\"Mestric\"><\/p>\n<p>Three things change once predictive analytics runs inside your MES rather than beside it:<\/p>\n<ul>\n<li>Defects get flagged during the cycle that caused them, not during next week\u2019s quality review.<\/li>\n<li>Fewer scrap events reach final inspection because operators intervene earlier.<\/li>\n<li>Every KPI, from scrap rate to material cost saved, sits in one dashboard you can show finance without a translation layer.<\/li>\n<\/ul>\n<p>If you want to see how <a href=\"https:\/\/mestric.com\/sl\/production-quality-monitoring-manufacturing\/\" target=\"_blank\" rel=\"noopener\">connected machinery<\/a> and real-time analytics work together on an actual production line, book a Mestric demonstration and bring your own process data to the session.<\/p>\n<h2 id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n<p><strong>Can small manufacturers use napovedovanje izmeta without a data science team?<\/strong><br \/>\nYes, provided your MES already captures PLC signals. A tree-based baseline model needs less expertise than a neural network, and many MES platforms now package the modelling layer directly into the dashboard.<\/p>\n<p><strong>How much historical data do you need before training a model?<\/strong><br \/>\nIt depends on scrap frequency rather than calendar time. If defects are rare, you need enough cycles to capture dozens of scrap events, not just months of general production data.<\/p>\n<p><strong>Does napoved izmeta replace manual quality inspection?<\/strong><br \/>\nNo. The Talum research and industry practice both treat predictions as a trigger for operator review, not a replacement for physical inspection or mechanical checks.<\/p>\n<p><strong>What is the realistic timeline from pilot to full production use?<\/strong><br \/>\nExpect roughly three to five months from data audit to a working single-line pilot, with closed-loop automation only after that pilot proves reliable over multiple production runs.<\/p>\n<p><strong>Which excrement prediction methods, sorry, which scrap prediction methods handle multiple product variants best?<\/strong><br \/>\nEnsemble models like XGBoost or CatBoost generally cope better with product mix changes than a single decision tree, provided the training data includes examples from each variant.<\/p>\n<h2 id=\"sources\">Sources<\/h2>\n<ul>\n<li><a href=\"http:\/\/hdl.handle.net\/20.500.12556\/DKUM-90015\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Razvoj napovednih modelov z uporabo strojnega u\u010denja za zmanj\u0161anje izmeta v proizvodnji podjetja Talum, d. d. (master\u2019s thesis)<\/a><\/li>\n<li><a href=\"https:\/\/www.3tav.si\/storitve-in-resitve\/informacijska-podpora-proizvodnje-industrija-4-0\/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Informacijska podpora proizvodnje (Industrija 4.0) \u2014 3 TAV<\/a><\/li>\n<\/ul>\n<h2 id=\"recommended\">Recommended<\/h2>\n<ul>\n<li><a href=\"https:\/\/mestric.com\/sl\/role-of-machine-learning-in-factories\/\" target=\"_blank\" rel=\"noopener\">Machine learning in factories: a practical 2026 guide<\/a><\/li>\n<li><a href=\"https:\/\/mestric.com\/sl\/vodic-za-upravljanje-sprememb-v-proizvodnih-podjetjih\/\" target=\"_blank\" rel=\"noopener\">Vodi\u010d za upravljanje sprememb v proizvodnih podjetjih<\/a><\/li>\n<li><a href=\"https:\/\/mestric.com\/sl\/improve-production-efficiency-data-driven-manufacturing-2026\/\" target=\"_blank\" rel=\"noopener\">How to improve production efficiency with data in 2026<\/a><\/li>\n<li><a href=\"https:\/\/mestric.com\/sl\/prednosti-napovedne-analitike-v-proizvodnji-2026\/\" target=\"_blank\" rel=\"noopener\">Prednosti napovedne analitike v proizvodnji 2026<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Learn how to predict scrap with machine learning in manufacturing. Transform your production cycles and reduce defects with actionable insights.<\/p>","protected":false},"author":1,"featured_media":1406,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1404","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn"],"acf":[],"_links":{"self":[{"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/posts\/1404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/comments?post=1404"}],"version-history":[{"count":1,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"predecessor-version":[{"id":1405,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/posts\/1404\/revisions\/1405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/media\/1406"}],"wp:attachment":[{"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mestric.com\/sl\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}