The present disclosure relates generally to the field of machine learning model evaluation, and more particularly to evaluating surrogate machine learning models.
Machine learning models and neural networks are used with increasing frequency. Machine learning models may be used for a wide variety of applications, such as “reading” handwritten documents, making online shopping recommendations, generating dynamic navigation routes that take into account historical traffic density, etc.
Embodiments of the present disclosure include a method, computer program product, and system for evaluating machine learning model quality.
A first machine learning model processes a set of inputs to generate a first set of results. Based on that first set of results, a quality control range is calculated. A second machine learning model calculates a mean accuracy of a second set of results, based on the set of inputs. A determination of whether the mean accuracy of the second set of results is within the quality control range is made, and a user is notified of that determination.
The above summary is not intended to describe each illustrated embodiment or every implementation of the present disclosure.
The drawings included in the present disclosure are incorporated into, and form part of, the specification. They illustrate embodiments of the present disclosure and, along with the description, serve to explain the principles of the disclosure. The drawings are only illustrative of typical embodiments and do not limit the disclosure.
While the embodiments described herein are amenable to various modifications and alternative forms, specifics thereof have been shown by way of example in the drawings and will be described in detail. It should be understood, however, that the particular embodiments described are not to be taken in a limiting sense. On the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the disclosure.
Aspects of the present disclosure relate generally to the field of machine learning model evaluation, and more particularly to evaluating surrogate machine learning models. While the present disclosure is not necessarily limited to such applications, various aspects of the disclosure may be appreciated through a discussion of various examples using this context.
Predicting the outcome of a machine learning model may, in some instance, be performed using statistical analyses. However, when the complexity of a machine learning model increases, it may be more sensible to create a second machine learning model, or a surrogate machine learning model, to predict the accuracy of the original machine learning model. Determining whether the surrogate model's prediction is accurate may benefit the original model, and it may allow an administrator to correct any “drift” that may occur in the surrogate model.
Test data (e.g., input data for an original machine learning model) or feedback data (e.g., data derived from the results of the original machine learning model that may be used to adjust or improve the model) may be processed by an original machine learning model and used to calculate metrics related to the performance of the original machine learning model. For example, a baseline margin for accuracy may be developed by determining an average of a set of results, and further calculating an upper and lower limit to determine acceptable parameters for the baseline accuracy. In some embodiments, statistical analyses may be used to derive these parameters/limits (e.g., using standard deviation techniques, ANOVA (analysis of variance), ANCOVA (analysis of co-variance), etc.), or these parameters may be predetermined.
When evaluating the prediction of a surrogate model, the baseline margin for accuracy may be used to determine whether the prediction is accurate (e.g., whether the prediction falls within the acceptable accuracy limits), or whether the surrogate model may be suffering from systematic errors or random errors.
If the results/prediction from the surrogate model begin to “drift” (e.g., the surrogate model's prediction falls outside the upper/lower limits), then retraining data (e.g., feedback data from the original model) may be used to calibrate the surrogate model and bring it back into control.
Referring now to
In some embodiments, example computing environment 100 may include a user interface 105, original model 110, surrogate model 115, metrics calculator 120, and QC chart generator 130. In some embodiments, user interface 105 may include, for example, a smartphone, a tablet, a desktop computing system, or other computing device with a touchscreen, mouse and keyboard, visual display, etc. wherewith a user may input commands and receive outputs from the computing system.
User interface 105 may be used by a user to input data into original model 110 and/or surrogate model 115. Original model 110 may be implemented using a neural network, such as the neural network described in
The results output from original model 110 may, in addition to being distributed for their main purpose, sent to metrics calculator 120. In some embodiments, metrics calculator 120 may include an upper limit calculator 123, a lower limit calculator 125, and a range calculator 127. Metrics calculator 120 may gather batches of results (“a1, a2, a3 . . . an, where ‘a’ represents a single batch”) and employ upper limit calculator 123, lower limit calculator 125, and range calculator 127 to generate the upper limit, lower limit, and range, respectively, of a quality control (QC) control chart for evaluating the accuracy of surrogate model 115.
Metrics calculator 120 may employ functions, such as “average,” which calculates a mean on a provided collection (e.g., a1, . . . an); “max,” which selects a maximum value in a provided collection; and “min,” which selects a minimum value in a provided collection.
In some embodiments, range calculator 127 may calculate a range (“R”) for a QC chart according to: R=max(a1, . . . , an)−min(a1, . . . , an). In some embodiments, the range (e.g., a quality control range) may include a logistical distance between a maximum and a minimum of the provided collection.
In some embodiments, upper limit calculator 123 may calculate an upper limit for a QC chart according to: average(a1, . . . , an)+R*A2. A2 may be a normalizing constant (e.g., a control limits factor) derived according to the number of batches in a provided collection, or it may be a predetermined value assigned by a user or an organization.
In some embodiments, lower limit calculator 125 may calculate a lower limit for a QC chart according to: average(a1, . . . , an)−R*A2.
Once metrics calculator 120 has generated the range, upper limit, and lower limit (e.g., “QC chart parameters”), the information/data may be passed to QC chart generator 130.
Surrogate model 115 may also be implemented using a neural network, such as the neural network described in
In some embodiments, surrogate model 115 may output batches of predictions to QC chart generator 130, which may calculate an aggregate average of the predictions to arrive at a mean accuracy, which may be plotted as points on a QC chart generated by QC chart generator 130. QC chart generator 130 may receive the QC chart parameters from metrics calculator 120 and the prediction from surrogate model 115 to produce a QC chart with one or more predictions plotted thereon. An example of a QC chart is given with respect to
In some embodiments, the QC chart generated by QC chart generator 130 may indicate a calibration of surrogate model 115 is needed. In such embodiments, retraining data may be sent to surrogate model 115 from original model 110. In other embodiments, retraining data may be retrieved from a repository of outputs (not shown), which stores the outputs of original model 110.
In yet other embodiments, calibration of surrogate model 115 may be performed by adjusting a weight and/or a bias of one or more neural network edges within surrogate model 115 such that the adjustment causes the output of surrogate model 115 to fall within the upper and lower limits of the QC chart generated by QC chart generator 130.
In yet other embodiments, the entire process of generating outputs from original model 110, surrogate model 115, and a subsequent calibration of surrogate model 115 may be fully automated such that no QC chart generation is necessary.
Referring now to
The example QC chart 200 illustrates 20 plotted points corresponding to the mean accuracies generated from the predictions of a surrogate model, such as surrogate model 115 of
Example QC chart 200 may, in some embodiments, be presented to a user or system administrator via user interface 105. In some embodiments, a calibration of surrogate model 115 may be performed automatically, or it may be performed in response to a command from a user or system administrator.
Referring now to
At 310, a QC range is calculated, based on the first set of results. In some embodiments, 310 may be performed by a metrics calculator substantially similar to the metrics calculator 120. In some embodiments, a QC range may include an upper limit, lower limit, and average, such as those described with regard to
At 315, a mean accuracy of a second set of results may be calculated, based on inputs to a surrogate model. In some embodiments, the mean accuracy of the second set of results may be substantially similar to the mean accuracy described with regard to
At 320, it may be determined whether the mean accuracy falls within the QC range, as described herein. This may include, for example, a determination whether the mean accuracy falls between the upper and lower limits, or outside the upper and lower limits (e.g., whether the mean accuracy is “in control” or “out of control”).
If, at 320, it is determined that the mean accuracy is in control, a user is notified of the determination at 325. This may include, in some embodiments, a notification displayed on user interface 105 or any other suitable communication to a user (e.g., a text message, e-mail, overlay onto a VR/AR enabled user device, etc.).
If, however, at 320, it is determined that the mean accuracy is out of control, the surrogate model is calibrated with the first set of results (e.g., results from the original model) at 330. In some embodiments, a calibration of the surrogate model may include using the results from the original model to adjust a weight and/or a bias of one or more edges of the neural network employed by the surrogate model. In this way, the calibration may correct a “drift” of the surrogate model to bring the prediction(s) made by the surrogate model back into control.
Inputs 402-1 through 402-m represent the inputs to neural network 400. In this embodiment, 402-1 through 402-m do not represent different inputs. Rather, 402-1 through 402-m represent the same input that is sent to each first-layer neuron (neurons 404-1 through 404-m) in neural network 400. In some embodiments, the number of inputs 402-1 through 402-m (i.e., the number represented by m) may equal (and thus be determined by) the number of first-layer neurons in the network. In other embodiments, neural network 400 may incorporate 1 or more bias neurons in the first layer, in which case the number of inputs 402-1 through 402-m may equal the number of first-layer neurons in the network minus the number of first-layer bias neurons. In some embodiments, a single input (e.g., input 402-1) may be input into the neural network. In such an embodiment, the first layer of the neural network may comprise a single neuron, which may propagate the input to the second layer of neurons.
Inputs 402-1 through 402-m may comprise one or more samples of classifiable data. For example, inputs 402-1 through 402-m may comprise 10 samples of classifiable data. In other embodiments, not all samples of classifiable data may be input into neural network 400.
Neural network 400 may comprise 5 layers of neurons (referred to as layers 404, 406, 408, 410, and 412, respectively corresponding to illustrated nodes 404-1 to 404-m, nodes 406-1 to 406-n, nodes 408-1 to 408-o, nodes 410-1 to 410-p, and node 412). In some embodiments, neural network 400 may have more than 5 layers or fewer than 5 layers. These 5 layers may each be comprised of the same number of neurons as any other layer, more neurons than any other layer, fewer neurons than any other layer, or more neurons than some layers and fewer neurons than other layers. In this embodiment, layer 412 is treated as the output layer. Layer 412 outputs a probability that a target event will occur and contains only one neuron (neuron 412). In other embodiments, layer 412 may contain more than 1 neuron. In this illustration no bias neurons are shown in neural network 400. However, in some embodiments each layer in neural network 400 may contain one or more bias neurons.
Layers 404-412 may each comprise an activation function. The activation function utilized may be, for example, a rectified linear unit (ReLU) function, a SoftPlus function, a Soft step function, a SIFT algorithm, or others. Each layer may use the same activation function, but may also transform the input or output of the layer independently of or dependent upon the activation function. For example, layer 404 may be a “dropout” layer, which may process the input of the previous layer (here, the inputs) with some neurons removed from processing. This may help to average the data, and can prevent overspecialization of a neural network to one set of data or several sets of similar data. Dropout layers may also help to prepare the data for “dense” layers. Layer 406, for example, may be a dense layer. In this example, the dense layer may process and reduce the dimensions of the feature vector (e.g., the vector portion of inputs 402-1 through 402-m) to eliminate data that is not contributing to the prediction. As a further example, layer 408 may be a “batch normalization” layer. Batch normalization may be used to normalize the outputs of the batch-normalization layer to accelerate learning in the neural network. Layer 410 may be any of a dropout, hidden, or batch-normalization layer. Note that these layers are examples. In other embodiments, any of layers 404 through 410 may be any of dropout, hidden, or batch-normalization layers. This is also true in embodiments with more layers than are illustrated here, or fewer layers.
Layer 412 is the output layer. In this embodiment, neuron 412 produces outputs 414 and 416. Outputs 414 and 416 represent complementary probabilities that a target event will or will not occur. For example, output 414 may represent the probability that a target event will occur, and output 416 may represent the probability that a target event will not occur. In some embodiments, outputs 414 and 416 may each be between 0.0 and 1.0, and may add up to 1.0. In such embodiments, a probability of 1.0 may represent a projected absolute certainty (e.g., if output 414 were 1.0, the projected chance that the target event would occur would be 100%, whereas if output 416 were 1.0, the projected chance that the target event would not occur would be 100%).
In embodiments,
In embodiments, neural network 400 may be trained/adjusted (e.g., biases and weights among nodes may be calibrated) by inputting feedback and/or input from a user to correct/force the neural network to arrive at an expected output. In embodiments, the impact of the feedback on the weights and biases may lessen over time, in order to correct for inconsistencies among user(s) and/or datasets. In embodiments, the degradation of the impact may be implemented using a half-life (e.g., the impact degrades by 50% for every time interval of X that has passed) or similar model (e.g., a quarter-life, three-quarter-life, etc.).
Referring now to
The computer system 501 may contain one or more general-purpose programmable central processing units (CPUs) 502A, 502B, 502C, and 502D, herein generically referred to as the CPU 502. In some embodiments, the computer system 501 may contain multiple processors typical of a relatively large system; however, in other embodiments the computer system 501 may alternatively be a single CPU system. Each CPU 502 may execute instructions stored in the memory subsystem 504 and may comprise one or more levels of on-board cache.
In some embodiments, the memory subsystem 504 may comprise a random-access semiconductor memory, storage device, or storage medium (either volatile or non-volatile) for storing data and programs. In some embodiments, the memory subsystem 504 may represent the entire virtual memory of the computer system 501, and may also include the virtual memory of other computer systems coupled to the computer system 501 or connected via a network. The memory subsystem 504 may be conceptually a single monolithic entity, but, in some embodiments, the memory subsystem 504 may be a more complex arrangement, such as a hierarchy of caches and other memory devices. For example, memory may exist in multiple levels of caches, and these caches may be further divided by function, so that one cache holds instructions while another holds non-instruction data, which is used by the processor or processors. Memory may be further distributed and associated with different CPUs or sets of CPUs, as is known in any of various so-called non-uniform memory access (NUMA) computer architectures. In some embodiments, the main memory or memory subsystem 504 may contain elements for control and flow of memory used by the CPU 502. This may include a memory controller 505.
Although the memory bus 503 is shown in
In some embodiments, the computer system 501 may be a multi-user mainframe computer system, a single-user system, or a server computer or similar device that has little or no direct user interface, but receives requests from other computer systems (clients). Further, in some embodiments, the computer system 501 may be implemented as a desktop computer, portable computer, laptop or notebook computer, tablet computer, pocket computer, telephone, smart phone, mobile device, or any other appropriate type of electronic device.
It is noted that
The present invention may be a system, a method, and/or a computer program product at any possible technical detail level of integration. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the Figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
The descriptions of the various embodiments of the present invention have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.