Active Learning and Novel Model Calibration Measurements for Automated Visual Inspection in Manufacturing

Quality control is a crucial activity performed by manufacturing enterprises to ensure that their products meet quality standards and avoid potential damage to the brand's reputation. The decreased cost of sensors and connectivity enabled increasing digitalization of manufacturing. In addition, artificial intelligence enables higher degrees of automation, reducing overall costs and time required for defect inspection. This research compares three active learning approaches, having single and multiple oracles, to visual inspection. Six new metrics are proposed to assess the quality of calibration without the need for ground truth. Furthermore, this research explores whether existing calibrators can improve their performance by leveraging an approximate ground truth to enlarge the calibration set. The experiments were performed on real-world data provided by Philips Consumer Lifestyle BV. Our results show that the explored active learning settings can reduce the data labeling effort by between three and four percent without detriment to the overall quality goals, considering a threshold of p=0.95. Furthermore, the results show that the proposed calibration metrics successfully capture relevant information otherwise available to metrics used up to date only through ground truth data. Therefore, the proposed metrics can be used to estimate the quality of models' probability calibration without committing to a labeling effort to obtain ground truth data.


Introduction
Quality control is one of the key parts of the manufacturing process, which comprehends inspection, testing, and identification to ensure the manufactured products comply with specific standards and specifications (Kurniati, Yeh, & Lin, 2015;Wuest, Irgens, & Thoben, 2014;Yang et al., 2020).For example, the inspection tasks aim to determine whether a specific part features assembly integrity, surface finish, and adequate geometric dimensions (Newman & Jain, 1995).In addition, product quality is key to the business since it (i) builds trust with the customers, (ii) boosts customer loyalty, and (iii) reinforces the brand reputation.
One such quality inspection activity is the visual inspection, considered a bottleneck activity in some instances (Z.Zheng, Zhang, Yu, Li, & Zhang, 2020).Visual inspection is associated with many challenges.Some visual inspections require a substantial amount of reasoning capability, visual abilities, and specialization (Newman & Jain, 1995).Furthermore, reliance on humans to perform such tasks can affect the scalability and quality of the inspection.When considering scalability, human inspection requires training inspectors to develop inspection skills, their inspection execution tends to be slower when compared to machines, they fatigue over time and can become absent at work (due to sickness or other motives) (Selvi & Nasira, 2017;Vergara-Villegas, Cruz-Sánchez, Jesús Ochoa-Domínguez, Jesús Nandayapa-Alfaro, & Flores-Abad, 2014).The quality of inspection is usually affected by the inherent subjectiveness of each human inspector, the task complexity, the job design, the working environment, the inspectors' experience, well-being, and motivation, and the management's support and communication (Cullinane, Bosak, Flood, & Demerouti, 2013;Kujawińska, Vogt, & Hamrol, 2016;See, 2012).Manual visual inspection's scalability and quality shortcomings can be addressed through an automated visual inspection.
While machine learning models can be trained to determine whether a manufactured piece is defective and do so in an unsupervised or supervised manner, no model is perfect.At least three challenges must be faced: (a) how to improve the models' discriminative capabilities over time, (b) how to calibrate the models' prediction scores into probabilities to enable the use of standardized decision rules (Silva Filho et al., 2021), and (c) how to alleviate the manual labeling effort.
This paper presents our approach to addressing these three challenges as follows.Active learning is used to enhance the classification model to address the first challenge.Pool-based and stream-based settings are compared, considering different active learning sample query strategies across five machine learning algorithms.Platt scaling, a popular probability calibration technique, addresses the second challenge.Finally, two scenarios were considered when addressing the reduction of manual labeling effort: (i) manual inspection of cases where the machine learning model does not predict with enough confidence and (ii) data labeling to acquire ground truth data for the model calibration.The first scenario was addressed by exploring the usage of multiple oracles and soft labeling to reduce the manual inspection effort.Finally, the second scenario was addressed by approximating the ground truth with models' predictions to calibrate the model.Furthermore, several novel metrics to measure the quality of calibration were proposed.The results confirm that they can measure the quality of such calibration without needing a ground truth.
This work extends our previous research described in paper Streaming Machine Learning and Online Active Learning for Automated Visual Inspection (Rožanec, Trajkova, Dam, Fortuna, & Mladenić, 2022).In that paper, research was performed to measure the impact of active learning on streaming algorithms.This paper explored batch and online settings along with different active learning policies and oracles.This research overcomes some of the shortcomings of the previous research.First, it does not only consider the models' uncertainty to derive data instances to oracles but rather a certain quality acceptance level.Second, it calibrates the machine learning models so that through probability calibration, they issue probabilities rather than predictive scores.Third, it increases the amount of data devoted to active learning to ensure more meaningful results.Finally, it focuses on batch machine learning models (which achieve a greater discriminative performance) and studies them in batch and streaming active learning settings.In addition to the abovementioned items, multiple metrics were developed to assess the calibration quality of a calibrator.The metrics overcome some shortcomings of widely adopted metrics and enable measuring calibration quality when no ground truth is available.The research was performed on a real-world use case with images provided by Philips Consumer Lifestyle BV corporation.The dataset comprises images regarding the printed logo on manufactured shavers.The images are classified into three classes: good prints, double prints, and interrupted prints.
The Area Under the Receiver Operating Characteristic Curve (AUC ROC, see (Bradley, 1997)) was used to evaluate the discriminative capability of the classification models.AUC ROC estimates the quality of the model for all possible cutting thresholds.It is invariant to a priori class probabilities and, therefore, suitable for classification tasks with strong class imbalance.Furthermore, given that the models were evaluated in a multiclass setting, the AUC ROC was computed with a one-vs-rest strategy.Furthermore, the performance of multiple probability calibration approaches was measured through the Estimated Calibration Error (ECE) and several novel metrics proposed in this research.
This paper is organized as follows.Section 2 describes the current state of the art and related works.Section 3 describes novel metrics proposed for probability calibration and how calibration methods can leverage approximate ground truth to enlarge the calibration set.The main novelty regarding the proposed probabilities calibration metrics is the ability to measure calibration quality without needing a ground truth.Section 4 describes the use case, while Section 5 provides a detailed description of the methodology followed.Section 6 describes the experiments performed, while Section 7 presents and discusses the results obtained.Finally, Section 8 presents the conclusions and outlines future work.

Related Work
This section provides a short overview of three topics relevant to this research: (i) the use of machine learning for quality inspection, (ii) active learning, and (iii) probabilities calibration.The following subsections are devoted to each of them.

Machine Learning for Quality Inspection
A comprehensive and reliable quality inspection is often indispensable to the manufacturing process, and high inspection volumes turn inspection processes into bottlenecks (Schmitt, Bönig, Borggräfe, Beitinger, & Deuse, 2020).Machine Learning has been recognized as a technology that can drive the automation of quality inspection tasks in the industry.Multiple authors report applying it for early prediction of manufacturing outcomes, which can help drop a product that will not meet quality expectations and avoid investment in expensive manufacturing stages.Furthermore, similar predictions can be used to determine whether the product can be repaired and therefore avoid either throwing away a piece to which the manufacturing process was invested or selling a defective piece with the corresponding costs for the company (Weiss et al., 2016).Automated visual inspection refers to image processing techniques for quality control, usually applied in the production line of manufacturing industries (Beltrán-González et al., 2020).It has been successfully applied to determine the end quality of the products.It provides many advantages, such as performing non-contact inspection that is not affected by the type of target, surface, or ambient conditions (e.g., temperature) (Park, Kwon, Park, & Kang, 2016).In addition, visual inspection systems can perform multiple tasks simultaneously, such as object, texture, or shape classification and defect segmentation, among other inspections.Nevertheless, automated visual inspection is a challenging task given that collecting the dataset is usually expensive, and the methods developed for that purpose are dataset-dependent (R. Ren, Hung, & Tan, 2017).(Jian, Gao, & Ao, 2017) considers three approaches that exist toward automated visual inspection: (a) classification, (b) background reconstruction and removal (reconstruct and remove background to find defects in the residual image), and (c) template reference (comparing a template image with a test image).(Tsai & Lai, 2008) describe how TFT-LCD panels and LCD color filters were inspected by comparing surface segments containing complex periodic patterns.(Kang & Liu, 2005) successfully applied feed-forward networks to detect surface defects on cold-rolled strips.In the same line, (Yun, Choi, Jeon, Park, & Kim, 2014) proposed a novel defect detection algorithm for steel wire rods produced by the hot rolling process.(Valavanis & Kosmopoulos, 2010) compared multiple machine learning models (Support Vector Machine, Neural Network, and K-nearest neighbors (kNN)) on defect detection in weld images.(Park et al., 2016) developed a Convolutional Neural Network (CNN) and compared it to multiple models (particle swarm optimization-imperialist competitive algorithm, Gabor-filter, and random forest with variance-of-variance features) to find defects on silicon wafers, solid paint, pearl paint, fabric, stone, and wood surfaces.Multiple authors developed machine learning algorithms for visual inspection leveraging feature extraction from pre-trained models (N.Cohen & Hoshen, 2020;Jezek, Jonak, Burget, Dvorak, & Skotak, 2021;Li, Sohn, Yoon, & Pfister, 2021).While much research was devoted to supervised machine learning methods, unsupervised defect detection was explored by many authors, who explored using Fourier transforms to remove regularities and highlight irregularities (defects) (Aiger & Talbot, 2012) or employed autoencoders to find how a reference image differs from the expected pattern (Mujeeb, Dai, Erdt, & Sourin, 2018;Zavrtanik, Kristan, & Skočaj, 2021).

Active Learning
Active learning is a subfield of machine learning that studies how an active learner can best identify informative unlabeled instances and requests their labels from some oracle.Typical scenarios involve (i) membership query synthesis (a synthetic data instance is generated), (ii) stream-based selective sampling (the unlabeled instances are drawn one at a time, and a decision is made whether a label is requested or the sample is discarded), and (iii) pool-based selective sampling (queries samples from a pool of unlabeled data).Among the frequently used querying strategies are (i) uncertainty sampling (select an unlabeled sample with the highest uncertainty, given a certain metric, or machine-learning model (Lewis & Catlett, 1994)), or (ii) queryby-committee (retrieve the unlabeled sample with the highest disagreement between a set of forecasting models (committee) (Cohn, Atlas, & Ladner, 1994;Settles, 2009)) can be found.More recently, new scenarios have been proposed leveraging reinforcement learning, where an agent learns to select images based on their similarity, and rewards obtained are based on the oracle's feedback (P.Ren et al., 2020).In addition, it has been demonstrated that ensemblebased active learning can effectively counteract class imbalance through newly labeled image acquisition (Beluch, Genewein, Nürnberger, & Köhler, 2018).While active learning reduces the required volume of labeled images, it is also essential to consider that it can produce an incomplete ground truth by missing the annotations of defective parts classified as false negatives and not queried by the active learning strategy (Cordier, Das, & Gutierrez, 2021).
Active learning was successfully applied in manufacturing, but scientific literature remains scarce on this domain (Meng et al., 2020).Some use cases include the automatic optical inspection of printed circuit boards (Dai, Mujeeb, Erdt, & Sourin, 2018), media news recommendation in a demand forecasting setting (Zajec et al., 2021), and the identification of the local displacement between two layers on a chip in the semiconductor industry (van Garderen, 2018).

Probabilities calibration
Probabilities are defined as a generalization of predicate calculus where given a truth value of a formula given the evidence (degree of plausibility) is generalized to a real number between zero and one (Cheeseman, 1985).Many machine learning models output prediction scores which cannot be directly interpreted as probabilities.Therefore, such models can be calibrated (mapped to a known scale with known properties), ensuring the prediction scores are converted to probabilities.Probability calibration aims to provide reliable estimates of the true probability that a sample is a member of a class of interest.Such calibration (a) usually does not decrease the classification accuracy, (b) enables using provides thresholds on the decision rules and therefore minimizes the classification error, (c) ensures decision rules and their maximum posterior probability are fully justified from the theoretical point of view, (d) can be easily adapted to changes in class and cost distributions, and therefore (e) is key to decision-making tasks (I.Cohen & Goldszmidt, 2004;Song et al., 2021).
The k-class probabilistic classifier is considered well-calibrated if the predicted k-dimensional probability vector has a distribution that approximates the distribution of the test instances.A different criterion is introduced with confidence calibration, aiming only to calibrate the classifier's most likely predicted class (Song et al., 2021).
Multiple probability calibration methods have been proposed in the scientific literature.The post-hoc techniques aim to learn a calibration map for a machine-learning model based on hold-out validation data.In addition, popular calibration methods for binary classifiers include logistic calibration (Platt scaling), isotonic calibration, Beta calibration, temperature calibration, and binning calibration.
Empirical binning builds the calibration map by computing the empirical frequencies within a set of score intervals.It can therefore capture arbitrary prediction score distributions (Kumar, Liang, & Ma, 2019).Isotonic regression computes a regression assuming the uncalibrated model has a set of nondecreasing constant segments corresponding to bins of varying widths.Given its non-parametric nature, it avoids a model misfit, and due to the monotonicity assumption, it can find optimal bin edges.Nevertheless, training times and memory consumption can be high on large datasets and give sub-optimal results if the monotonicity assumption is violated.Platt scaling (J.C.Platt, 2000) aims to transform prediction scores into probabilities through a logistic regression model, considering a uniform probability vector as the target.While the implementation is straightforward and the training process is fast, it assumes the input values correspond to a real scalar space and restricts the calibration map to a sigmoid shape.Probability calibration trees evolve the concept of Platt scaling, identifying regions of the input space that lead to poor probability calibration and learning different probability calibration models for those regions, achieving better overall performance (Leathart, Frank, Holmes, & Pfahringer, 2017).Beta calibration was designed for probabilistic classifiers.It assumes that the scores of each class can be approximated with two Beta distributions and is implemented as a bivariate logistic regression.Temperature scaling uses a scalar parameter T > 0 (where T is considered the temperature) to rescale logit scores before applying a softmax function to achieve recalibrated probabilities with better spread scores between zero and one.It is frequently applied to deep learning models, where the prediction scores are frequently strongly skewed towards one or zero.Furthermore, the method can be applied to generic probabilistic models by transforming the prediction scores with a logit transform (Guo, Pleiss, Sun, & Weinberger, 2017).This enables calculating the score against a reference class and obtaining the ratio against other classes.Nevertheless, the method is not robust in capturing epistemic uncertainty (Ovadia et al., 2019).Finally, the concept of temperature scaling is extended in vector scaling, which considers that a different temperature for each class can be specified, and matrix scaling, which considers a matrix and intercept parameters (Song et al., 2021).
Several metrics and methods were proposed to assess the quality of the calibration.Reliability diagrams plot the observed relative frequency of predicted scores against their values.They, therefore, enable to quickly assess whether the event happens with a relative frequency consistent with the forecasted value (Bröcker & Smith, 2007).On the other hand, validity plots aim to convey the bin frequencies for every bin and therefore provide valuable information regarding miscalibration bounds (Gupta & Ramdas, 2021).Among the metrics, the binary ECE measures the average gap across all bins in a reliability diagram, weighted by the number of instances in each bin, considering the labeled samples of a test set.In the same line, the binary Maximum Calibration Error computes the maximum gap across all bins in a reliability diagram.The Confidence Estimated Calibration Error measures the average difference between accuracy and average confidence across all bins in a confidence reliability diagram, weighted by the number of instances per bin.A different approach is followed by the Brier score, which measures the mean squared difference between the predicted probability and the actual outcome.While the ECE metric is widely accepted, research has shown is subject to shortcomings (Nixon, Dusenberry, Zhang, Jerfel, & Tran, 2019;Posocco & Bonnefoy, 2021).One of such shortcomings is that when using fixed calibration ranges, some bins contain most of the data, resulting in the metric's decreased sharpness.Furthermore, ECE is measured across non-empty bins, failing to account for the overall distribution of positives across the mean predicted probabilities.Measuring probabilistic calibration remains a challenge (Nixon et al., 2019).
While many probability calibration methods and metrics have been developed, most of them were conceived considering probability calibration must be done based on some ground truth.Nevertheless, acquiring data for such ground truth is expensive (requires labeled instances), limits the amount of data seen to build such a probability calibration map, and therefore introduces inaccuracies due to the inherent characteristics of the sample.To address this void, this research proposes labeling each predicted data instance according to the predicted class with the highest score or most likely class if the highest predicted scores are equal.Assuming the classifier could perform with perfect discriminative power in the best case, such labels would equal the ground truth.Furthermore, this research proposes metrics to assess the discrepancy between an ideal probability calibration scenario and the calibrated classifier to measure the quality of probability calibration achieved.By doing so, the calibrators' quality over time can be measured without needing any data labeling for such an assessment.Furthermore, it enables exploring approximate model's probabilities calibration, training a calibrator from a ground truth approximated with predicted labels.This idea is further explained and developed in Section 3.

Towards Approximate Probability Calibration Models
This research proposes metrics and an approach to calibrating machine learning prediction scores to probabilities by using a ground truth approximation.
The approach considers building an initial calibration set, as it is common practice for probability calibration methods.A calibration set has (a) several prediction scores used to perform the probability calibration and (b) the ground truth labels for the corresponding data instances.Using both, a mapping is created between the prediction scores and the probability of a class outcome.Nevertheless, the limited amount of data in the calibration set can impact the fidelity of the calibration.In particular, the distribution of predictive scores between the calibration set and the predictions performed in a production environment can differ.
The final prediction of a calibrated model has at least two sources of error: (a) the classification model, which does not perfectly predict the target class, and (b) the probability calibration technique, which does not produce a perfect probabilistic mapping between the predicted scores and the target class.While metrics and plots exist to assess the quality of the probability calibration, such means require a ground truth to evaluate the probability calibration.While the requirement for a ground truth allows for an exact estimate of the classifier on that particular hold-out data, it has at least two drawbacks: (i) it requires labeling a certain amount of data to perform the evaluation, and (ii) such data may not be representative of current or future data distributions observed in a production environment.

Intuitions Behind a Calibration Without a Ground Truth
Current scientific literature considers the quality of a model calibration can be measured by comparing, given a fixed class, whether the fraction of positives does correspond to the predicted mean probability of a given classifier.The fraction of positives empirically measures the likelihood of positive class events for the class under consideration within a specific mean probability range (bin).In a well-calibrated model, the likelihood of the occurrence of positive class events in a particular bin for the class under consideration matches the mean predicted probability, revealing a linear relationship between the mean predicted probability and the likelihood of the occurrence in that bin of the positive class event for the class considered (see Fig. 1).Furthermore, a perfectly calibrated classifier is only possible for a binary classification problem with no class imbalance.Class imbalance or multiple classes introduce distortions regarding the frequency with which the positive class is observed within a given predicted mean probability range compared to the frequency with the other events occurring within that mean probability range.For a well-calibrated classifier, each of the predicted classes is expected to behave as shown in Fig. 1.Therefore, while class imbalance or a multi-class setting can introduce distortions to the histogram's shape, the distance to the ideal case could be measured by comparing the histogram shape of a perfectly calibrated model for a given class and the shape of the histogram in the realworld case under consideration.To estimate how close the histograms are from each other, optimal transport is used (Peyré, Cuturi, et al., 2019;Villani, 2009).In particular, the Wasserstein distance measures the distance between the two histogram distributions.Nevertheless, the fraction of positives for a given class cannot be computed when no ground truth is available.Therefore, we reframe the problem so that the goodness of a model calibration can be evaluated even without considering a ground truth.
Considering the information available in Fig. 1 and a particular class j, and considering each prediction regarding class j an event x, we are interested on two types of events: E 1 = {x corresponds to bin i}, and E 2 = {x corresponds to class j}.Furthermore, we are interested in calibrating the model so that the resulting score indicates p j (E 2 |E 1 ).

Intuition 1: Considering a perfectly calibrated classifier
Let us consider the case of a perfectly calibrated classifier.Given a perfectly calibrated classifier, the fraction of positives for a given class must match the mean predicted probability.The fraction of positives within a certain bin i can be considered the empirical computation of p j (E 2 |E 1 ).E 1 and E 2 are not independent events, given the probability of belonging to class j should be higher in bins representing a higher mean predicted probability.Therefore, p j (E 2 |E 1 ) = pj (E2∩E1) pj (E1) .Considering a balanced binary classification problem, the number of predictions issued for each mean predicted probability range must be equal to verify the symmetry regarding the fraction of positives observed in the mean probability ranges for both classes.Fluctuations regarding the fraction of positives observed in the mean predicted probability ranges translate into an unequal number of predictions in them and directly impact the quality of the calibration.Based on this observation, given the abovementioned equation, ) is constant, and can be empirically computed as p j (E 1 ) = 1 # of bins .The number of predictions for a given class j is computed as the count of predictions where the highest predicted value was issued for that class j.While p j (E 2 ∩E 1 ) cannot be computed without ground truth, the expected values that must be satisfied for each bin for p j (E 2 |E 1 ) are known.Therefore, we envision at least two ways to estimate the mismatch between the ideal case and the case under consideration.First, the value of p j (E 2 ∩ E 1 ) can be inferred based on the expected p j (E 2 |E 1 ) for a particular bin and the empirical computation of p j (E 1 ) to then measure the Wasserstein distance between the resulting distributions.Second, it could be estimated by only considering p j (E 1 ) and measuring the Wasserstein distance between the ideal distribution (an equal number of predictions per mean predicted probability range) and the distribution of predictions obtained from the calibrated classifier under consideration (number of predictions per bin, that are empirically measured -usually the amount of predictions is not equal across bins given the calibrated classifier's imperfection)).Each class's calibration quality could be estimated in both cases by comparing two histograms: the ideal case and the calibration model under consideration.The distance between both distributions computes measures how far the particular calibrator is from a perfectly calibrated case.
While the case above was demonstrated for a balanced binary classification problem, it approximately holds for multiclass settings and cases with class imbalance.In these scenarios, we aim to calibrate each class as perfectly as possible, even though a perfect calibration cannot be achieved.Nevertheless, how well-calibrated each class is against the ideal case can still be assessed by comparing the distributions described above.

Intuition 2: Considering a perfect classifier
Let us consider the case of a perfect classifier.Given a perfect classifier, the prediction equals the ground truth regarding a positive class event for the class under consideration.Therefore, two scenarios are considered: (a) degrade the classifiers' performance to achieve a calibrated classifier, or (b) spread the predicted values within a specific range so that they emulate particular calibration.It must be noted that while (a) can still satisfy the definition of probability considered for calibration, (b) does not.
For (a), the classifier's performance must be degraded due to the inherent definition of probabilities used in this problem: the calibration model will ensure a proportion of positive events regarding a class given a mean predicted probability bin.Therefore, given n = number of classes, the highest predicted value for each class will not issue only data instances of that class above 1/n.Furthermore, some cases will be lost under the 1/n threshold.can be considered.It is known that for a perfect classifier, the following is true: p j (E 2 ) = 0 or p j (E 2 ) = 1.Furthermore, E 1 and E 2 can be considered dependent events, given p j (E 2 ) = 0 for bins below a certain threshold, and p j (E 2 ) = 1 otherwise (see Fig. 2).In addition, the mean predicted probability would not match the fraction of positives, given the classifier is perfect: each prediction perfectly identifies the target class.Therefore, this scenario per se violates the idea behind probabilies calibration.Nevertheless, the best approximation towards Fig. 1 would be to achieve an increasing number of predictions per mean predicted probability range (histogram bin) for a specific class.To avoid degrading the models' discriminative power, such a mapping function will not issue scores below 1/n, where n = number of classes.

From Intuitions to Approximate Calibrators
To perform model calibration, a function that can map the predictive scores of a machine-learning model to probability scores is required.Ideally, such probability scores would indicate p j (E 2 |E 1 ).When no ground truth is available, the intuitions described above can be considered to reproduce some scenarios where the resulting probability score distribution can be compared against an ideal probability score distribution.Therefore, we consider labeling the predicted data instances with the class with the highest predicted score.In case two classes hold equal scores, we decide on the most probable one based on the class imbalance observed in the train test.For balanced datasets, the class can be assigned randomly, given no other information exists to guide the decision.The more perfect the classification model, the closer will the assigned labels be to the ground truth.Given data instances with predicted scores and assigned labels, a calibrator can be fitted to map the classifier's output to a calibrated probability.

From Intuitions to Metrics
In subsections 3.2.1 and 3.2.2, the cases of a perfectly calibrated model and a perfect classifier were considered.While in the case of a perfect classifier, a ground truth is not needed (the predicted labels equal the ground truth), non-perfect classifiers approximate such a ground truth to a certain degree (measured as the classifiers' performance).Furthermore, regardless of the calibration technique, it was shown that a certain correlation between the calibration quality and the calibration score distribution exists.In particular, it was shown that for each class k a histogram could be computed showing (a) the number of predictions per bin and (b) the proportion of positive class occurrences per mean predicted probability bin.Both could then be compared against ideal cases.A certain advantage of (a) is that it does not require ground truth or ground truth approximation to determine whether some bins are under or over-assigned.While such an imbalance certainly signals a calibration error, the histogram lack information regarding the composition of each bin.In particular, they provide no information on whether the positive class occurrences increase according to the value of the mean predicted probability bin.This can only be measured in (b), comparing all cases against an ideal calibration histogram.For multiclass problems, each class could be compared against such a histogram, and the resulting scores averaged.
To estimate how close a probability calibration method is w.r.t. the target (ideal) histogram, optimal transport is used (Peyré et al., 2019;Villani, 2009).In particular, the Wasserstein distance between two histogram distributions is considered: a histogram constructed with the calibrator scores and a histogram corresponding to the ideal scenario.Based on them, we propose a metric that can be used to estimate the quality of calibration of any calibrator given certain ground truth.We name it Probability Calibration Score (PCS -see Eq. 1).The proposed metrics issue a value between zero and one: PCS is zero when the model is not calibrated and one when the model is perfectly calibrated.Furthermore, a weighted metric variant can also be considered (wPCS -see Eq. 2), where the proportion of each class among the observed instances weights the Wasserstein distances.
is the 1-Wasserstein distance between the histogram h i and the reference histogram h ref and w i is the weight of a particular class.n indicates the number of classes under consideration.
To ensure the histograms are comparable, they are normalized ensuring that the sum of their values equals one.To ensure the Wasserstein distance remains between zero and one, the distance between both distributions is divided by the distance measured between the worst-case scenario and the reference ideal histogram (see Fig. 4) When assessing the performance of an approximate calibrated model, two errors must be taken into account: (i) the classification error, given the classifier does not perfectly predict the target class (and the ground truth is approximated with such predictions), and (ii) the probability calibration technique, which does not produce a perfect probabilistic mapping between the predicted Fig. 4: The figure illustrates two sample calibration plots: the calibration plot on the left corresponds to a calibrated classifier where all positives were assigned to a zero mean predicted probability (worst-case scenario).In contrast, the calibration plot on the right (reference histogram) corresponds to a perfectly calibrated classifier.Both calibration plots correspond to normalized cases, where the sum of the values equals one.The Wasserstein distance between the case on the left and the distribution of a Perfect Probability Calibration Model (PPCM) is the highest among possible calibration scenarios.
scores and the (approximated) target class.To measure (i), we choose the AUC ROC metric, which is not affected by the class imbalance.AUC ROC can be computed in a multiclass setting with a one-vs-rest or one-vs-one strategy.We measure it on the test set.We consider (ii) can be measured using the Wasserstein distance, comparing the ideal calibration histogram and a histogram where the proportion of positive class occurrences (given the approximate ground truth) is considered per mean predicted probability bin.
We propose two metrics, which we name Additive Probability Calibration Score (APCS -see Eq. 6) and Multiplicative Probability Calibration Score (MPCS -see Eq. 8).Both summarize the calibrated models' performance, considering the classifier's imperfection (see Eq. 3) and the calibration error incurred due to the lack of ground truth.To ensure the Wasserstein distance remains between zero and one, we compute a normalized histogram, ensuring the area of the entire histogram equals one.The proposed metrics issue a value between zero and one, and in both cases, the higher the value, the better the model.Furthermore, we also provide a weighted version of both metrics (wAPCS (see Eq. 7) and wMPCS (see Eq. 9)), which aim to weight the Wasserstein distance between the normalized histograms obtained from a calibrator and the ideal histogram with the class weights (see Eq. 4 and Eq. 5 for APCS W and wAPCS W , and Eq. 1 and Eq. 2 for MPCS and wMPCS).
APCS is zero when the model has no discriminative power and is not calibrated, and one when the model is perfectly calibrated and shows no classification error on the test set.The APCS metric is detailed in Eq. 6.
Equation 3 K is used to measure classifiers' discriminative power.AU CROC Classifiertest corresponds to the classifiers' AUC ROC measured on the test set.
Equation 4 Component for Wasserstein distance measurement between an ideal calibrator and the calibrator under consideration, as used for the APCS metric.
AP CS W = 0.5 • P CS (4) Equation 5 Component for Wasserstein distance measurement between an ideal calibrator and the calibrator under consideration, as used for the wAPCS metric.
wAP CS W = 0.5 • wP CS (5) On the other hand, MPCS and wMPCS correspond to zero when (a) the classifiers' predictive ability is no better than random guessing or (b) the Wasserstein distance between histograms is highest (equal to one).Moreover, MPCS and wMPCS correspond to one when (a) the classifiers' predictive ability is perfect, and (b) the calibration is perfect w.r.t. the target histogram h of choice.The MPCS metric is detailed in Eq. 8.For models' probability calibration, PCS, APCS, and MPCS assume an ideal reference histogram.Three histograms are presented in Fig. 5 corresponding to (a) a Perfect Probability Calibration Model (PPCM), (b) an Almost Perfect Probability Calibration Model (APPCM), and (c) Perfect Classification with Perfect Confidence (PPwPC).While only PPCM can be used for strict probability calibration, the other two reference histograms measure how far the distributions of the predicted values are from other desired distribution shapes.In particular, APPCM achieves a similar spread of predicted probabilities as PPCM but neglects the segment of predictions below 1/n (with n = number of classes), where the classifier would become suboptimal.On the other hand, PPwPC advocates for a classifier where all scores are pushed toward the highest possible score for a given class.This research only considers the PPCM reference histogram to compute the above-described metrics.

Use case
Philips Consumer Lifestyle BV in Drachten, The Netherlands, is one of Philips' biggest development and production centers in Europe.They use cutting-edge production technology to manufacture products ceaselessly.One of their improvement opportunities is related to visual inspection, where they aim to identify when the company logo is not properly printed on the manufactured products.They have multiple printing pad machines, from which the products are handled and inspected on their visual quality and removed if any error is detected.Experts estimate that a fully automated procedure would speed up the process by more than 40%.Currently, there are two defects associated with the printing quality of the logo (see Fig. 6): double prints (the whole logo is printed twice with a varying overlap degree) and interrupted prints (the logo displays small non-pigmented areas, similar to scratches).
Machine learning models can be developed to automate the visual inspection procedure (Rippel, Haumering, Brauers, & Merhof, 2021;Zavrtanik, Kristan, & Skočaj, 2022).However, given that such models are imperfect, the manual revision can be used as a fallback to inspect the products about which the uncertainty of the machine learning model exceeds a certain threshold.Such decisions can be made based on simple decision rules, quality policies, and the probability of obtaining a defective product given a particular prediction score.Furthermore, products sent for manual inspection can be prioritized using different criteria to enhance the existing defect detection machine learning model.This research explores the abovementioned capabilities through multiple experiments, building supervised models, leveraging active learning, and comparing six machine learning algorithms.Furthermore, new measures for probability calibration are explored, and experiments are executed to determine whether existing calibration techniques would benefit from enlarging the calibration set with approximate ground truth.The experiments were conducted on a dataset of 3518 labeled images, all corresponding to manufactured shavers.

Methodological Aspects to Evaluate Active Learning Strategies
Fig. 7: The methodology we followed to train and assess machine learning models and active learning scenarios.
We frame the automated defect detection as a supervised, multiclass classification problem.A ResNet-18 model (He, Zhang, Ren, & Sun, 2016) was used for feature extraction.512 values long vectors were extracted for each image obtained from the average pooling layer.To avoid overfitting, the procedure suggested by Hua, Xiong, Lowey, Suh, and Dougherty (2005) was followed by selecting the top K features, with K = √ N , where N is the number of data instances in the train set.Features' relevance was assessed considering the mutual information score, which measures any relationship between random variables.It is considered that the mutual information score is not sensitive to feature transformations if these transformations are invertible and differentiable in the feature space or preserve the order of the original elements of the feature vectors (Vergara & Estévez, 2014).
Fig. 8: A ten-fold stratified cross-validation was used.The dataset was split for four purposes: train, test, probabilities calibration, and simulate unlabeled data under an active learning setting.
To evaluate the models' and active learning scenarios' performance, a stratified k-fold cross validation (Zeng & Martinez, 2000) was applied, considering k=10 based on recommendations by Kuhn, Johnson, et al. (2013).One fold was used for testing (test set), and one for machine learning models' probabilities calibration (calibration set).Three folds were used to simulate a pool of unlabeled data for active learning (active learning set), and the rest to train the model (train set) (see Fig. 8).Samples are selected from the active learning set to be annotated by the oracle and then added to the training set, on which the models are retrained.In this research, two types of oracles were considered: (a) machine oracles, which can be imperfect, and (b) human annotators (assumed to be ideal).Five machine learning algorithms were evaluated: Gaussian Näive Bayes, CART (Classification and Regression Trees, similar to C4.5, but it does not compute rule sets), Linear SVM, kNN, and Multilayer perceptron (MLP).
To evaluate the discriminative power of the machine learning models and how it is enhanced over time through active learning, the AUC ROC metric was computed.Given the multiclass setting, the "one-vs-rest" heuristic was selected, splitting the multiclass dataset into multiple binary classification problems and computing their average, weighted by the number of true instances for each class.In addition, to assess the usefulness of the active learning approaches, the AUC ROC values obtained by evaluating the model against the test fold for the first (Q1) and last (Q4) quartiles of instances queried in an active learning setting were compared.The amount of manual work saved under each active learning setting and the soft-labeling approaches' precision were also evaluated.Through different experiments (detailed in Section 6), a visual inspection pipeline was simulated (see Fig. 9).First, a stream of images is directed toward the machine learning model trained to identify possible defects.Then, based on the prediction score, a decision is made on whether the manufactured product should remain in the production line or be deferred to manual inspection.If the product is unlikely to be defective, such a decision can be considered a label (it is considered a soft label when not made by a human annotator).The label is then persisted, adding enlarging the existing dataset.The enlarged dataset can be used to retrain the model and replace the existing one after a successful deployment.Equation 10 wECE metric definition.n indicates the number of classes under consideration.

Methodological Aspects to Evaluate Probability Calibration Metrics and Strategies
To evaluate the proposed probability calibration metrics and techniques, a similar procedure as the one described in the previous subsection was followed, avoiding the active learning step.Furthermore, a different dataset split was considered (see Fig. 10).After training the machine learning model and calibrating it with the calibration set, the non-calibrated model was used to issue a prediction for each instance in the unlabeled data set.The predicted class is then used to adjust further (train) the calibrator.While this introduces some noise, we expect that the better the classification model, the more it would benefit the calibrator, as explained in Section 3. Eleven performance metrics were measured: AUC ROC, ECE, wECE (see Eq. 10), PCS, wPCS, APCS W , wAPCS W , APCS, wAPCS, MPCS, and wMPCS.AUC ROC measures the discriminative capability of the model and provides insights into how such capability is affected by different calibration techniques.ECE evaluates the expected difference between the accuracy and confidence of a calibration model.The ECE metric was used to compare the calibration quality for the multiple calibration techniques and the newly proposed PCS, wPCS, APCS, wAPCS, MPCS, and wMPCS metrics.Furthermore, given that the newly proposed metrics were built on a similar concept as the ECE metric, we are interested in how much they capture the same information.The Kendall τ (see (Kendall, 1938)) and the Pearson correlation between ECE and the newly proposed metrics were measured.The Kendall correlation measures the ordinal association between two measured quantities.In this case, it measures to what extent both metrics increase or decrease, given the predictions for a given machine learning model and calibrators.The Pearson correlation, on the other side, was used to assess whether the correlation between metrics was linear.
The metrics were computed on the test set against the ground truth (class annotations) and the approximate ground truth (predicted classes).The results were analyzed to understand how well the metrics capture the models' performance and calibration when no ground truth is available.Furthermore, the weighted and non-weighted metrics were compared to understand how class weighting influences the final score and perception regarding the quality of the calibration.

Experimenting with Active Learning Strategies
For this research, two active learning settings were explored (pool-based and stream-based), using four distinct strategies to label the queried data instances in an active learning setting.Two strategies were used to select data from the active learning set under the pool-based active learning setting: (a) random sampling and (b) instances for which the classification model was the most uncertain.The model's uncertainty was assessed by considering the highest score for a given class for a given instance and selecting the instance with the lowest score among the scores provided for the data instances in the active learning set.In both cases, data were sampled until the set's exhaustion.Under the streaming active learning setting, a slightly different policy was used.When random sampling was used, a decision was made whether to keep or discard the instance with a probability threshold of 0.5.Under the highest uncertainty selection criteria, the prediction for each data instance was analyzed and derived to the oracles for labeling if it was below a certain confidence threshold (p=0.95 or p=0.99).
Three oracle settings were considered (see Fig. 11): (A) human labeler as the only source of truth, (B) machine oracle (classifier model) for data instances where the classifier had a high certainty, and a human labeler otherwise; and (C) machine oracle (classifier model) for data instances where the classifier had a high certainty, and requesting an additional opinion to another machine oracle when uncertain about the outcome.This second oracle queries the closest labeled image from three randomly picked images (one per class).In (C), the machine oracle issues a label only when both machine oracles are unanimous on the label; otherwise, the instance labeling is delegated to a human labeler.The decision regarding which oracle to query was based on the models' confidence regarding the outcome and a probability threshold set based on manufacturing quality policies.It was assumed that the second machine oracle in (C) is accessible at a certain cost (e.g., paid external service) and, therefore, cannot be used for every prediction.Such a service was simulated by computing the Structural Similarity Index Measure (SSIM) score over the queried image.
Eight scenarios were set up (see Table 1), and experimented with two quality thresholds (0.95 and 0.99 probability that the item corresponded to a certain class) and five machine learning models.The machine learning models were calibrated using a sigmoid model based on Platt logistic model (J.Platt et al., 1999) (see Eq. 11).Equation 11Platt classifier calibration logistic model.y i denotes the truth label, and f i denotes the uncalibrated classifier's prediction for a particular sample.A and B denote adjusted parameters when fitting the regressor.
Table 1 Proposed experiments to evaluate the best active learning setting regarding how it influences the models' learning and its impact on the manual revision workload.7 Results and Evaluation

Results and Evaluation of Active Learning Strategies
The active learning strategies were analyzed from two points of view.First, whether they contributed to better learning of the machine learning model.Second, how much manual work could be saved by adopting such strategies.For the first case, the AUC ROC was measured over time (see Table 2).In particular, the models' average performance was contrasted when they consumed data within the Q1 and Q4 of the active learning pool.The best outcomes were observed for Experiment 2 (highest uncertainty with human labeler) settings, while the second-best performance was observed for Experiment 8 (highest uncertainty, with the machine and human oracles).Overall, it was observed that the streaming setting had a better average performance when compared to the pool-based experiments, despite achieving only the second-best results with Platt scaling.Furthermore, in two cases, the machine learning model degraded its performance between Q1 and Q4.This happened for Experiment 3 (p = 0.95) and Experiment 4 (p = 0.95).
Given that (a) in both experiments, a machine oracle was used, (b) no performance decrease was observed for p = 0.99, and (c) that the same setting did not affect the streaming case, we were tempted to conclude that most likely the machine oracles mislabeled certain instances, confusing the model when retrained and therefore reducing the model's performance over time.Nevertheless, further analysis revealed a small fraction of soft-labeled data and that most cases were accurately labeled.While soft labeling was detrimental for the pool-based active learning settings, it led to superior results in a streaming setting, achieving results close to the best ones obtained across all experiments.In Table 3 we report the performance of machine learning models for Experiment 2 and compare how they performed after Q1 and Q4 of the active learning pool data was shown to them.We found that the best performance was attained by the MLP, followed by the SVM by at least 0.05 AUC ROC points.Furthermore, while the MLP increased its performance over time, the SVM slightly reduced it in Q4.No other model had a performance decrease over time.Since Experiment 2 only considered a human oracle and the annotations are accurate, the performance decrease cannot be attributed to mislabeling.Furthermore, while the model's discriminative capacity loss could be attributed to the class imbalance, we consider this improbable, given that the rest of the models could better discern among the classes over time.Finally, the CART model obtained the worst results, which lagged slightly more than 0.16 AUC ROC points compared to the best one.
As mentioned at the beginning of this section, another relevant aspect of evaluating active learning strategies is their potential to reduce data annotation efforts.This could be analyzed from two perspectives.First, whether the additional data annotations provide enough knowledge to enhance the models' performance significantly.If not, the data annotation can be avoided.Second, a strategy can be devised (e.g., a machine oracle) to reduce the manual annotation effort.In this work, we focused on the second one.Table 4 presents the results for a cut-off value of p=0.95.For p=0.99, no instances were retrieved and given to machine oracles; therefore, no analysis was performed on them.
When considering the cut-off value of 0.95, it was noticed that the Platt calibration considered a negligible number of cases for each experiment.While the quality of the annotations was high, using machine oracles would not strongly alleviate the manual labeling effort.The highest amount of soft-labeled instances corresponded to experiments with streaming settings (Experiment 7 and Experiment 8), which soft-labeled 4% and 3% of all data instances, respectively.Furthermore, 96% of samples were correctly labeled in both cases, meeting the quality threshold of p=0.95.The decrease in the amount of soft labeled samples for Experiment 8 was due to discrepancies between the machine learning model and the SSIM score.Furthermore, the best machine labeling quality was achieved when considering Oracle C (unanimous vote of two machine oracles).When contrasting with the AUC ROC results obtained for those experiments, it was observed that while Experiments 3 and 4 slightly decreased discriminative power, Experiments 7 and 8 increased their performance for at least 0.01 AUC ROC points.
Table 4 Proportion and quality of soft labeling through different settings, considering a predicted probability cut-off value of p=0.95.The task required annotating 2460 samples on average.SL (%) denotes the percentage of soft annotated data instances w.r.t. the total, SL OK (%) denotes the percentage of correctly soft annotated instances, ML SL OK (%) denotes the percentage of soft annotated data instances w.r.t. the total that would be correctly annotated considering the ML model score, SSIM SL OK (%) denotes the percentage of soft annotated data instances w.r.t. the total that would be correctly annotated considering the SSIM score.

Results and Evaluation of Probability Calibration Metrics and Techniques
The experiments performed in this research, aimed to validate whether the metrics proposed to measure the quality of a calibrator can be used to understand the performance of a calibrator even when no ground truth is available.Furthermore, it aimed to validate whether predictions on unlabeled data could enhance the calibrators' performance.The results are presented in Table 5, Table 6, and Table 7.The PCS, APCS, and MPCS (along with the weighted variants) metrics were computed considering the PPCM histogram, which denotes a perfect calibration.
To understand whether the proposed metrics can measure the calibration quality without ground truth, the Pearson and Kendall correlations were computed between the ECE, wECE, APCS W , wAPCS W , PCS, and wPCS metrics (see Table 5).While ECE and wECE are always computed considering the ground truth at the test set, PCS, APCS W , wPCS, and wAPCS W were calculated considering two cases: ground truth (golden standard) and predicted labels (approximate ground truth) at the test set.Furthermore, the correlations between the metrics were evaluated in two separate moments: after calibrating the models with the calibration set (CS) and after calibrating the models with additional samples retrieved from the unlabeled data set (CS+UD).The results show that the correlation between ECE, PCS, APCS W , wPCS, and wAPCS W metrics is consistent across all cases.Furthermore, little variation exists between the values obtained when PCS or wPCS were computed on the ground truth or the approximate ground truth.While the Pearson correlation decreases after training the calibrator with predicted labels from the unlabeled data set, the Kendall correlation grew stronger when PCS or APCS W were just averaged across classes and not weighted by the frequency of occurrence of each class.We consider the correlations moderate (Pearson correlation was measured between 0.50 and 0.61) or strong (Kendall correlation was above 0.33 and slightly below 0.40).Given the abovementioned results, we consider the PCS, wPCS, APCS W , and wAPCS W metrics adequately capture information conveyed by the ECE metric regardless of the source of truth used to measure the quality of the calibration.Therefore, we conclude that PCS, wPCS, APCS W , and wAPCS W can be used to assess the calibrators' quality when no ground truth is available.
Table 6 and Table 7, compare the calibrators across multiple metrics to assess how an approximate calibration affects their discriminative power (AUC ROC) and whether it helps to enhance the calibrators' quality (ECE, PCS, APCS, MPCS, and their weighted variants).Furthermore, Fig. 12 presents calibration plots for each calibrator for CS and CS+UD for visual assessment.
When comparing the calibrators through non-weighted metrics (see Table 6), we consider the Platt calibrator achieved the most stable performance.While the measured quality of calibration slightly decreased with the approximate calibration, it must be noticed that a higher proportion of positives was allocated at higher scores.Furthermore, while with the approximate calibration, the model's overall discriminative power slightly decreased, it remained superior against other models (even the not calibrated) by at least 0.02 AUC ROC points.The Histogram and Temperature calibrators provide an interesting case, given both had a similar initial (CS) calibration quality if measured with the ECE, PCS, APCS, or MPCS metrics.Nevertheless, the metrics at CS+UD showed discrepancies: while ECE slightly increased for the Histogram calibrator (showing a worse calibration quality), it remained the same for the Temperature calibrator.On the other hand, PCS, APCS, and MPCS decreased (signaling a worse calibration quality) for both the Histogram and Temperature calibrator.Furthermore, the decrease in the metrics' values was more pronounced for the Histogram calibrator.When visually assessing both calibrators, we found that they had a similar initial distribution (CS), but the Histogram calibrator ended up much more skewed than the Temperature calibrator at CS+UD.While the ECE metric did not capture this behavior, it was successfully summarized in the PCS, APCS, and MPCS metrics.We found the same patterns could be observed when analyzing the weighted metrics (see Table 7).
From the results above, we confirm that the proposed metrics can accurately measure the quality of calibration of a given calibrator when no ground truth is available.Furthermore, the metrics have shown to provide a more accurate measurement of the calibrators' quality than ECE, overcoming some of its shortcomings (e.g., providing a more holistic view of the distribution of positives along the mean predicted probability, taking into account empty bins).
Our research shows that tracking predictions over time did not enhance the quality of calibration for any of the methods involved (Histogram calibration, Platt calibration, or Temperature calibration).Finding accurate calibration models for probability calibration, given a lack of ground truth, remains a matter of future work.
Table 5 The results were obtained for different models and probability calibration techniques.We show Pearson and Kendall correlation coefficients when comparing the ECE, APCS W , wAPCS W , PCS, and wPCS metrics.APCS W , wAPCS W , PCS, and wPCS are measured considering the ground truth (golden standard) or approximate ground truth (predicted labels).The ECE metric is always computed considering the ground truth.CS stands for Calibration Set, while CS+UD abbreviates Calibration Set + Unlabeled Data.This work explored active learning with multiple oracles to alleviate the manual inspection of manufactured products and the labeling of inspected products.
Our active learning settings can save up to four percent of the manual inspection and data labeling load while not compromising on the quality of the outcome for a quality threshold of p=0.95.It must be noted that labeling savings depend on the machine learning model deployed, the acceptance quality levels, and the quality of the active learning machine oracles under consideration.Furthermore, multiple probability calibration techniques were compared,

Fig. 1 :
Fig.1: The figure presents two calibration plots.On the left, the calibration plot shows a perfectly calibrated calibrator (where the fraction of positives for the class under consideration equals the mean predicted probability).On the right, the same information is presented, but normalizing the values of the plot on the right to ensure the sum of their values equals one.

Fig. 2 :
Fig. 2: The figure presents two calibration plots.On the left, the calibration plot shows a perfect binary classifier, while on the right we find a perfectly calibrated binary classifier.

Fig. 3 :
Fig. 3: The figure illustrates two sample histograms: the histogram on the left corresponds to some sub-optimally calibrated classifier.In contrast, the histogram on the right (reference histogram) corresponds to a perfectly calibrated classifier.The Wasserstein distance between both histograms is the minimum distance between the existing calibration and a perfect one.The distance denotes the improvement opportunity regarding the specific calibration model to achieve a perfect calibration.

Fig. 5 :
Fig. 5: The figure illustrates three histograms that correspond to ideal cases described in this section: Perfect Probability Calibration Model (PPCM), Almost Perfect Probability Calibration Model (APPCM), and Perfect Classification with Perfect Confidence (PPwPC).

Fig. 9 :
Fig. 9: Expected visual inspection pipeline in a production setting.Multiple active learning strategies were assessed to identify which would drive the best results.

Fig. 10 :
Fig. 10: A ten-fold stratified cross-validation was used.The data was split into train set, test set, calibration set, and unlabeled data.Unlabeled data was used to simulate a stream of unlabeled data and assess whether a histogrambased calibration method without ground truth can enhance its performance over time.

Fig. 11 :
Fig. 11: Three oracle settings are explored in this research: (A) human annotator, (B) soft-labeling with classification model's outcomes for instances with high-confidence scores, and human annotator for instances where the model has low confidence; and (C) which is analogous to (B), but the machine oracle takes into account the classifier's output score and whether the predicted class matches the class with of a labeled image with the shortest distance towards the active sample.In (C), the sample is sent to manual revision if there is a class mismatch in the machine oracle.Samples are only discarded in a streaming setting.

Fig. 12 :
Fig. 12: Eight calibration plots, comparing No calibration, Histogram calibration, Platt calibration, and Temperature calibration at CS (calibrated with the calibration set (ground truth)) and CS+UD (calibrated with a calibration set and predicted labels over time).The calibration plots have been adapted, showing normalized values (their sum is one) rather than the usual fraction of positives on the dependent variable axis.The x-axis denotes the mean predicted probability for a given class.The histograms average predictions across classes and calibrated machine learning models.
In an automated visual inspection setting, a labeling effort is required to (a) label data to train and calibrate the machine learning models and (b) perform a Active Learning and Novel Model Calibration Measurements in Manufacturing manual inspection when the models cannot determine the class of a given data instance accurately.To understand how the probability calibration affects the machine learning models, the models' predictions were compared against those obtained by (a) not calibrating the model (No calibration) and calibrating the model with (b) a sigmoid model based on the Platt logistic model(Platt),

Table 2
Mean values for the mean AUC ROC computed across ten folds for five machine learning models.The results show how different active learning policies influence the models' learning over time (Q1 (first quartile) vs. Q4 (last quartile)).Two probability thresholds (0.95 and 0.99) were considered as a soft labeling cut-off.The best results are bolded, and the second-best ones are displayed in italics.

Table 3
Mean AUC ROC values computed across ten test folds for five machine learning models.The results show how the machine learning models learn over time (Q1 vs. Q4) under the Experiment 2 setting.Furthermore, we analyze if the differences were statistically significant at a p-value=0.95(DS(p=0.95)).The best results are bolded, and the second-best results are displayed in italics.

Table 6
The results were obtained for different probability calibration techniques.PCS, APCS, and MPCS are measured considering the ground truth (golden standard) or approximate ground truth (predicted labels).The AUC ROC and ECE metrics are always computed considering the ground truth.The best results are bolded.