<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Noodle.ai on Medium]]></title>
        <description><![CDATA[Stories by Noodle.ai on Medium]]></description>
        <link>https://medium.com/@noodleai?source=rss-6f8f5a0d167------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M8NkpN3DABmZf13w9k8fmA.jpeg</url>
            <title>Stories by Noodle.ai on Medium</title>
            <link>https://medium.com/@noodleai?source=rss-6f8f5a0d167------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:20:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@noodleai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deep Probabilistic Decision Learning Returns Perfect Flow to Operations]]></title>
            <link>https://noodleai.medium.com/deep-probabilistic-decision-learning-returns-perfect-flow-to-operations-c3d1d8e0f47b?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3d1d8e0f47b</guid>
            <category><![CDATA[dpdm]]></category>
            <category><![CDATA[flow-ops]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[noodle-ai]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 03:07:14 GMT</pubDate>
            <atom:updated>2021-06-13T03:07:14.464Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13KDMJD1WgfqZBpqWz8pqA.png" /></figure><p><em>By: Hyungil Ahn, SVP &amp; Chief AI Scientist, Noodle.ai</em></p><p><em>FlowOps enables optimal experience, predictions and decisions in the operations of factories and supply chains.</em></p><p>In human brains, there are three key learning functions related to how we sense, predict and decide. Findings in computational neuroscience [1, 2] suggest that different parts of brain areas play a distinct but connected role in each function. These can be equated with the three Explainable AI (XAI) engines in Noodle.ai’s FlowOps products: <strong>Sentinel</strong> (Deep Learning), <strong>Precog</strong> (Bayesian Probabilistic Learning) and <strong>Pathfinder</strong> (Reinforcement Learning).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ery4oMGRUnpMiOvM.png" /><figcaption>Exhibit 1. FlowOps’ XAI engines — Sentinel, Precog and Pathfinder — are powered by Deep Probabilistic Decision Learning.</figcaption></figure><p>The interplay between deep learning and probabilistic learning are similar to a human brain’s thinking fast and slow like in <a href="https://en.wikipedia.org/wiki/Thinking,_Fast_and_Slow">Kahneman’s System 1 and System 2</a>. System 1 is a fast, intuitive, heuristic, deterministic, differentiable, and more affective mind, whereas System 2 is a slow, deliberate, logical, probabilistic, integrating, and more cognitive mind.</p><p>Deep learning (Sentinel) enables fast, scalable, and associative pattern detections from high-dimensional, noisy and temporally correlated data, using differential optimizations on flexible functions with deterministic model parameters. In contrast, probabilistic learning (Precog) allows slow but causal model-based predictions on future observations for a controllable action and an exogenous condition at a current latent state of the dynamic process, using integrations over probabilistic latent variables to incorporate uncertainties. Reinforcement learning (Pathfinder) trains an action policy for optimizing a long-term cost function over future conditions.</p><p>That is, <strong>deep learning, probabilistic learning, and reinforcement learning,</strong> respectively, play a key role in FlowOps, equating to Data (state representation) + Model (causal predictive modeling) and Policy (policy optimization).</p><h3>What is Flow Operations (FlowOps)?</h3><p>FlowOperations, a new category of Enterprise AI® software, is well described by Noodle.ai’s CEO in his <a href="https://blog.noodle.ai/flowops-and-the-conquest-of-operations-entropy/?web=1&amp;wdLOR=c6D613AD4-8B8C-D844-8662-CBC23A4774EA">Pi Day blog for the launch of the category</a>. In it, he also defines Operations Entropy as “… the seeming randomness, unpredictability, uncertainty, and general fog that happens every day in complex factories and distribution networks. Complicating things further, entropy increases as complexity increases.” Our three XAI engines, Sentinel, Precog and Pathfinder, address entropy and are based on the following principles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U2sLwqlmq0MdbXbz.png" /><figcaption>Exhibit 2. Entropy Principles for Flow Ops</figcaption></figure><p>In general, FlowOps aims at reducing the flow (value)-at-risk or any unnecessary cost due to bad operations flows. There are a few key information-theoretic entropy principles we apply to build our FlowOps.</p><p>In <strong>Sentinel</strong>, we maximize the evidence lower bound of our model (or called the negative variational free energy) to achieve the best state representation at the equilibrium. This can be achieved by minimizing the relative entropy between our modeled state distribution and the true posterior distribution.</p><p>In <strong>Precog</strong>, we make better predictions by minimizing the cross-entropy between the actual and predictive output distributions.</p><p>In <strong>Pathfinder</strong>, we make the tradeoffs between the trained policy’s performance and robustness, similarly in the well-known exploitation and exploration tradeoffs in reinforcement learning. This is the same as balancing the cost entropy vs. the policy’s action-selection entropy. One goal of a desirable action policy is to prefer selecting actions for minimizing the mean and entropy of the long-term cost across different states and conditions. Thus, this policy can achieve high return and low risk outcomes in a dynamic environment. The other goal is to make the policy more robust in a noisy and shifting environment through randomized action selections for acquiring new data with unexplored inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P_byllpjTljgvGY5.png" /><figcaption>Exhibit 3. Noodle.ai FlowOps XAI Engines = Data + Model + Policy</figcaption></figure><p>FlowOps technology delivers breakthrough results through using the data to build a predictive model for KPIs and associated entropy, and then using the model to optimize our action policy. We use the past data to best represent the current state of the dynamic process.</p><ul><li><strong>Sentinel</strong> extracts key patterns from the past sequence of signals and compresses them into the latent state.</li><li><strong>Precog</strong> predicts what is likely to happen and why it’s happening for any given condition or action.</li><li><strong>Pathfinder</strong> uses the Precog model for what-if simulations and learns the action policy to optimize the flow-at-risk and the entropy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Swm-Z3zmxX5QfY_I.png" /><figcaption>Exhibit 4. Explainable AI (XAI): Actions, Conditions, Sensors and Targets in Deep Probabilistic Decision Machines (DPDM)</figcaption></figure><p>FlowOps solves the most representative problem for Enterprise AI in a causal setting: What would the <strong>future sensor X(t+1)</strong> and <strong>target Y(t+1)</strong> look like if we take an <strong>action A(t)</strong> in given <strong>condition C(t)</strong> for the current <strong>latent state S(t)</strong> of the process?</p><p>It is important that the <strong>latent state</strong> is a Bayesian probabilistic state so it’s being updated from the prior state distribution to the posterior state distribution after observing input-output data at each timestep. The latent state may be represented in a low-dimensional space so highly interpretable. It may capture shared and unique variances from correlated predictors to identify causal factors to generate <strong>sensor</strong> and <strong>target</strong> outputs. <strong>Actions</strong> are controllable inputs like planned supplies and productions, whereas <strong>conditions</strong> are uncontrollable inputs like SKU &amp; DC locations, Covid-influenced mobility level, weather variables, holidays and so on. Both <strong>sensors</strong> and <strong>targets</strong> are measured outputs, and they are to be predicted over the future. In particular, <strong>targets</strong> are those variables to be optimized in <strong>action</strong> planning.</p><p>We first train our deep probabilistic model (refer to my previous blog, <a href="https://blog.noodle.ai/deep-probabilistic-decision-machines-dpdm-for-building-a-causally-generative-process-model-based-action-control-in-enterprise-ai/">“Deep Probabilistic Decision Machines (DPDM) for building a causally generative process model-based action control in Enterprise AI”</a>) using the historical data &amp; knowledge, and then use it as a simulator for <strong>action</strong> planning.</p><p>We’re proud to be the leading provider in the Flow Operations category. It aligns with the Noodle.ai values. FlowOps is human-centered AI, built to minimize a human operator’s cognitive entropy and maximize the overall enterprise’s operational flow efficiency.</p><p>See Flow Operations and the breakthrough data science that fuel it, at live. Request a demo of our products for manufacturing and supply chain at <a href="https://noodle.ai/">Noodle.ai</a>.</p><h4>References:</h4><p>[1] Doya, Kenji. “What are the computations of the cerebellum, the basal ganglia and the cerebral cortex?.” Neural networks 12.7–8 (1999): 961–974.</p><p>[2] Friston, Karl, et al. “Active inference and learning.” Neuroscience &amp; Biobehavioral Reviews 68 (2016): 862–879</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3d1d8e0f47b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 3: Using Recipes to Build an ML Pipeline]]></title>
            <link>https://noodleai.medium.com/atlas-noodle-ais-machine-learning-ml-framework-part-3-using-recipes-to-build-an-ml-pipeline-5ef591634f49?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ef591634f49</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Tue, 01 Sep 2020 19:57:18 GMT</pubDate>
            <atom:updated>2020-09-02T16:30:46.696Z</atom:updated>
            <content:encoded><![CDATA[<h3>Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 3: Using Recipes to Build a ML Pipeline</h3><p><em>By </em><a href="https://www.linkedin.com/in/rupal-sonawane-02b78b8b/"><em>Rupal Sonawane</em></a><em>, co-authored with </em><a href="https://www.linkedin.com/in/prateek-mishra-33a94741/"><em>Prateek Mishra</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NO91TR5Gqa9NUMVVcAeN2A.jpeg" /></figure><p>Part 2 in this series provided an introduction about what Recipes are and the potential benefits. In this blog, we will take a deep dive into a Recipe implementation contrasting with the typical Machine Learning (ML) pipeline implementation. We recommend reading Atlas Part 1 (<a href="https://blog.noodle.ai/atlas-noodle-ai-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications/">Noodle</a> | <a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558?source=friends_link&amp;sk=1a44ad46eb483e664037d2172bdf316e">Medium</a>) and Part 2 (<a href="https://blog.noodle.ai/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-and-architecture/">Noodle</a> | <a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-architecture-bef94d41d1c9">Medium</a>) be before proceeding further.</p><p>Let’s consider a problem of anomaly detection from multi-variate time series data. Let’s say, we have one month of time series data available at a 10-millisecond granularity. The below figure shows the data fields available from some of the sensors of equipment ‘X’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/0*3M-YfJtKU_PNXEcb.png" /><figcaption>Fig. 1: Sample multivariate time series sensor data, an example of IoT data from factory production operations</figcaption></figure><p>An anomalous section of the time series is highlighted below in blue overlaid to a single sensor data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/0*pxlKnotNSXpMtUy7.png" /><figcaption>Fig. 2: Highlighted anomalous section on multiple sensors in the time series data</figcaption></figure><h3>Solving the Problem</h3><p>Here, we’ll start with a naïve solution by applying a k-means clustering based anomaly detection in which normal state of multivariate sensors is being encoded by three clusters. A new multi-variate data sample can be now assessed against these learned clusters and its deviations from these three-cluster means will form a basis to assign an anomalous score to that data points. A typical Python implementation of the above with some data preparation and k-means clustering, is provided below which will form the basis to explain the concept and potential benefits of a recipe-based implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*eFGISs1oaZaQ0Dti.png" /><figcaption>Fig. 3: Sample code for Anomaly Detection</figcaption></figure><p>During the DS development cycle, a data scientist evaluates multiple techniques and ML pipeline workflows. In the context of the above example, the following variations can be tried out to improve the anomaly detection:</p><ul><li>Evaluation of various clustering techniques such as k-means, DBScan, Gaussian mixture models.</li><li>Different data pre-processors based in the underlying data volume and velocity such as Pandas Data Preparator, Spark Data Preparator, etc.</li><li>Use of different model evaluation metrics such as: Silhouette Score, Homogeneity Index, etc.</li><li>Implementation of different workflow for model training and model inference</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fUX9gVgsCez2i7HW.png" /><figcaption>Fig. 4: Data Science experiment workflow examples</figcaption></figure><p>These variations need the implementation and execution of various experiment workflows as shown in the above figure. Let’s consider two experiments:</p><p>a) Experiment 1 highlighted by the blue arrow</p><p>b) Experiment 2 highlighted by the orange arrows</p><p>In the above code structure, when switching between Experiment 1 and Experiment 2, a developer would need to delete and rewrite chunks of code in order to execute each experiment in a cohesive way. Writing modular code is the first step to avoid this kind of deletion and to enable reusability during experimentation.</p><h3>Writing Modular Code</h3><p>We start by identifying the high level blocks which can provide the sufficient abstraction needed for us to plug the variations and build multiple experiment workflows. Here I am using 4 modules to build an abstract ML pipeline as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OpHc4h0lbgANbMeU.png" /><figcaption>Fig. 5: Breaking code portions into modules</figcaption></figure><p>The code that we have written in the notebook should now be refactored into these four modules. The modules could be classes or functions. Here we will model the code into classes. These classes will have predefined interfaces, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*5AueKBCetrDRV9yb.png" /><figcaption>Fig. 6: Python interfaces representing the modules</figcaption></figure><p>A concrete implementation of the interface Data Preparator might look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/0*cKHYx5-HCe32-FHM.png" /><figcaption>Fig. 7: Concrete implementation for interface Data Preparator</figcaption></figure><p>Once written in a modular fashion, we’re able to swap in the interfaces for concrete implementations, like Dask Data Preparator, Spark Data Preparator, Pandas Data Preparator etc. Similarly, each module may have one or more flavors, and we can mix and match any flavor of data preparator with any flavor of a trainer (clustering) and so on.</p><p>However, when we break the code into modules, it comes at a cost. Let’s look at an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*u5vVuFklrVsQnYa9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/0*R46k2iPpA5OpAsOO.png" /><figcaption>Fig. 8: Stitching the modular code blocks to create Experiment 1 &amp; Experiment 2 shown above.</figcaption></figure><p>As you can see in the code above, we are calling the respective modules for a given experiment. However there is some amount of “glue code”. This code is helping to stitch together the pipeline by making data ready for the next step. Writing the glue code is an added effort each time we want to create a working pipeline from modules. In the above simplistic example this doesn’t seem much of an effort but for real world complex pipeline, this soon starts getting out of hand. It’s also very difficult to trace the most recent version of such code as it usually lies around in the code base depending on the developer’s style of arranging. We also delete such code once we have the final version to keep the code base cleaner, regardless of whether we would need this later or not.</p><p>A lot of these issues could get addressed if there was a way to declaratively define a pipeline in such a way that no further stitching was required. That is what the recipe will give us.</p><h3>Writing a Recipe</h3><p>In the previous section, you saw two flows (Experiment 1 and Experiment 2). It’s the Recipe that will define these flows.</p><p>Recipe acts as an abstraction for the pipeline. When we write a Recipe we define which classes will be executed and in which order. A Recipe can be saved with a name and can be shared by data scientists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/0*ljoMUxJ_cXILGgzy.png" /><figcaption>Fig. 9: Example of the Experiment 1 written as a Recipe</figcaption></figure><p>The above Recipe (saved as <strong>equipment_X_AD_Recipe.json</strong>) describes part of an ML pipeline. It defines the strategy that we are using in each stage as well as the environment details. Therefore, the recipe has defined for us how the ML pipeline should be built. However, we need a way to control the behavior of the instantiated pipeline. We still need to define what configurations are needed to run the pipeline. For this we will use Configurations file. A ML pipeline is formed by the combination of a Recipe and a Configuration file.</p><p>Example of a configuration file <strong>equipment_X_config.json</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*EBLhxqB2n2snNVNv.png" /><figcaption>Fig. 10: Example of a Configuration file which uses the Recipe created above</figcaption></figure><p>A Configuration JSON file starts by defining the Recipe Id (file name of the Recipe) which will be used to instantiate the ML pipeline. This is followed by providing run time parameters for each stage of the pipeline. Named parameters such as Models, Hyperparameters, Features are used as first-class entities to enable tracking of changes. One Recipe can be used in multiple Configurations in turn enabling creation of multiple pipelines with varying configs quite easily.</p><p>Let’s say a new equipment, Equipment Y, is added and we want to create a model for that. To make this pipeline if you had to select new features while keeping the modelling technique the same then you would not need to code the pipeline again. You could create a new Configuration file <strong>equipment_Y_AD_Config.json</strong> by selecting the existing Recipe and changing values for the Feature parameter. This is where we start realizing the true power of this design and the amount of rework it reduces by encouraging developers to codify existing knowledge.</p><h3>Seamless Scaling</h3><p>One of the main motivations behind creating an abstract declarative representation for a ML pipeline was to manage the scale of execution. To run pipeline in production you would require a scalable and distributed orchestration engine which manages the scheduling and execution for you. While data scientists and ML engineers run the very same pipeline in local development environments. We observed that integrating the code required the developers to build a good understanding of the underlying orchestration engine and the deployment architecture. Most of the orchestration engines use a Directed Acyclic Graph to represent a pipeline which could be easily abstracted from the developers.</p><p>When developers create Recipes as shown above, they get a major advantage of not worrying about execution architecture or frameworks. Atlas provides support for 3 types of execution:</p><ul><li>Local development environment</li><li>Kubeflow on K8s</li><li>Airflow on K8s</li></ul><p>Recipe acts as an abstraction to enable execution and scaling on all the above environments for the developer helping them migrate from Jupyter Notebooks to training cluster to production clusters. Atlas has been battle tested to run 100s of concurrent ML pipelines in production.</p><h3>Leveraging Stages of the Recipe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UyW8-URtSDei_IVw.png" /><figcaption>Fig. 11: Combined Training + Inference Recipe Definition</figcaption></figure><p>It’s a common observation that there is a huge code overlap in Training and Inference Pipelines. We defined stages in the Recipe earlier, which can be used to mark the steps in the pipeline which should run for only inference or training, thus reducing duplication even at the Recipe level. The Recipe when instantiated would take in a runtime parameter for stage and would produce the following 2 Pipelines:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c61otMvXake4CHjK.png" /><figcaption>Fig. 12: Individual instantiated Training &amp; Inference Pipelines</figcaption></figure><h3>Recipe Management</h3><p>By creating a declarative structure for the development of a ML pipeline we get a good way to reuse existing modeling techniques and experiments, but a need arises to validate the JSON to check:</p><ul><li>Does the Recipe JSON have valid syntax?</li><li>Is the Recipe creating the same pipeline that the developer had visualized?</li><li>Are there any accidental cycles in the Pipeline graph?</li><li>Can we execute and test a Recipe + Configuration combination?</li></ul><p>We created an SDK to be able to help developers validate the Recipe and Configuration JSON against the above criteria. The sample invocation of these commands is shown in the steps below.</p><p>1. <strong>Visualization:</strong> The Recipe JSON can be visualized as a graph which depicts the execution flow of the Pipeline. Developer specifies the Recipe name to load the JSON and visualize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*ylIx6QpBFCBiNj_v.png" /></figure><p>2. <strong>Validation:</strong> The validation-util provides an ability to scan the Recipe JSON and detect errors with the JSON file syntax and logical errors that could have been introduced due to incorrect linkage of steps in the pipeline. We could also validate the entire recipe folder.</p><p><strong>Examples:</strong></p><p>If the Recipe is valid:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*Fg5hn7Ql6vG7wfWo.png" /></figure><p>If the Recipe is invalid, an error is thrown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/0*8wke4eEIHsK9mgQ3.png" /></figure><p>3. <strong>Execution:</strong> Instantiation of the Pipeline is done by passing the Configuration JSON to the SDK. The benefit of this step is that you don’t need any orchestration tools such as Airflow and Kubeflow in your local development environment to test out the end-to-end pipeline execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*CsyRERawkaXsdj--.png" /></figure><p>When the same Pipeline needs to run at scale, we can change the execution engine to Local/Airflow/Kubeflow declaratively. This gives us an ability to separate Pipeline logic from the underlying execution engine.</p><h3>What does the Recipe give us?</h3><p>Not only does the Recipe give us one declarative language that the data scientists will be comfortable with, but it gives us multiple other benefits:</p><h4>Code Quality:</h4><ul><li><strong>Modularity:</strong> The code will now be written in modules. Modules written by one data scientist can be easily imported by another. Writing modular code allows rapid experimentation and helps in scaling to several pipelines.</li><li><strong>Reusability:</strong> As you have seen any flavor of a particular layer can be used. No code will be wasted, but rather it can be reused (ex: Inference 2). Reusability is no longer just a construct of inference, it’s also that of training and experimentation. This benefit can be visualized by the blue and orange flows of the two experiments.</li><li><strong>Versioning:</strong> This workflow encourages the developer to check in even the experimental pipelines since all modules can be retained till the end. Developers need not wait to have perfect results before committing their code.</li><li><strong>Testability:</strong> We can perform Integration testing without depending on any orchestration framework like Airflow or Kubeflow, bringing developers one step closer to production like execution.</li><li><strong>Dead Code Paths Traceability:</strong> In a Data Science Workflow, multiple experiments are run with different modelling &amp; feature generation techniques but finally the best performing set of techniques are promoted to production. This leads to a lot of Dead Code over time in the repository. With Recipe these code blocks can be identified easily by finding the classes that are not being called by any Recipe. Inactive classes and Recipes can be removed while GIT maintains the version history. [Refer: <a href="https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf]">https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf]</a></li></ul><h4>Portability:</h4><ul><li><strong>Platform Independence:</strong> The same Recipe can be used to spin up a DAG in Airflow, as well as a Pipeline in Kubeflow. We are no longer writing a Pipeline in the syntax of any one platform but have instead abstracted out the essentials into the Recipe.</li><li><strong>Inference and Training Support:</strong> As shown above, one Recipe supports both training and inference. Based on a run time variable, the Pipeline graph that is generated will vary.</li><li><strong>Jupyter Support:</strong> We leverage the Kale framework to convert an annotated Jupyter Notebook to a Recipe Json creating classes dynamically as needed. Creating DAGs in Airflow and Pipelines in Kubeflow dynamically from this notebook is supported.</li><li><strong>Scaling:</strong> By providing support for multiple execution engines we can scale our pipeline on distributed cluster setup using K8s and leverage any scheduler/orchestrator engine.</li><li><strong>CPU/GPU Config:</strong> As seen in the sample Recipe, the CPU and GPU details can be configured for each task specified in the Recipe.</li><li><strong>Support for multiple dockers:</strong> Each Recipe may be working on a separate base docker image. There is also support to run each step of a Recipe on a separate docker image providing inter-task dependency isolation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*WDRyY4tf9IYl_Tu1.png" /><figcaption>Fig. 13: Advantages of Recipe</figcaption></figure><h3>Conclusion</h3><p>As we have shown above, using the Recipe comes with a host of benefits. While it almost seems obvious that we should be writing modular code, we see the challenges that come with modularity. These challenges need their own solve and that’s where the Recipe comes in. Writing reusable code may seem to be tedious at first, but as we write more code there are great benefits to be reaped. Developers can experiment rapidly without rewriting or losing experiments, while also getting an ability to move the code to production easily.</p><h3>Acknowledgements</h3><p>We would like to thank the following Noodlers for their contribution to this series:</p><ul><li><a href="https://www.linkedin.com/in/ravi-balasubramanian-4a80448/">Ravi Bala</a> for setting up the requirements for a framework to support modular, extensible pipeline development.</li><li><a href="https://www.linkedin.com/in/kspreddy/">Purushottam K.</a> for building out the Recipe Management Utility SDK with Airflow Support.</li><li><a href="https://www.linkedin.com/in/madhukar-gokhale/">Madhukar Gokhale</a> for extending Recipe to work with Kubeflow.</li><li><a href="https://www.linkedin.com/in/abhinav-garg-30/">Abhinav Garg</a>, <a href="https://www.linkedin.com/in/pooja-balusani-542475101/">Pooja Balusani</a> and <a href="https://www.linkedin.com/in/ravikant-chahar-8653a0ba/">Ravikant Chahar</a> for testing out the Atlas framework and providing invaluable inputs which helped mature the framework.</li><li><a href="https://www.linkedin.com/in/gopal-joshi/">Gopal Joshi</a> for providing feedback on the blogs in this series.</li></ul><h3>Blogs in this Series:</h3><ul><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558?source=friends_link&amp;sk=1a44ad46eb483e664037d2172bdf316e">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 1: Challenges With Building AI Applications</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-architecture-bef94d41d1c9?source=friends_link&amp;sk=20e8aab6742fd9aaf2a9a61e74a4f307">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 2: Design Premise &amp; Architecture</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-3-using-recipes-to-build-an-ml-pipeline-5ef591634f49?source=friends_link&amp;sk=43fe634f1b6315696120c57ada9e951c">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 3: Using Recipes to Build a ML Pipeline</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ef591634f49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 2: Design Premise & Architecture]]></title>
            <link>https://noodleai.medium.com/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-architecture-bef94d41d1c9?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/bef94d41d1c9</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Fri, 24 Jul 2020 00:26:28 GMT</pubDate>
            <atom:updated>2020-09-03T16:34:13.297Z</atom:updated>
            <content:encoded><![CDATA[<p><em>by </em><a href="https://www.linkedin.com/in/prateek-mishra-33a94741/"><em>Prateek Mishra</em></a><em>, Director of Engineering, </em><a href="https://noodle.ai/"><em>Noodle.ai</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Whd81i36EvwuhCgYftBaCA.jpeg" /></figure><p>To design a system the first step is to understand the problems and the constraints. Each architecture is unique in the way it solves for these and there is usually more than one solution.</p><p>In the Part 1 (<a href="https://blog.noodle.ai/atlas-noodle-ai-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications/">Noodle Blog</a>/<a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558">Medium</a>) of this blog we went over the challenges associated with developing Enterprise AI applications. These problems can be mapped into 3 broad categories, which can be thought of as independent axes. When optimizing along one axis you will have impacts on the other and understanding these impacts helps us to choose the right optimization goals.</p><h3>Trade-Offs — 3 Axes</h3><p>The image below maps the categories in 3 axes:</p><ul><li><strong>Production Scalability (X-axis)</strong> — Thorough design is done for Model inference stages, sometimes involving rewrites of the base pipelines for high throughput applications</li><li><strong>Deployment Speed (Y-axis)</strong> — Faster time to deploy for new Machine Learning (ML) pipelines post the model development stage</li><li><strong>Code Quality (Z-axis)</strong> — Designing good modular, deduplicated code which is extensible and maintainable</li></ul><p>At Noodle, we have limited end users for the AI Applications and the axis X is applicable only in terms of model inference throughput but not dominant. Therefore, we will analyze impacts across 2 axes — Y &amp; Z.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*SjmiKUTBNSCs7l7f.png" /><figcaption>Fig. 1: Trade-offs to consider when scaling AI applications</figcaption></figure><p>If we optimize for Y-axis — <strong>Deployment Speed</strong>, then post <strong>Model Development</strong> we minimize the steps as much as we can, and we end up treating our ML pipelines as black boxes which leads to the following problems:</p><ol><li><strong>Reusability</strong> — There is a heavy code overlap between training and inference parts of a pipeline and across pipelines, leading to duplicate code.</li><li><strong>Maintainability</strong> — It becomes difficult to identify the workflow within black boxes, review code and understand the impact when external dependencies change.</li><li><strong>Traceability</strong> — If code is written as large scripts or monolithic functions when an error occurs, it’s not quite clear what caused the code to fail unless we read the entire code.</li><li><strong>Scaling</strong> — There are steps in a pipeline that can run in parallel or need to scale to achieve a certain latency requirement. Every developer tends to come up with their own multi-processing code sometimes with different libraries which are tough to manage across a cluster.</li><li><strong>Testing</strong> — Lack of interfaces makes end-to-end system tests tougher to write.</li></ol><p>If we optimize for Z-axis — <strong>Code Quality</strong>, then we spend time in the <strong>Production Readiness</strong> stage to design a robust solution and it increases the turn-around time for ML pipelines to reach production. Some of the reasons for this are as follows:</p><ol><li><strong>Low Domain Context</strong> — Software/ML engineers who are skilled enough to do this are lacking the domain context.</li><li><strong>Introducing New Bugs </strong>— Bugs may get introduced while refactoring code which are difficult to anticipate and trace.</li><li><strong>Ownership Dilution</strong> — For every bug or feature, a triage must be done to identify which developer to assign it to.</li></ol><h3>Design Goals</h3><p>Having understood the challenges that come along with building Enterprise AI applications and the trade-offs that we will face when solving for these, it would be good to list the design goals which will help us pick the right trade-offs across the 3 axes.</p><ol><li>Enable developers with domain context to take their code to production</li><li>Achieve balance between the 3 axes to offset maximum tradeoffs</li><li>Abstract developers from complexity of orchestration frameworks, configurations of a distributed cluster and tool evolution</li><li>Reduce time taken between Model development and Production Readiness stages — <em>Y-axis</em></li><li>Promote modularity and reuse of code even during experimentation — <em>Z-axis</em></li><li>Support for training, inference at scale with seamless switch — <em>X-axis</em></li><li>Promote Test Driven Development to ensure tech debt doesn’t pile up</li></ol><p>We observed that while developers are very familiar with writing ML pipeline code in Jupyter Notebooks, when the time came to transfer this code as Python classes and Airflow DAGs, either there was not enough time or a general reluctance to express the same flow in different syntaxes.</p><p>We needed a mechanism to make the incoming ML pipeline transparent and compliant to overall architecture of deployment.</p><p>We wanted to encourage developers to write more code as modules, classes and functions such that they can be reused for multiple experiments.</p><h3>Putting it all together — Atlas: A Recipe driven framework</h3><p>The Atlas framework provides a declarative JSON based syntax to define ML pipelines which we call the “Recipe.” This is a representation of a Directed Acyclic Graph which is used as the basis for pipeline execution in most frameworks. This is accompanied by a Config JSON which can be used to provide features, hyper parameters, model versions etc.</p><p>A developer starts by wrapping their code in Template classes which represent each step of the Recipe. This ensures that code is modular and reusable from get go and benefits of this is realized even during training. This method ensures that standard Design Patterns such as Strategy and Builder and Design Principles such as <a href="https://en.wikipedia.org/wiki/Don&#39;t_repeat_yourself">DRY</a>, <a href="https://en.wikipedia.org/wiki/Inversion_of_control">IOC</a>, <a href="https://en.wikipedia.org/wiki/SOLID">SOLID</a> are baked into our ML pipelines development.</p><p>The framework provides a Python-based SDK for developers which can be used to test a Recipe execution right in the development environment with no dependency on orchestration frameworks. Once tested the deployment pipelines ensure that the same code is deployable to a much robust and scalable environment for training and inference.</p><p>Atlas consists of the following components:</p><ul><li><strong>Recipe</strong> — Declarative JSON syntax to represent an ML pipeline</li><li><strong>Config</strong> — Configuration JSON to capture the Features, Hyper parameters, Model versions etc.</li><li><strong>Python SDK</strong> — Interpret, visualize, validate and test Recipe &amp; Config</li><li><strong>Infrastructure AS Code</strong> — Spin up components of the architecture</li><li><strong>Deployment Pipelines</strong> — Tie a workflow for the above components</li></ul><p>Let’s take the workflow diagram which was depicted in the Part 1 (<a href="https://blog.noodle.ai/atlas-noodle-ai-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications/">Noodle Blog</a>/<a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558">Medium</a>) blog, and add Atlas’ components Recipe and Config to it. You can see that this now addresses one of the core problems of the context switching which was highlighted earlier. Developers now can keep their mind off the architectural diversity and are not required to recreate and test flows in multiple places.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tsJpbWRDLA80jp8O.png" /><figcaption>Fig. 2: Atlas Tech Stack</figcaption></figure><p>The framework can be leveraged for the following:</p><ul><li>To run end-to-end pipeline on developers’ local machines</li><li>Easy visualization of the execution graph of pipelines which helps in better debugging and testing</li><li>Submit jobs for training on Kubeflow</li><li>Deploy the inference pipelines on Airflow</li><li>Define dependency for each pipeline and step using different Docker Images</li><li>Reduced dependency on Production Readiness stage, thereby eliminating code handoffs</li><li>Multiple ML pipelines can easily be created and executed concurrently by changing the classes in the Recipe JSON. This is helpful when building hierarchical models.</li></ul><p>Let’s look at the workflow of development and deployment using the Atlas Framework.</p><h3>Stage 1: Development</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YSUMxrR2eUVgviDl.png" /><figcaption>Fig. 3: Development Stage</figcaption></figure><ul><li>Developers use Jupyter &amp; Python to harden modeling approaches</li><li>Once the ML pipeline is developed a Recipe JSON is created to describe the same</li><li>Any configs which are needed to drive the Recipe can be checked in a separate Config JSON file</li><li>Code is committed to git repository</li><li>Docker images are updated and pushed to Docker registry</li></ul><h3>Stage 2: Model Training</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DpM4vFO-uzpRXERJ.png" /><figcaption>Fig. 4: Training Stage</figcaption></figure><ul><li>Jenkins is used to build the branch. During the build step Recipe is converted to Kubeflow pipeline</li><li>The Kubeflow pipeline is uploaded into Kubeflow</li><li>Developers use the Kubeflow UI to track and manage experiments and Artefacts</li><li>MLFlow UI can be used to compare experiments and manage models</li></ul><h3>Stage 3: Inference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PQZzjnocESy4fqUV.png" /><figcaption>Fig. 5: Inference Stage</figcaption></figure><ul><li>Best performing models from Step 2 are promoted to production</li><li>ML model is registered using Model Registry and tagged</li><li>Git branch which has the pipeline code will be promoted as a release candidate having reference to the correct model version number</li><li>Code is built and the Recipe for inference is used to dynamically generate Airflow DAGs</li><li>All Recipe and Config files are scanned to generate multiple pipelines, if needed.</li><li>Model performance metrics get logged into Prometheus</li></ul><h3>Stage 4: Model Re-Training</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XSzC7GR8gIIUiebh.png" /><figcaption>Fig. 6: Model Retraining Stage</figcaption></figure><ul><li>Retraining can be triggered by any of the following scenarios:</li></ul><ol><li>Availability of more data</li><li>Availability of more labels</li><li>Performance degradation of deployed models</li><li>Variation on trends of input features outside thresholds</li></ol><ul><li>Once trigger condition is met, the model metadata is checked, identify the Recipe versioning git, Pipeline version in Kubeflow and related config.</li><li>Training flow is initiated with input parameters as relevant for the given trigger</li><li>Evaluation of the model is performed on test set and if it passes it can be promoted to production</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/0*flY46bDOVo4kSpmP.png" /><figcaption>Fig. 7: Atlas Architecture Diagram</figcaption></figure><h3>Summary</h3><p>We have reduced the development to deployment turnaround time from months to 2 weeks using the above workflow. It has helped us deploy over 100s of ML pipelines into production which run over 1000s of containers. Management becomes critical at this scale and using Git to check in our code and a Model Registry to save our Models has proved to be very effective. We use Jenkins to tie this workflow together.</p><p>MLOps is a rapidly evolving field and many new open source and proprietary frameworks are becoming available as options. To keep the choice of spectrum wide and prevent major code refactors on switching from one service to the next, it really helps to start out with an abstraction. The gamut of MLOps is very broad and it is very difficult to find a <strong>one size fits all</strong> framework, so there is a need to be prepared for rapid adoption and experimentation. Being able to port your experiments and workflow stages to new tools and frameworks while abstracting Data Scientists &amp; ML Engineers, provides great agility. While there are many different areas to cover when discussing MLOps such as Feature Store, Data Versioning and Model Monitoring, Testing Strategies, there are various contents available online for these topics.</p><h3>References</h3><ul><li><a href="http://theartofscalability.com/">The Art of Scalability</a></li><li><a href="https://en.wikipedia.org/wiki/The_Pragmatic_Programmer">The Pragmatic Programmer</a></li><li><a href="https://en.wikipedia.org/wiki/Object-Oriented_Software_Construction">Object-Oriented Software Construction</a></li><li><a href="https://airflow.apache.org/docs/stable/concepts.html">Airflow Concepts</a></li><li><a href="https://www.kubeflow.org/docs/pipelines/overview/pipelines-overview/#architectural-overview">Kubeflow Architecture</a></li><li><a href="https://www.mlflow.org/docs/latest/tracking.html">MLFlow Tracking</a></li><li><a href="https://www.mlflow.org/docs/latest/model-registry.html">MLFlow Model Registry</a></li></ul><h3>Blogs in this Series</h3><ul><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558?source=friends_link&amp;sk=1a44ad46eb483e664037d2172bdf316e">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 1: Challenges With Building AI Applications</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-architecture-bef94d41d1c9?source=friends_link&amp;sk=20e8aab6742fd9aaf2a9a61e74a4f307">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 2: Design Premise &amp; Architecture</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-3-using-recipes-to-build-an-ml-pipeline-5ef591634f49?source=friends_link&amp;sk=43fe634f1b6315696120c57ada9e951c">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 3: Using Recipes to Build a ML Pipeline</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bef94d41d1c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 1: Challenges With Building AI Applications]]></title>
            <link>https://noodleai.medium.com/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/489cefd84558</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Mon, 13 Jul 2020 19:55:55 GMT</pubDate>
            <atom:updated>2020-09-02T16:31:32.447Z</atom:updated>
            <content:encoded><![CDATA[<p><em>by </em><a href="https://www.linkedin.com/in/prateek-mishra-33a94741/"><em>Prateek Mishra</em></a><em>, Director of Engineering, </em><a href="https://noodle.ai/"><em>Noodle.ai</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tIFwLtzEYKcbFDRt0_hvg.png" /></figure><p>Noodle.ai is focused on providing AI products to address a diverse set of problems which could aide in better visibility, decision making and waste reduction for our Enterprise customers. This two-part blog covers the journey of building our in-house ML framework — Atlas, explaining the factors that were considered, choices that were made and the benefits that we derived out of it. In the first part the focus will be on 4 high-level factors which contribute to complexity of building an AI application and we will dive into details of each of these:</p><ol><li><strong>Enterprise AI Applications:</strong> What does it take to build an Enterprise AI product</li><li><strong>AI Application Development Lifecycle:</strong> Where is the choke point in the product development process and why</li><li><strong>ML Pipeline Development:</strong> What are the velocity challenges with iterative experiments</li><li><strong>Tech Stack Selection:</strong> What are the tools available, overview of one such combination we use at Noodle</li></ol><h3>1. Enterprise AI Applications</h3><p>There are numerous blogs which describe the challenges when developing an AI application. This comes largely due to the iterative nature of development when compared to a more deterministic rule-based software.</p><p>Building Enterprise grade software is always treated differently than building other applications and a testament to this fact is that most open source software offer a community and an enterprise version of the same product. A <a href="https://www.forbes.com/sites/adrianbridgwater/2019/03/02/what-makes-an-app-an-enterprise-application/#59fab83549d2">Forbes article</a> covers this topic in detail.</p><p>What do we know so far?</p><ul><li>Building AI applications is tough</li><li>Building Enterprise grade software is tough</li></ul><p>So, what would be the complexity in building an Enterprise AI application?</p><p>To understand this, we try to see the application of AI driven Recommendation Engine, evaluated for different category of end users.</p><ol><li>Recommending songs or videos to the end user on an audio/video streaming application</li><li>Recommending optimal parameters to an operations engineer in a manufacturing plant.</li></ol><p>In each of the example above, while the approach taken to solve the problems could be similar the impact of decision made is quite different. In the #2 scenario, errors made by the application could cause significant loss to the end users.</p><p>When you are building an Enterprise software such as Confluence, you would be paying to consume core features such as Documentation &amp; Collaboration. It might be using an AI/ML backed search algorithm to better assist you in navigation.</p><p>Another example could be Zoom, where you would be paying to use the meetings, screen share and recording features. It could be using AI based systems to flag content on video calls.</p><p>Both are examples of Enterprise products where AI is an Add On Feature. At Noodle we build products where AI is the core feature of the application, which belong to the yellow path shown in Fig. 1. AI is not an added layer of intelligence, but it is the feature for which we get payed. This adds additional layers of complexity in the development and deployment lifecycle. A failure in this component will result in failure of product and most likely cause losses. The criticality of performance is higher and so are the expectations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ml9bQH5Qxk_30p0a.png" /><figcaption>Fig. 1: Types of AI applications based on project goals</figcaption></figure><p>Some of the challenges that we have experienced when building Enterprise AI products are described below:</p><ul><li><strong>Data Variations</strong> — Enterprise tenants have variations in storing and naming the data sets, often involving data being spread across multiple vendor’s software. This makes the efforts to retrieve and process this data intensive.</li><li><strong>Customization</strong> — Most customers need data isolation and hence even when the domain is the same, customized models must be created for each tenant analyzing their individual historical data and understanding the context.</li><li><strong>Performance</strong> — Accuracy of the models should be high to drive impactful decision making and, as seen in the examples above, prevent losses from happening.</li><li><strong>Freshness</strong> — Inference results should be available on the latest data. Inferences which were run earlier become stale and need to be discarded or refreshed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZDUOs-FEo_d9YCIQ26Vdg.png" /><figcaption>Fig. 2: Challenges with Enterprise AI applications</figcaption></figure><h3>2. AI Application development lifecycle</h3><blockquote><em>“What you have learned is that the capacity of the plant is equal to the capacity of its bottlenecks,” says Jonah.” — Eliyahu M. Goldratt, </em>The Goal: A Process of Ongoing Improvement</blockquote><p>As per the Theory of constraints, every system has one or more constraints which prevents it from achieving optimum efficiency. Any improvement done before or after this constraint is ineffective. Going from raw data to an AI application involves multiple stages as highlighted in diagram below. A common constraint is the turnaround time of putting new ML pipelines into production. Usually the choke point is the switch over from <strong>Model Development</strong> to <strong>Production Readiness</strong> stages as shown below. Enabling faster experiments, adding more members on the team or providing more specialized hardware for ML/DL will not have any impact till this is addressed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BwkxHtAXQhBRDUxj.png" /><figcaption>Fig. 3: AI Application Development Lifecycle</figcaption></figure><p>If we examine the two stages leading to the constraint namely Model Development and Production Readiness, we can see that the reason for this delay is that the developers in the two stages are trying to meet different goals.</p><h3>Model development</h3><ul><li>Domain understanding / Data Labelling</li><li>Modelling technique selection</li><li>Feature selection</li><li>Experimentation</li><li>Evaluation</li><li>Visualization</li></ul><h3>Production Readiness</h3><ul><li>Code Modularization</li><li>Reduce duplication</li><li>Interface definition</li><li>Test case identification and automation</li><li>Workflow orchestration</li><li>Scalable execution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7O4jDLhcdKpAxPku.png" /><figcaption>Fig. 4: Optimization goals for Model Development and Production Readiness stages</figcaption></figure><p>Balancing the different goals and bringing in the right velocity is tough between these two stages. The amount of effort to be invested in this process varies if you are trying to build one product vs if you are trying to build a suite of products across different domains. In the latter scenario, optimization of this process becomes a necessity.</p><h3>3. ML Pipeline Development Model</h3><p>Development is an iterative process which involves experimentation and evaluation cycles factoring for both code and data changes. While it is tempting to continue this cycle to chase a certain state of perfection but if we apply the principles of DevOps, also referred to as MLOps, we would want to promote reasonably performing models and their corresponding ML pipelines to production quickly. There are a few articles that cover this topic in detail and are a recommended read.</p><ol><li><a href="https://cloud.google.com/solutions/machine-learning/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning">MLOps: Continuous delivery and automation pipelines in machine learning</a></li><li><a href="https://towardsdatascience.com/ml-ops-machine-learning-as-an-engineering-discipline-b86ca4874a3f">ML Ops: Machine Learning as an Engineering Discipline</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucEM_0KpILURIVhzfGCfSw.png" /><figcaption>Fig. 5: Iterative Model Development</figcaption></figure><p>All AI applications must embrace the concept of iterative, exploratory development process. This is a difficult premise for software development where most practices known have been designed around clarity in requirements. The constant experimentation creates 2 more problems which become tougher to solve as time passes.</p><ul><li>There is a tendency to keep improving the models and push for an ideal state. This makes the development follow a waterfall model where most of the integration and testing gets delayed.</li><li>The boundary between a successful experiment prototype and an application deployed in production becomes unclear and this leads to massive technical debt [Prototype Smell].</li></ul><h3>4. Tech Stack Selection</h3><p>There is an added complexity of selecting the right tech stack amongst the numerous packages and tools that are available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*myTT1xzCp8kvGOmE.png" /><figcaption>Fig. 6: Tech stack across different layers</figcaption></figure><p>At Noodle, we have a hybrid infrastructure. We have a <strong>private data centre</strong> that houses heavy compute clusters and public cloud — <strong>AWS + Azure</strong>, is used to host the application. Each tenant can opt in for dedicated VPC or VNet based on their data + compute isolation needs. Development and training phases are mostly carried out in the private data centre and the trained models are deployed to cloud. To ensure seamless operations across 3 different environments, we have leveraged <strong>Kubernetes</strong> (K8s) to be the layer of abstraction for our operations and deployments.</p><p>The initial focus was more on hardening the inference scalability and deployments. For this we selected Airflow which has been battle tested and proven in our operations. We deployed <strong>Airflow on K8s</strong>, using the K8s Executor to achieve parallelism across 100s of pipelines spawning 1000s of containers.</p><p>Development for ML pipelines is usually done in Jupyter converted to python scripts and tested in Docker. To scale the training workflow and enable rapid experimentation we choose <strong>Kubeflow</strong>, since this blends well with our K8s stack. <strong>MLFlow</strong> was selected as a model registry and experiment tracker since it gives a good REST-based interface to abstract model versions.</p><p>Our workflow is shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yzwd326OZB-s_1X-.png" /><figcaption>Fig. 7: Workflow &amp; Tech stack at Noodle.ai</figcaption></figure><p>Context Switch: Training to Production — Training is different from inference in pipeline steps, infra (GPU -&gt; CPU) and tech stack (refer pic Above) which causes developers to factor for all these in their code. For example, a developer needs to do the following.</p><ul><li>Develop experiment in Jupyter</li><li>Create a Training pipeline in Kubeflow</li><li>Test the training pipeline using Docker container</li><li>Deploy pipeline to Kubeflow + GPU instances</li><li>Write an airflow DAG for the inference pipelines</li><li>Test the inference within Docker</li><li>Deploy inference pipeline to Airflow + CPU instances</li></ul><h3>Summary</h3><p>So far, we have seen the challenges in building AI Applications due to the following factors.</p><ul><li>Enterprise AI applications have more layers of complexity added due to the end users it serves and the cost involved in decision making.</li><li>Iterative nature of ML pipeline development and deployment necessitates that we factor for explorative development with room for experimentation.</li><li>Tech stack and infrastructure variations pose a selection problem. This also causes syntax variations which leads to context switches.</li><li>Constraint when promoting ML pipeline from Model development to Production Readiness stages. To ensure the code being promoted to production is maintainable it needs to be modular and reusable.</li></ul><p>When designing a system there are always trade-offs involved and being aware of these helps in making an educated choice. In Part 2 of this blog we start by exploring some of these trade-offs and do an impact analysis on pursuing one set over the other. This will pave the way to define the Design Goals which were most relevant to Noodle and which are the foundation in building a novel in-house ML framework which we call Atlas. We will do a brief walkthrough of developing and deploying an ML pipeline using Atlas.</p><h3><strong>References</strong></h3><ul><li><a href="https://cloud.google.com/solutions/machine-learning/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning">MLOps: Continuous delivery and automation pipelines in machine learning</a></li><li><a href="https://towardsdatascience.com/ml-ops-machine-learning-as-an-engineering-discipline-b86ca4874a3f">ML Ops: Machine Learning as an Engineering Discipline</a></li><li><a href="https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf">Hidden Technical Debt in Machine Learning Systems</a></li><li><a href="https://martinfowler.com/articles/cd4ml.html">Continuous Delivery for Machine Learning</a></li></ul><h3>Blogs in this Series</h3><ul><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-1-challenges-with-building-ai-applications-489cefd84558?source=friends_link&amp;sk=1a44ad46eb483e664037d2172bdf316e">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 1: Challenges With Building AI Applications</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-2-design-premise-architecture-bef94d41d1c9?source=friends_link&amp;sk=20e8aab6742fd9aaf2a9a61e74a4f307">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 2: Design Premise &amp; Architecture</a></li><li><a href="https://medium.com/@NoodleAI/atlas-noodle-ais-machine-learning-ml-framework-part-3-using-recipes-to-build-an-ml-pipeline-5ef591634f49?source=friends_link&amp;sk=43fe634f1b6315696120c57ada9e951c">Atlas, Noodle.ai’s Machine Learning (ML) Framework Part 3: Using Recipes to Build a ML Pipeline</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=489cefd84558" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Probabilistic Decision Machines for Building a Causally Generative Process Model-based Action…]]></title>
            <link>https://medium.com/noodle-labs-the-future-of-ai/deep-probabilistic-decision-machines-for-building-a-causally-generative-process-model-based-action-3f65552409b8?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f65552409b8</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[decision-machines]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-probabilistic]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 01:08:49 GMT</pubDate>
            <atom:updated>2019-10-29T19:26:03.353Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Deep Probabilistic Decision Machines for Building a Causally Generative Process Model-based Action Control in Enterprise AI</strong></h3><p><em>by Chief Scientist, AI and Data Science, </em><a href="https://www.linkedin.com/in/hyungilahn/"><em>Hyungil Ahn</em></a><em>, </em><a href="https://twitter.com/HyungilA"><em>Ph.D</em></a><em>. and the AI R&amp;D team</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVlHXuAGLZbi7o-kJSLnGA.jpeg" /></figure><p>There are many machine learning libraries and automated tools that might be applied to enterprise AI problems. We find that these tools tend to support only the “associative” AI problem setups such as regression, classification, and autoregressive time-series modeling¹. The typical uses of “associative” AI might be still effective in simple diagnostic or predictive contexts where we want to use probabilistic associations like correlations between observed features and targets (e.g., When we observe variable X, how likely we would be to observe variable Y?), but they have significant limitations in making high-value solutions in Enterprise AI® where we want to make optimal decisions and controls in the “causal” context of complex dynamic processes (e.g., What would happen to output Y, if we do action A in observed condition C and probabilistic latent state Z of the process²?)</p><h4><strong>Simplified illustrations:</strong></h4><p><strong>Associative AI</strong></p><p>For a given distribution center and SKU, when we observed <strong><em>Y(last)%</em></strong> and <strong><em>Y(this)%</em></strong> of lost sales (due to insufficient stock) on the last month and this month, what tended to be the most likely value <strong><em>Y(next)%</em></strong> of lost sales next month?</p><p><strong>Causal AI</strong></p><p>For a given distribution center and SKU, when we observed <strong><em>D(last)</em></strong> and <strong><em>D(this)</em></strong> of demand, <strong><em>I(last)</em></strong> and <strong><em>I(this)</em></strong> of inventory, <strong><em>Y(last)%</em></strong> and <strong><em>Y(this)%</em></strong> of lost sales, <strong><em>A(last)%</em></strong> and <strong><em>A(this)%</em></strong> of shipment allocations from the hub on the last month and this month, what will be <strong><em>D(next)</em></strong> of demand, <strong><em>I(next)</em></strong> of inventory and <strong><em>Y(next)%</em></strong> of lost sales next month if we change shipment allocation to <strong><em>A(next)%</em></strong> on the next month?</p><h4><em>What can be a key representative problem framing in enterprise AI?</em></h4><p>We can generalize a variety of problems in enterprise AI as building generative process models based on historical data from actual dynamic processes, then optimize actions in diverse conditions over the processes by simulating measurement outputs. The key representative setup for this dynamic process simulation and action planning typically involves causal interactions between the following four sets of variables:</p><ul><li><em>Actions</em>: controllable inputs, planned under operating constraints (e.g., safety stock thresholds, planned receipts)</li><li><em>Conditions</em>: uncontrollable inputs, determined by the process context and previous action selections (e.g., DC locations or lead times)</li><li><em>Sensors</em>: observable but not directly controllable measurement outputs, predicted by the generative process model (e.g., customer demand, inventory levels, or actual receipts)</li><li><em>Targets</em>: observable but not directly controllable measurement outputs associated with KPIs or the optimization objective, predicted by the generative process model and optimized (e.g., lost sales, inventory holding costs, expedite costs, or value at risk)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ofd1L32nWA_vRRm0SL3xUQ.png" /><figcaption><em>Table 1: Examples of Actions, Conditions, Sensors and Targets in Different AI Domains</em></figcaption></figure><p>We have developed universal deep probabilistic decision-making methods and code libraries for the dynamic process modeling and control optimization, called the “Deep Probabilistic Decision Machines (DPDM).” High-value solutions in enterprise AI want us to make <strong>“causally actionable” models of dynamic processes </strong>involving the causal interactions of actions, conditions, sensor outcomes and target KPIs. The DPDM unifies <strong>deep + probabilistic + reinforcement learning </strong>to build generative process models from the historical data &amp; make causal predictive simulation-based optimal decisions in enterprise AI on the <strong>horizontal framework</strong>.</p><p>Before explaining the DPDM in detail, we will first discuss some limitations and mistakes of popular data science practices, such as regression and autoregressive time-series modeling when developing enterprise AI applications. Then, we will broadly illustrate some application examples of the DPDM in enterprise AI.</p><h4><em>Simple regressions or classifications fail in solving the key representative enterprise AI problem</em></h4><p>Regression or classification setups typically prepare features (predicting variables) and targets (predicted variables) for each sample observation. For dynamic variables, we usually summarize or aggregate temporally changing values over the time period associated with the sample observation, transforming dynamic prediction problems into static ones.</p><p>A common mistake with regression or classification setups is a causal violation that happens when sensor measurement outputs are used as features in prediction tasks, in addition to actual causal inputs (action or condition inputs). This is problematic because those measurement outputs are not causes of change in target outputs but are merely associated with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*motvEt-uic3ACabuE6CSUg.png" /><figcaption>Figure 1: A regression model violating the causal relationship</figcaption></figure><p>For example, suppose that an AI system optimizes the mechanical qualities (target output variables) of produced coils in a steel mill by controlling action input variables such as set-point coiling temperatures for coils in each product category condition (e.g., different grades, hot/cold rolled). There are also sensor output variables such as actual-measured coiling temperatures and different zone temperatures over the process line. The “static” regression setup for predicting the mechanical qualities might mistakenly use as features the aggregated values of all sensor output variables and action input variables. That is, it does not properly distinguish sensor output variables from action and condition input variables, <em>using all of those variables as features to be fit and associated with the target variables</em>.</p><p>Even for a regression model with high fitness under this setup, this is not a causally actionable model due to the use of sensor output variables as features. First, sensor output variables are not available at the time of the target prediction, unless these are separately predicted earlier. Second, sensor output variables tend to be multi-collinear or correlated with other inputs such as action variables, so it’s likely that the regression incorporating both sensor outputs and action inputs would underweight action variables that are actually causal. Third, there might be also a multi-collinearity issue among action and condition input variables, which requires compression or dimensionality reduction. Fourth, it is often true that a regression model without sensor outcomes as features has low R-squared fitness and not very predictive. How can we compress the correlated action and condition input variables into key hidden features (or latent state) and also involve sensor output variables to learn our predictive model but not violate the causal relationship?</p><h4><em>Static DPDM can achieve causally plausible predictions and decisions in open-loop situations</em></h4><p>Since our main interests are causally plausible predictions and decisions that ask for causal simulations with hypothetical actions and conditions, we should not involve sensor output variables as features in the regression setup. Our open loop version of DPDM (simply called “Static DPDM”) provides a theoretically grounded solution to build a causally plausible model in the open-loop decision situation for sample observations involving action inputs, condition inputs, sensor outputs and target outputs. Static DPDM is a deep probabilistic latent variable model that generates (or predicts) both sensor and target outputs based on action and condition inputs. Based on the deep generative modeling approach, we compress multi-collinear variables into probabilistic latent variables (Bayesian prior and posterior states). The prior state is represented based on only action and condition inputs, whereas the posterior state is on all inputs and outputs. Also, probabilistic latent variables capture the model uncertainty when the given inputs are not sufficient to estimate the underlying process state and predict the outputs (e.g., some input/output variables are missing in a partially-observed environment, the input/output data are not enough, and/or there are inherent stochastic process noises affecting outputs).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OL7iKKRty6onzgpfsNHm3A.png" /><figcaption>Figure 2: Static DPDM framework</figcaption></figure><p>We predictively generate not only the target outputs but also all sensor outputs. This way enables the latent representation to exploit the causal relationship between inputs (conditions and actions) and all outputs of sensors and targets. In the model training phase, sensor outputs serve as additional labeled data to be predicted besides target outputs. We train the prior latent state function taking only actions and conditions into account, in addition to the posterior latent state function based on all actions, conditions, sensors and targets. The prior and posterior latent states are constrained to be similar. That is, the prior latent state distribution for given actions and conditions is similar to the average of posterior latent state distributions of sample observations with those actions and conditions. This guides the prior latent state (i.e., the process state estimated before observing actual outputs) to contain the key compressed information for predicting outputs for any given action and condition combinations in the model testing phase.</p><p>Once the deep probabilistic (DP) process model is trained, we can do model-based simulations to train an optimal action policy which selects the best actions to optimize key performance indicators (KPIs) for any given condition context.</p><h4><em>Autoregressive time-series models are not the best in dynamic predictions and decisions</em></h4><p>When all variables are dynamic and sequentially provided over each sample sequence that occurs over multiple time steps, a popular machine learning setup is autoregressive time-series modeling; where predicted outputs (both targets and sensors) on the next time step are the modeled function of all observed inputs and outputs (actions, conditions, sensors and targets) on all current and past time steps.</p><p>A lot of enterprise AI problems require optimal action planning over a long future horizon (not a single next time step). That is, we want to optimize the total cumulative KPIs derived from predicted target outputs over multiple steps in the future. This setup can be viewed as a sequence-to-sequence framework.</p><p>Note that we predict not only the targets but also sensors. This is because most problems require predicting target outputs over multiple time steps into the future, so the modeled function should be iteratively run relying on previously predicted sensors and targets. To predict targets and sensors for any planned actions and given conditions over multiple future timesteps, autoregressive models should forcefully set those actions and conditions.</p><p>Although this setup benefits from explicitly dealing with dynamic variables without any aggregation or summarization over all time steps for a sample sequence, it would not be effectively applicable when there are high-dimensional or multi-correlated sensors, actions and conditions. Without having some complicated previous steps for variable selection, measurement noise filtering or dimensionality reduction, the model would suffer from overfitting issues, multi-collinear or correlation issues between sensor outputs and other inputs, and being too sensitive to measurement noises. In addition, when the provided historical sequence is not long enough to accurately estimate the underlying process state and predict the future sequence, there is no way to represent the model uncertainty.</p><h4><em>Dynamic DPDM can make predictive simulation-based controls in closed-loop situations</em></h4><p>One of the most important problems in enterprise AI is to make optimal sequential decisions or closed-loop controls over dynamic processes. In dynamic DPDM, we build a deep-probabilistic (DP) process model that enables the generative simulations of the likely future sensor and target sequence for any given future (or counterfactual) condition and action sequence at a latent process state. Then, we optimize our action policy for sequential decision making (DM) based on predictive simulations in model-based reinforcement learning (RL) or model-predictive control (MPC) approaches. The best action policy or controller can be designed to optimize the given KPIs, relying on the predicted experiences of sensor and target observations for different actions over the future time horizon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CagQsZ9DNZ9ACllP-y2AJA.png" /></figure><h4>Dual-Process Model with Deep Probabilistic Latent States</h4><p>How to represent the latent “state” of the dynamic process? We propose the latent process state rely on the philosophy of the dual process theory. The process state at each step is represented by an explicit probabilistic latent state (driven by Bayesian learning like probabilistic state-space models) that compress the other implicit deep deterministic hidden state (driven by deep learning like recurrent neural networks) and predictively generate the observed outputs for the provided inputs. There is also the interplay between the probabilistic model-based learning and the deep associative learning.</p><ul><li>The deep learning system (System 1, deterministic RNN) is much faster and powerful in extracting key patterns and features from the past sequence of high-dim inputs and observations.</li><li>A limited memory size of past experiences (the length of the past sequence composed of past conditions, actions, sensors and targets) is typically used to represent the current process state in computational models. Also, observations are noisy and incomplete. This partial observability makes the underlying dynamic process stochastic, asking for the probabilistic state representation (System 2, probabilistic state-space model).</li></ul><p>Deep learning would extract and represent key features from the sequence of past experiences. Dynamic processes tend to involve high-dimensional cross-correlations among action inputs, condition inputs, sensor outputs, and target outputs. Thus, it’s important that latent states can capture cross-correlations of variables. Bayesian learning would explicitly construct the dynamics of probabilistic prior and posterior states with implicitly learned features from deep learning. In addition, since the deterministic states (or hidden-layer outputs) in deep learning tend to have much higher dimensionality than the probabilistic states in Bayesian learning, probabilistic states would be very helpful for the overall model interpretability. The lower dimensional probabilistic states can be considered sequentially-learned variational auto-encoded features with the inputs of deterministic hidden states from deep learning.</p><p>Our favorite analogy for the need of deep probabilistic models combining deep learning (implicit, scalable, associative, deterministic, experience data-driven) and Bayesian probabilistic learning (interpretable, structured, prior/posterior, probabilistic, prediction model-based) is to compare them to Kahneman’s dual process of the human mind, “System 1” and “System 2” (“<a href="https://www.amazon.com/Thinking-Fast-Slow-Daniel-Kahneman/dp/0374533555/ref=asc_df_0374533555/?tag=hyprod-20&amp;linkCode=df0&amp;hvadid=312371602209&amp;hvpos=1o1&amp;hvnetw=g&amp;hvrand=7722370598775647440&amp;hvpone=&amp;hvptwo=&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9032941&amp;hvtargid=pla-395340046230&amp;psc=1&amp;tag=&amp;ref=&amp;adgrpid=61011965686&amp;hvpone=&amp;hvptwo=&amp;hvadid=312371602209&amp;hvpos=1o1&amp;hvnetw=g&amp;hvrand=7722370598775647440&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9032941&amp;hvtargid=pla-395340046230">Thinking, Fast and Slow</a>”). Kahneman and Tversky describe the human mind and decision making in terms of an intuitive system and deliberative system calling them “System 1” and “System 2” respectively. <em>System 1</em> is experience-based associative learning, while <em>System 2</em> is prediction-based logical and probabilistic reasoning. We might say that <em>System 1</em> and <em>System 2</em> are also similar to <a href="https://www.amazon.com/Book-Why-Science-Cause-Effect/dp/046509760X/ref=sr_1_1?keywords=judea+pearl&amp;qid=1568848132&amp;s=books&amp;sr=1-1">Judea Pearl</a>’s the “observational, associative layer” and the “causal and counterfactual layers”, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8zID11s23RNjGJayejo5Tg.png" /></figure><p>The deep probabilistic (DP) model of the process begins with a set of actions, conditions, sensors (measurement outcomes) and targets (KPI-related outcomes). Given the past sequence of these experiences, the model is trained to learn the latent states of the process up to the current time, which basically compresses the vast amount of historical information you have into a much smaller amount, learning only the most critical pieces of information from the data. Beyond compressing the information, the model also maps it to prior and posterior probability distributions of the latent states, which is then used as part of the predictive simulation. With the current latent state probability distribution of the process, if you are given a set of actions and conditions across a future time horizon, you can accurately simulate measurement outcomes such as inventory positions or fill rate, and target outcomes such as lost sales or value at risk. In other words, you can use the DP model to get an accurate simulation of the future unknowns (measurement and target outcomes), given what you plan or know in advance (actions and conditions).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KtohzvtInJ971-_tRG2t8A.png" /></figure><p>The decision machine (DM) model of the process utilizes the DP model’s simulation of the future to try out different actions and select the actions that optimize your KPIs. Iteratively over the future horizon, each time step we know or determine the condition (static or possibly changing according to previous action choices), select an action, and obtain simulated outputs. The DM controller tries out different action strategies in the simulated environment and rewards action strategies that optimize the key performance indicators associated with the desired targets. In this manner, the DM controller acts as a type of reinforcement learning, creating the flexibility to optimize the target outcome based on the cost considerations of your business. In the context of an enterprise with complex dynamic interactions and process variability, our DPDM model is unique in its ability to recommend the optimal actions in any scenario, and to continue learning based on the current actions being taken.</p><h4><em>DPDM = Deep Learning + Bayesian Learning + Reinforcement Learning</em></h4><p>In many enterprise AI problems, our decision-making agent is not allowed to learn and optimize its decision-making or control policy through multiple trials in the real world. Generating the real-world experience data from executing numerous actions and conditions is very time-consuming, expensive and even dangerous when the input ranges happen not to be properly set. For this reason, it is very desirable to build a predictive simulation model using the historical process data that companies have accumulated. Then, simulated experiences for hypothetical actions and conditions enable the agent to make optimal decisions.</p><p>In this regard, enterprise AI can be contrasted with other AI fields (e.g., robotics, games like <em>Go</em> and <em>Starcraft</em>, self-driving cars) that begin with separately-developed rich and accurate physical-world simulators or have the ability to experiment at low cost in real-world scenarios. Therefore, learning a predictive simulation model based on the historical process data available is the first task in enterprise AI applications. This is difficult to do with sufficient explainability, probabilistic richness and accuracy, given the kinds of data we encounter in enterprise AI.</p><p>We have developed a framework and platform for building these predictive simulators and model-based control/decision engines in enterprise AI contexts. The deep probabilistic (DP) dynamic model tells us how the state of the system will evolve as a result of the actions one takes based on observed sequences (conditions, actions, observations over time). Defining performance KPIs, or “targets”, one can use this model in an RL approach to construct a decision-making engine that suggests a “next best action” for any current state. The agent’s initial action policy can be learned from simulated experiences, or a model predictive control (MPC) approach can be considered using Monte-Carlo simulations at every timestep. The deployment of the controller or decision recommendations can run on the edge or in the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0hyGTpteEAv12HXEbLH5Q.png" /></figure><h4>The following examples illustrate some applications of dynamic DPDM.</h4><p><strong>Predictive Quality Control in Closed-Loop Situations</strong></p><p>Consider an industrial dynamic process that produces products using user-controllable actions and exogenous planned conditions as inputs. For example, the process may involve actions like controlling RPM setpoints for rotating machines and temperature setpoints for heating equipment over time. Also, the process may occur in various conditions, comprising of static conditions such as different line locations, as well as other dynamic conditions like scheduled crew sequence, aimed dimensions of products changing over batches, and time info of process runs. Sensor measurement outputs related to the observed process state may include actual measured RPMs, and temperature changing over time. In addition, there may be target measurement outputs related to the process performance or KPIs such as the actual produced dimensions of products. The dynamic DPDM provides optimal actions for different conditions over time reducing the error between actual and aimed produced dimensions.</p><p><strong>Energy Consumption Prediction and Control</strong></p><p>In a similar manner, if we use an example from predictive control for energy consumption in a steel mill with rechargeable batteries, the target outputs may be total consumed energy per unit time or a defined peak usage per period (e.g., monthly peak usage of any 15-min cumulative consumed energy upon which the electricity cost is dependent), which we will optimize with controllable action inputs of battery discharging or recharging. With predictions of future peak energy consumption, batteries can be set to discharge to reduce the direct energy usage from the electricity supplier and shave off peak usage. On the other hand, predicting future low energy consumption can enable batteries to be recharged during the time without increasing electricity cost. Sensor outputs would include elapsed duration times since different events like heat start, meltdown start, load and tap. Condition inputs specific to the properties of heats (e.g., raw material, steel grade, temperature) would vary when there are transitions in heats or batched tasks.</p><p><strong>Asset Health or Fleet Health Maintenance</strong></p><p>To illustrate the predictive maintenance for assets in a plant, target outputs would be the remaining time to different types of failures of assets or components, while controllable actions would be replacement and/or inspection actions. Conditions might indicate the asset type, location, component type (often given in hierarchical categories), historical data and planned schedule of operation usage (e.g., asset and component runtimes) and external temperature (if relevant). Sensor outputs would include all key sensor measurements relevant for indicating the observed process state. Note that our deep probabilistic model simulates the probabilistic distribution of the remaining time to different types of failures for any given future conditions and actions. We optimize the risk-based maintenance action policy for a given cost objective, using process simulations.</p><p><strong>Demand Prediction and Supply Management</strong></p><p>We can use the same framework for a business dynamic process in demand forecasting and supply chain management involving different and hierarchical regional, temporal, channel, and product sales conditions. For example, we could model the inventory and demand levels for a wide variety of stock keeping units (SKUs) that belong to certain families/categories at a variety of sales/distribution centers belonging to specific regions within the global supply chain. We would want to take into account the temporal nature of these variations as well as incorporate external signals, such as market signals or internal planning information. The process would involve dynamic control actions like price and promotions influencing the demand, and safety stock levels, expedites, inventory rebalancing, and production changes influencing the supply. There would be sensor outputs related to the process state like current inventory levels, production quantities, and competitors’ sales trends over time. Some target outputs to be predicted and optimized could include value at risk, such as a composite of lost sales, inventory holding costs, expedite costs, obsolescence costs, and contractual penalties, and sales order volume over time.</p><p><strong>Conclusions</strong></p><p>In this article, we have overviewed our Deep Probabilistic Decision Machines (DPDM) approach to build a data-driven &amp; knowledge-augmented deep-probabilistic predictive simulation model of dynamic processes and use it for decision making and control in a model-based RL/MPC framework. This generalizable solution framework for deep probabilistic decision-making AI is based on the concepts of actions, conditions, sensors and targets for modeling actionable &amp; hierarchical systems. Dynamic latent states compress experiences and obtain key sensory features for predictable and explainable models. The generative model can be used for simulating the likely future observation sequence for any given future (or counterfactual) condition and action sequence at a process state. This also enables model-based decision making and control. Application areas include predictive quality control, energy prediction and control, asset health maintenance, production scheduling, and demand prediction and supply management in enterprise AI. DPDM applications and results in a growing number of client problems present a great opportunity of this framework. In our next articles, we will tell you concrete application examples of Static and Dynamic DPDMs.</p><p><strong>Citations and Extrapolations</strong></p><ol><li><a href="https://www.quantamagazine.org/to-build-truly-intelligent-machines-teach-them-cause-and-effect-20180515/"><em>Judea Pearl argued</em></a><em> that the field of AI got stuck in probabilistic associations, correlations, curve fitting or the “associative” level of the three layer causal hierarchy.</em></li><li><em>The causal model infers the probabilistic latent state Z of the process to represent key hidden features and capture the uncertainty due to incomplete observations.</em></li><li>Thinking Fast and Slow</li><li>The Book of Why</li><li>The AI R&amp;D team (Santiago Olivar; Hershel Mehta; Young Chol Song; Siva Devarakonda)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f65552409b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/noodle-labs-the-future-of-ai/deep-probabilistic-decision-machines-for-building-a-causally-generative-process-model-based-action-3f65552409b8">Deep Probabilistic Decision Machines for Building a Causally Generative Process Model-based Action…</a> was originally published in <a href="https://medium.com/noodle-labs-the-future-of-ai">Noodling on The Future of AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enterprise & Industrial AI Modeling]]></title>
            <link>https://medium.com/noodle-labs-the-future-of-ai/enterprise-industrial-ai-modeling-9840e9c7bb53?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/9840e9c7bb53</guid>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[supply-chain]]></category>
            <category><![CDATA[industrial-ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Sun, 04 Nov 2018 07:29:18 GMT</pubDate>
            <atom:updated>2018-11-04T07:29:18.545Z</atom:updated>
            <content:encoded><![CDATA[<h4>How it’s Done</h4><p><em>by </em><a href="https://www.linkedin.com/in/denesuk/"><em>Matt Denesuk</em></a><em>, Ph.D., </em><a href="https://twitter.com/noodleCDSO"><em>Chief Data Science Officer</em></a><em>, </em><a href="https://noodle.ai/meet-noodle"><em>Noodle.AI</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*egyuak9401doSmhnSL8e7Q.jpeg" /></figure><h4>Introduction</h4><p>My earlier paper¹ described how Enterprise &amp; Industrial AI differed from more popularized applications of AI. The latter tended to be more “mature” (i.e. at the later stage of creating solutions to the problem) and also tended to be targeted at things that humans can already do very well (things like facial recognition, natural language understanding, driving a car). Enterprise and Industrial AI problems (e.g. problems in supply chain planning or industrial operations management) tend to be much less mature and require different approaches, skills, expectations, and planning. This paper takes a high level view of how this can be accomplished.</p><h4>Enterprise &amp; Industrial AI Philosophy &amp; Approach</h4><p>Why should enterprise and industrial firms care about AI? Fundamentally, it’s because AI will help them understand their business better and enable them to make far better operational and strategic decisions.</p><p><em>It’s simple</em>:</p><ol><li>There are questions that enterprises need answered if they are to perform better, and AI can help them do this.</li><li>By combining good data, mathematical operations, and business expertise, you can construct an AI workflow/solution that can answer these questions.</li><li>Successful execution requires translation of this AI workflow into a set of specific and sequenced trained algorithms expressed in a readily-usable application that, in aggregate, produce answers that move critical business KPIs by amounts that matter.</li></ol><h4>Philosophy</h4><p>Philosophically, one can distinguish two very different ways of looking at a data set, and in sense, at the AI-accessible world. At the risk of oversimplifying or creating idealized prototypes or even caricatures, we can label these as <em>computer scientist</em> and <em>regular scientist</em>¹.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*PZ5t9ZJXqCcDht5zFdtqqw.png" /><figcaption><strong>Figure 1</strong>. Two ways of seeing a data set (and the world)</figcaption></figure><p>A prototypical computer scientist may see their job as needing to <em>get to the knowledge that’s currently locked up in the data</em>. They see the data essentially as a record of everything relevant that has happened — for example, all the customer transactions that occurred last month, or all friendship links between members in a social network — and the job at hand is to exhaustively probe the data to uncover any useful patterns, rules, or relationships manifest within the data set.</p><p>The prototypical <em>regular scientist</em>, on the other hand, sees their job more broadly as needing to <em>get the knowledge, using any resources you can muster</em>. Such a person sees the data set as a partial, often noisy, reflection of some underlying complex phenomenon. The job at hand is then to take that data, combine it with any other knowledge or information available, and use it all to obtain a better understanding of the phenomena, probably through mathematical model or some other abstract representation. Examples might include understanding what’s going on inside a star given the emission spectra hitting the earth. One would need to understand and incorporate knowledge of nuclear chemistry and gravity, which themselves were the result of data analysis + other knowledge &amp; information. That knowledge is not contained in the spectral emissions which constitute the data set at hand.</p><p>Some problems are relatively self-contained and can be adequately addressed using a predominantly <em>computer scientist</em> approach. But many problems are sufficiently messy, either intrinsically or simply in the sense that sufficiently good data are not available, that a more <em>regular scientist</em> approach and the incorporation of knowledge from other domains and other experiences is needed².</p><h4>Modeling Approaches</h4><p>There are three distinct and complementary modeling approaches that can be employed when addressing Enterprise AI &amp; Industrial AI problems (Fig. 2).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*kdycrQ_iJlear34pvsc-cw.png" /><figcaption><strong>Figure 2</strong>. Three types of modeling approaches that should be used together in Enterprise &amp; Industrial AI.</figcaption></figure><p>By far the most commonly deployed in practice may be termed <em>empirical, heuristic rules, and insights</em>. This is generally consists of the various rules determined or otherwise intuited by experts deployed in some operational system. Example rules would be “Replenish inventory when level is below x% of year-ago monthly demand” or “Stop process if thermocouple 20 exceeds 450C.” They can also be compounded, such as “Issue an alert if pressure is above 500C while pressure is rising faster than 0.5MPa/minute.” This kind of modeling approach is generally used and favored by operators of equipment. Systems embodying this approach are easily deployed. Operators are comfortable with them because they are also easy to understand. They also serve the purpose of capturing the knowledge of an operation’s experts over time. Constituent rules tend rarely to be updated or optimized, however, and over time as new rules are added, the accumulation often results in overwhelming (or excess) numbers of alerts and reduced utility of the alerting system.</p><p><em>Theory-based models</em> tend to be developed by the designers or manufacturers of equipment, or by deep technical process experts. In industrial cases, these are often called engineering-based, or <em>physics-based models</em>, but they can be employed in more general enterprise cases as well if one can obtain relevant theory/models, for example from the marketing science literature, the supply chain system literature, etc. When available, they can be very powerful, as they require less data — the system knowledge is already contained in the form of the model structure itself. Specific factors or coefficients/parameters in theory-based models can also be used to drive more powerful domain-based feature engineering. For example, rather than using raw sensor signals as features in a predictive maintenance application, one could use a particular nonlinear combination of these from an engineering model that better represents a cause of damage, such as corrosion or excess stress.</p><p>Pure <em>data-driven techniques</em> are what many consider exclusively when they talk about data science or AI today. These include all the techniques falling under the umbrellas of machine learning, deep learning, advanced visualization, statistics, and optimization. Using data-driven techniques, models are in essence automatically learned from the data, with little explicit programming or assumptions involved.</p><p>If one had an infinite amount of perfect data, and limitless compute and storage capability, these would be the only class of techniques one would need. And in many cases, they do perform quite well on their own, with little help from other approaches. But in cases frequently encountered in Enterprise and Industrial AI, where the data are often scarce, heterogeneous, sparse and of low quality, combining data-driven techniques with other approaches can be very powerful and decisive in justifying deployment by achieving sufficient business KPI movement.</p><h4>Example: Combining Data-driven with Theory-based approaches</h4><p>An example of a data-driven solution is shown in Figure 3(a), which pertains to predictive management of an RH Degasser, used to degas and help remove or control impurities in molten steel. A machine-learning-based module (ML) takes as input the operational settings and factors, the relevant sensor data, and actual measured or recorded performance and maintenance data (the latter being the “labels” or the outputs that one wants to be able to manage better). Based on the historical relationships between these three streams of data, the ML-based module can then be trained semi-automatically to issue alerts or warnings when there is enhanced risk of performance degradation or a machine fault that may require unplanned maintenance.</p><p>Frequently, the challenge with such solutions relates to what is often termed the “High Dimension, Low Sample Size” (HDLSS) problem, in that there are a large number of potential cause related factors (all the sensor feeds, operating conditions, etc.), yet the events of interest (such as faults and failures) are comparably rare. Even when in aggregate such events may be frequent, individual instances often possess unique etiologies and thus in effect partly require their own training data. In addition, there is frequently a great deal of movement in the individual sensor feeds, as expected in accord with the physics and engineering of the machinery. In using a data-driven approach, however, data scientists are essentially asking the ML-system to re-create ~300 years of physics and engineering from these sensor data, and then to also identify when and how things are working differently than they should be. As might be expected, such solutions are frequently ineffective and either are not deployed or issue so many alerts that they are of little value.</p><p>If the data scientist has access to engineering and/or physics-based models of the machinery in question (the RH Degasser, in this case), a solution such as shown in Figure 3(b) can be constructed. In this case, the operational settings and factors are inputted to these pre-existing models, which are then used to predict what the sensor value <em>should be</em>. One can then take the difference between these predicted sensor values and the actual sensor values and input these so-called residuals into a data-driven ML system along with the actual performance or maintenance data. The set of residual sensor values compose a <em>much cleaner </em>set of signals in that they represent the <em>deviation</em> from ideal machinery behavior, not just the raw behavior itself. The predictions, prescriptions, and optimizations that result from such a system typically far outperform those from a pure data-driven-based system.</p><p>In cases where the engineering and/or physics-based models are not sufficiently complete to make predictions of the sensor values, and thereby produce the signal-rich residuals, we can still use them to create highly-engineered features to be used in traditional data-driven ML models. These engineered features, rather than representing only trivial combinations or raw sensor features, can capture actual drivers of degradation or performance in the machinery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Sy-M_wcbArhNhcfrYaw_7Q.png" /><figcaption><strong>Figure 3</strong>. Example using Theory-based Knowledge to supplement a pure Data-Driven Approach.</figcaption></figure><h4>High-level Process View of the Approach</h4><p>A systematic approach to doing this is summarized in Figure 4 below, and explained in more detail in the subsequent text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*LjLJAfxat9YASBDOLTd93A.png" /><figcaption><strong>Figure 4</strong>. Systematic approach to successfully creating Enterprise &amp; Industrial AI Solutions.</figcaption></figure><h4>Business Process &amp; KPI Modeling</h4><p>It is important to begin with an understanding of the business processes relevant to the problem area and the important KPIs that the business cares about. These KPIs may be financial (e.g., profit per hour on the production line, unit revenue) or operational (e.g., system uptime, yield loss, safety events) in nature, but there should be a clear and quantitative understanding of how and why these KPIs are important to the business. Ultimately, the solution’s value will be judged by how well it moves these KPIs, not by technical model metrics.</p><p>The business process should be understood mechanistically and quantitatively, to the extent that one can readily relate improvements in process steps (e.g., time reduction, yield improvement, variability reduction) to overall KPI impacts. Analysis using this business process model should uncover the key constraints or bottlenecks where an AI-based solution would have the greatest impact.</p><h4>Problem Framing</h4><p>With the business process at least partially understood, one should attempt to frame or define what part of the process, and what specific kinds of recommendations and/or predictions should be targeted in order to move a specific KPI. The data available should be simultaneously assessed and judged for the likelihood that they will support a model sufficient to move the KPI by an amount that justifies the solution³.</p><p>In a supply chain problem, for example, one might target causal predictions and corresponding recommendations to prevent out-of-stock events. This means we would need to confirm at the very least that relatively complete data are available covering stock levels and various other potentially causal factors. We would also need to baseline the current lost sales due to out-of-stock events, and confirm that a realistic reduction in such events has a sufficient economic/KPI impact.</p><p>Looking at the example of an industrial maintenance management problem, a highly desirable <em>problem framing</em> may be to prevent unplanned downtime by predicting failures within certain critical machinery sufficiently far in advance to schedule and perform preventative maintenance. But if it turns out that insufficient data are available, we might decide to re-frame the problem as predicting aggregate demand for specific machine components and maintenance skills, and optimally managing labor availability and replacement parts inventory to minimize the <em>length</em> of unplanned downtime (rather than its actual occurrence).</p><h4>A Simple Taxonomy of Framings</h4><p>Most problem framings ultimately take form to either estimate or predict an unknown measure, or recommend or otherwise determine an optimized/preferred action. A simple breakdown with some examples is provided below:</p><p><strong>Estimate some unknown measure</strong>. This measure often relates to the future, in which case it’s considered a forecast or a prediction. But it can also relate to the outcome of a suppositional case. Some examples:</p><ol><li><strong>Forecast. </strong>Such as:</li></ol><ul><li>What is the week-by-week unit sales demand for this specific tire SKU over the next 3 months?</li><li>How many people need to fly <em>JFK-SFO on March 12?</em></li></ul><p><strong>2. Time-to-event (or event risk)</strong>:</p><ul><li>What the probability that this gas turbine<em> will fail in the next 2 weeks?</em></li><li><em>How likely is this business client to default on this loan in next 2 years?</em></li></ul><p><strong>3. Conditional prediction</strong>:</p><ul><li><em>If I offer a 5% discount, how many more Nissan Sentras will I sell next month?</em></li><li><em>If I uniformly raise airline seat prices between DFW and SFO by 10%, what will be the effect on bookings and on revenue for that airport pair?</em></li></ul><p><strong>4. Conditional estimation</strong>⁴:</p><ul><li>What would be the<strong> </strong><em>hardness of a 0.21%C steel if annealed at 908˚C for 12.4 hrs?</em></li></ul><p><strong>Optimal Actions, Settings, or Recommendations (executed/prescribed)</strong></p><p><strong>1. Discrete</strong>:</p><ul><li><em>Offer promotion A to customer X today</em></li><li><em>Dispatch truck 21 to location B16–2 now</em></li><li><em>Schedule inspection on engine G1473 this Thursday.</em></li></ul><p><strong>2. Continuous</strong>:</p><ul><li><em>Set price for this ticket to $378</em></li><li><em>Order 850 units of inventory to DC#21 by tomorrow</em></li><li><em>Set process T=1485˚C &amp; ramp down to 785˚C @25˚C/hr</em></li></ul><p>Successful <em>problem framing</em> is currently part art, part science, and is often <em>the highest leverage point in producing a high-value solution for an Emerging AI Problem.</em></p><h4>Problem Setup</h4><p><em>Problem setup</em> is the process of constructing a particular data and modeling workflow that generates an output validated in the problem framing as being positively impactful to the business problem in question. Problem framing and setup are both typically adjusted in an iterative manner until a workable solution that moves the chosen business KPI sufficiently is obtained.</p><p>Problem setup is typically done by highly-experienced data scientists, preferably supported by domain experts. They generally avoid considering specific algorithms and focus on using functional capabilities at a higher level of abstraction, e.g., clustering, classification, regression, pattern ID, rule inference, decomposition, statistics, optimization, simulation.</p><p>A <em>problem setup</em> is preferably represented as workflow, or more technically as a “Directed Acyclic Graph” (or DAG), which demonstrates the flow of data, transformation, and other operations.</p><h4>Algorithmic Implementation</h4><p>It turns out that, given the available data, most <em>problem framings</em> and/or <em>setups</em> cannot produce output that meaningfully improve the business KPIs of interest. So the data scientist has to iterate through new framings and setups until a suitable solution is discovered. This can require considerable time and effort.</p><p>To evaluate a particular problem framing/setup, we need to develop an <em>algorithmic implementation</em>. Based on particulars of the data, and precisely what we are attempting to achieve with a particular element in the DAG, the data scientist would select one or more basic algorithms to employ for each element⁵. Each element must then be coded using one or more specific instantiations of the given algorithm (which could be open source, custom-coded, or from a proprietary vendor).⁶</p><h4>Evaluation &amp; Iteration</h4><p>Once an algorithmic implementation is complete, we must select and employ an appropriate technical evaluation approach to ensure the technical suitability of the model (in terms of factors such as error characterization, overfitting risk, drift potential, etc.). But the ultimate arbiter of success is whether and to what extent the model can move the business KPI of interest. One generally must keep iterating back through Framing, Setup, Implementation and Evaluation until a technically valid and business impactful solution workflow is obtained.</p><h4>Scaling</h4><p>The approaches and processes described above constitute the key elements for how to identify, frame, and develop AI-based solutions for Industrial &amp; Enterprise firms. But once a solution to address a given part of a business or industrial process is built, it is desirable to improve and scale it, and to put it on a path of continuous improvement. The ultimate aim is to reach a state where new implementations are done with a substantial amount of “asset reuse,” by which we mean the reuse of tools or granular high-value components to accelerate and/or remove risk from the delivery of a solution or application. These kinds of asset reuse are common in general software development, and the assets and methodologies associated with this can often be considered quite mature. Such asset reuse is generally quite immature in the context of the AI-enabled applications, however, creating enormous value potential for organizations that can systematically and consistently bring substantial levels of reuse to such applications. A process for doing this may be generalized as (see Figure 5):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*gjtEGMCD4jO9yDJ6eAntXA.png" /><figcaption><strong>Figure 5</strong>. Pathway to scaling Emerging AI problems to become more like Mature AI Problems.</figcaption></figure><p>Once a solid <em>problem framing</em> has been achieved, and or more well-performing <em>problem set-ups</em> are constructed, it is possible to begin <strong>standardizing</strong> how this is done in similar operations within the business, or in other related businesses, and to define a sequenced or iterating set of abstract <strong>modules</strong> that compose the solution. This in turn enables the assignment of skills and other resources <strong>specialized</strong> to each module, so deeper domain knowledge may be more readily acquired and incorporated, and greater skill particular to each module begins to accumulate.</p><p>This also permits us to begin moving away from basic <em>algorithmic implementation</em>, and to focus more on <em>algorithmic enhancement, innovation, and optimization</em>. At this point, we would be well on our way toward moving from what would originally be termed an “Emerging AI Problem” toward a more “Mature AI Problem.” This brings along with it the consequent benefits in performance enhancement, scalability, and continuous improvement. We can expect steady improvement in performance from adding more of the same kinds of data, tweaking and incrementally enhancing the algorithmic implementations, and riding the wave of enhanced computational power and architectures.</p><p>Over time, these can be hardened and more rigorously <strong>assetized</strong>, ultimately forming components of highly-scalable or<strong> productized </strong>deployments.</p><h4>Summary</h4><p>Enterprise and Industrial AI¹ are different from other kinds of AI. Failure to recognize this has resulted in tremendous resource misapplication and is largely to blame for the low success rates of related solution deployment (around 10–15% by many counts).</p><p>It’s important to understand that most Enterprise and Industrial AI problem formulations are not adequately solvable given the data that are actually available. This is why a solid understanding of the business processes being addressed and the corresponding important business KPIs is critically essential. This permits flexibility to adjust the problem formulation and problem setup until a suitable combination is found which, given the data available, support a solution with sufficient business value to justify full deployment. <strong>Ongoing business investment requires clarity that critical business KPIs will move sufficiently.</strong></p><p>Increasing success levels frequently requires deep integration across typically disparate but complementary areas that are not accustomed to working together so intimately. These areas or disciplines often bring their own, relatively unique, philosophies of, and approaches to, problem solving. This includes integrating the newer “data-driven” modeling approaches with the more commercially established rule-based techniques and the powerful theory-based approaches. The power of <em>pure data-driven approaches can be dramatically accelerated and increased by integration with prior human-generated knowledge</em> expressed in rules and systems-based or physical-based theory.</p><p>We expect that “Enterprise and Industrial AI” will ultimately be seen as a new field bridging mathematical sciences, business process, domain science, user experience, design technology, and infrastructure engineering. This field will begin to have its own conferences, journals, textbooks, and university departments and specializations. Its impact on the global economy, global resource management, and on “how the world works,” will be fundamental.</p><p>—</p><ol><li><em>See Noodle.ai White Paper</em>, “<a href="https://medium.com/noodle-labs-the-future-of-ai/whats-different-about-enterprise-industrial-ai-3cf4ce42540c">What’s Different about Enterprise &amp; Industrial AI, and Why Does it Matter?</a>”</li></ol><p><em>2. This can be seen as a form of “Transfer Learning”, where knowledge obtained from related or constituent prior experience is employed to compensate for insufficient data.</em></p><p><em>3. At this stage, the data understanding will often be thin, and one can only make a rough assessment of its suitability for a particular framing. Thus nearly every process discussed in this paper is highly iterative.</em></p><p><em>4. The distinction between prediction and estimation can be blurry. And it relates philosophically to how fundamentally different a “time” feature is. Predictions or forecasts are often presumed as intrinsically non-deterministic, since they pertain to a time which does not exist at the point the forecast or prediction is made. More practically, estimation is fundamentally time independent. It’s based on physics and/or logic, and is thus is deterministic (ignoring all the physics/logic philosophy stuff with quantum theory, chaos theory, etc.).</em></p><p><em>5. Example high-level algorithms are K-means, SBM, OLSR, LR, LASSO, SVM, GBM, RF, kNN, GMM, Apriori, EM, NN, CNN, RNN, RBM, AE, Word2Vec, Sent2Vec, Doc2Vec, LSTM, KF, NB, HMM, RL, GAN, FT, PCA.</em></p><p><em>6. It should be noted that advances in “Auto-ML”, where a diverse set of algorithms are automatically tested and evaluated, can often speed up this process considerably.</em></p><p>—</p><p><em>Photo by </em><a href="https://unsplash.com/photos/txQT60OPSwA?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><em>Mimi Garcia</em></a><em> on </em><a href="https://unsplash.com/search/photos/neon-chart?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><em>Unsplash</em></a></p><p><em>Follow us here for more on the future of AI. You can also find Noodle AI on </em><a href="https://twitter.com/NoodleAI"><em>Twitter</em></a><em>, </em><a href="https://www.linkedin.com/company/noodle-ai/"><em>LinkedIn</em></a><em>, </em><a href="https://www.youtube.com/channel/UCO0MCcdP32KePKg6pm-8wmw"><em>YouTube</em></a><em>, and get our latest insights </em><a href="https://info.noodle.ai/getnoodlenews"><em>via our newsletters</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9840e9c7bb53" width="1" height="1" alt=""><hr><p><a href="https://medium.com/noodle-labs-the-future-of-ai/enterprise-industrial-ai-modeling-9840e9c7bb53">Enterprise &amp; Industrial AI Modeling</a> was originally published in <a href="https://medium.com/noodle-labs-the-future-of-ai">Noodling on The Future of AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s Different about Enterprise & Industrial AI]]></title>
            <link>https://medium.com/noodle-labs-the-future-of-ai/whats-different-about-enterprise-industrial-ai-3cf4ce42540c?source=rss-6f8f5a0d167------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cf4ce42540c</guid>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[mature-ai]]></category>
            <category><![CDATA[complex-problem-solving]]></category>
            <category><![CDATA[industrial-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Noodle.ai]]></dc:creator>
            <pubDate>Sat, 06 Oct 2018 19:31:42 GMT</pubDate>
            <atom:updated>2018-11-04T07:31:25.777Z</atom:updated>
            <content:encoded><![CDATA[<h4>and Why Does it Matter?</h4><p><em>by </em><a href="https://www.linkedin.com/in/denesuk/"><em>Matt Denesuk</em></a><em>, Ph.D., </em><a href="https://twitter.com/noodleCDSO"><em>Chief Data Science Officer</em></a><em>, </em><a href="https://noodle.ai/meet-noodle"><em>Noodle.AI</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_o81YbJg_qxXhHaZFWiWhQ.jpeg" /></figure><h4>Why does AI matter to industrial firms and traditional enterprises?</h4><p>Throughout modern business history, industries that have become substantially all about “data + math” have seen both enormous gains in productivity as well as disruption of business models and business leadership. Today, we call this <em>digital transformation</em>. Financial services and banking, which began their transformations at the dawn of the computer age, are among the earliest examples of industries transformed. Since then we’ve seen many more examples in telecom, media and entertainment, retail, and other industries. Firms like Netflix and Amazon have become leaders in both broadcasting and content creation; Amazon is dominating increasing amounts of the retail and distribution sectors; and online video games and social media have overtaken more traditional forms of recreation.</p><p>This has dramatic implications for firms currently in these industries who have not fully embraced digital transformation, as they face displacement or gradual marginalization if they are not quick to establish a strategy and rapidly begin executing.</p><p>In industries that are lower on the curve in terms of digital transformation, opportunities are present to establish new leadership and drive the very transformations that will reshape these industries in the future. This is especially the case with very physical industries such as transportation, energy, steel, and mining. Early-adopting firms are presented with opportunities to transform the way things are done, resulting in changes in business performance and the firm establishment of new leaders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*vmZDkrkxNqMRz-1LSTpt3Q.png" /><figcaption><strong>Figure 1</strong>. Digital transformation is happening in many industries, with enormous global impact.</figcaption></figure><h4>What are Enterprise AI &amp; Industrial AI?</h4><p>We term the core technologies and processes driving these transformations in the modern era “Enterprise AI &amp; Industrial AI.” There is an overwhelming level of noise about “AI” right now, and it can be very difficult for business leaders and practitioners to keep up, to understand what it all means to their business, and how to get started in applying it.</p><h4>Mature AI</h4><p>Understand first that most of what you hear from the media today (including the tech media) refers to a class of problems that may be termed “Mature AI.” Such problems generally have the following characteristics:</p><p>1. The problems are clearly identified and articulated. It is taken as self-evident that the solution is intrinsically dependent on AI.</p><p>2. The data sets used are massive, well-curated, and often purpose-generated. For example, the sensors and data capture policies for self-driving cars were designed and placed from the beginning to generate the very data that AI models would need in order to be trained effectively. These cars are then driven billions of miles in the real world–and even more in a virtual sense via simulation¹, which can be used to generate enormous volumes of additional data and training. The data in Mature AI areas are also typically well-labeled; for example, images labeled with their contents, faces linked to correct individuals, or text in one language linked to correctly translated text in another language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*bWuLyUSh-p_1RrVTpAxJYQ.png" /><figcaption><strong>Figure 2</strong>. Data characteristics of several Mature AI application areas.</figcaption></figure><p>3. The business value of the work is generally taken as self-evident, and there is a shared expectation of slow, steady progress with substantial sustained investment presumed. It’s taken for granted that a 0.5% improvement in the accuracy of a face recognition algorithm is worthwhile, or even a slight reduction in risk for a self-driving car is worth achieving and paying for.</p><p>4. Mature AI areas often have huge global research and engineering communities associated with them. These communities curate and publish journals and hold information exchange conferences dedicated to the vital technical elements in these areas. One can find many professional journals, conferences, and societies dedicated to speech recognition, image and object recognition, and so forth.</p><p>5. The performance of the models and applications in Mature AI application areas is generally driven incrementally, in a steady way that can be likened to a “Moore’s-Law-like progress.” The central contributors to this are:</p><ul><li><strong>Continual additions of more of the same kinds of data</strong> — more labeled images, more translated docs, more miles driven (real or virtual), etc.</li><li><strong>Riding the curve of increasing processing power and architectures</strong>. This includes the steady increases in CPU or GPU speed and parallelism, improvements in storage and retrieval systems and so forth. One just keeps upgrading equipment and systems as they become available.</li><li><strong>Tweaking of core algorithm performance</strong>. AI models have many “knobs” that can be tweaked, such as structure and depth of a neural network, the various hyperparameters that finely tune the inner operations of many algorithms, and finer segmentation of key problem cases. After initially finding appropriate settings, continuing to tweak these can result in modest improvements over time.</li></ul><h4>Emerging AI</h4><p>It’s easy to make the mistake of thinking about problems in “Emerging AI” areas as if they were in Mature AI areas. This can lead to confusion, misapplication of resources, and failed AI efforts.</p><p>In particular, most problems in Enterprise AI &amp; Industrial AI are not mature in the sense described above, and in fact typically fall into either what may be termed “Emerging AI,” or, for those that have moved somewhat toward a more mature path, “Transitional AI.” The strongly differing characteristics of such problems from Mature AI problems requires focusing on different kinds of activities and taking different approaches than those that are suitable for Mature AI problems.</p><p><em>“Emerging AI” problems generally have the following characteristics</em>:</p><p>1. The problems are often ill-formed as AI problems, meaning that there is no clear linkage between a nominal business problem being posed and a technical problem whose solution would materially help address that business problem. In these cases, the ultra-critical step of defining what the technical problem is has not yet been completed. This is an opportunity, because it means there is great flexibility in terms of mapping the business problem to a good and tractable technical problem, but it also means there is much work left to do before even starting in earnest on the model development. It also means there is not very much precedent or prior work for one to leverage or build upon. Another complication can result from the fact that the business problem in question is generally currently being addressed by other means (e.g., spreadsheet calculations, rule-based software, dashboards + humans, etc.).</p><p>2. The data sets tend to be scarce, heterogeneous, sparse, and of low quality. Enterprise data capture systems and policies were generally put in place for compliance or reporting, not for AI. Industrial operations data capture systems and policies were generally put in place for control, basic monitoring, or post-event trouble-shooting. If data are not essential for one of these things, they are typically not recorded. Even if they are recorded, they are often discarded after some nominal holding period. These restrictions severely hamper the modeling approaches that can be used, as well as the ultimate model accuracy that can be achieved. In addition, each customer tends to have their own unique data models, data capture policies, and data architectures. A developed solution for one environment or customer does not generally apply to another environment or customer, even when the nominal business problem is quite similar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*xpoS23KQzz5DEcQZbolmQw.png" /><figcaption><strong>Figure 3</strong>: Data characteristics of several Emerging AI application areas.</figcaption></figure><p>3. Potential business value is not taken for granted. Many customers require being convinced that AI can be relevant to their business, and that an investment in AI is justified. They typically want to take slow, baby steps and see measurable business impact before justifying the next step of incremental investment. This requires communicating effectively with and winning over diverse sets of stakeholders. It also requires creating a roadmap of delivered capabilities, where each step can demonstrate its own strong and positive ROI as it builds on the prior step.</p><p>4. Research and Engineering communities, relevant journal articles, and relevant technical conferences are generally fragmented and thin. There is typically no global community of deep expertise for Emerging AI practitioners to rapidly develop and share technology and ideas. Each team or provider company is essentially its own, segregated community, which slows development of best approaches and practices considerably.</p><p>5. The performance of the models and applications in Emerging AI application areas is thus driven by very different factors than for Mature Areas. Model or application performance in Emerging AI is generally driven by creative invention in several specific areas:</p><ul><li><strong>Problem Framing and Setup</strong>. “<em>Problem Framing</em>” is the understanding of a business process and important key performance indicators (KPIs), the subsequent articulation of one or more math problems that relate to key constraints in that business process, and the assessment of whether suitable data are available. “<em>Problem Setup</em>” is the process of constructing a particular data and modeling workflow that generates output that can be used to improve the business process. These are both typically adjusted in an iterative manner until a workable solution that moves the KPI sufficiently is obtained. Successful problem framing is currently part art, part science, but is absolutely essential to producing a high-value solution.</li><li><strong>Acquisition and use of new data sources</strong>. The introduction of a new data source, whether internal or external to the company, can often have more impact in the short term than model or algorithmic improvements. For example, things like the use of weather data for modeling tire wear, using hotel occupancy rates or pricing for models for airline revenue management; or leveraging current commodity prices as an additional input for optimizing financial performance of a manufacturing operation. These types of external data sources can significantly improve model performance.</li><li><strong>Effective use of domain knowledge and prior experience</strong>. Especially because the data are typically scarce and lacking in other ways, incorporating prior knowledge, for example in the form of engineering or theory-based equations, highly engineered model features, and even partially pre-trained model components, can enable an effective solution to be built despite the severe inadequacies of the data². In some cases where accurate simulations are available or can be created, such simulations can be very helpful as well.</li><li><strong>A yet unknown breakthrough</strong>. There is so much economic and societal value to be unlocked that many organizations (public, private, for-profit, not-for-profit) in many nations are feverishly working on breakthroughs to address this³.</li></ul><p>As you might expect, in terms of basic model performance parameters Emerging AI solutions are typically substantially below those for Mature AI problems, as one would expect in terms of model performance parameters. Thus the performance levers for such Mature AI problems, which tend to create impact in small, incremental amounts, are not as helpful for Emerging AI problems. The performance levers for such Emerging AI problems (outlined above), while requiring more creativity and time, can result in step changes in model and application performance, and thus should be the primary focus in such problem areas.</p><h4>In Closing</h4><p>AI modeling thrives with simple problem statements and massive amounts of high-quality data. Data scientists are not usually blessed with such situations when trying to address critical business problems for Enterprise and Industrial firms. The massive value that can be generated by the successful digital transformation of these kinds of organizations is giving rise to major efforts across the globe to make AI relevant for them.</p><p>It’s critically important to recognize that the approaches being used successfully to continually improve performance in Mature AI areas will not apply successfully to most Emerging AI problems. We must recognize the unique aspects of these immature problem areas and employ a set of approaches designed for them. This paper has given a broad outline of these approaches⁴. This should result in a maturing of many of these problem areas, gradually putting them on the more incremental and continual improvement trajectories we currently see with Mature AI problems. The resulting global economic impact will be staggering.</p><p>The sentiments expected as one moves up the maturity curve, along with the placement of a few selected problem areas, are shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*9pdkUUoJwvJFg_LY8aN0CQ.png" /><figcaption><strong>Figure 4</strong>. AI maturity curve, along with the sentiments associated with each phase, and example problem areas with approximate placement for each in terms of maturity.</figcaption></figure><p>—</p><p><em>1. Mature AI also frequently has access to sufficiently accurate simulators, such as driving simulators, which are very mature and well-simulate the results of nearly any driving action in a virtual environment.</em></p><p><em>2. See Noodle.ai Whitepaper: “</em><a href="https://medium.com/noodle-labs-the-future-of-ai/enterprise-industrial-ai-modeling-9840e9c7bb53"><em>Enterprise &amp; Industrial AI Modeling: How It’s Done</em></a><em>”</em></p><p><em>3. See Noodle.ai Whitepaper: “Coming Breakthroughs in Enterprise &amp; Industrial AI”</em></p><p><em>4. See future Whitepapers for more detailed elaboration.</em></p><p>—</p><p><em>Photo by </em><a href="https://unsplash.com/photos/oqStl2L5oxI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><em>Clark Tibbs</em></a><em> on </em><a href="https://unsplash.com/search/photos/neon-data?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><em>Unsplash,</em></a><em> Figures by Matt Denesuk</em></p><p><em>Follow us here for more on the future of AI. You can also find Noodle AI on </em><a href="https://twitter.com/NoodleAI"><em>Twitter</em></a><em>, </em><a href="https://www.linkedin.com/company/noodle-ai/"><em>LinkedIn</em></a><em>, </em><a href="https://www.youtube.com/channel/UCO0MCcdP32KePKg6pm-8wmw"><em>YouTube</em></a><em>, and get our latest insights </em><a href="https://info.noodle.ai/getnoodlenews"><em>via our newsletters</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cf4ce42540c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/noodle-labs-the-future-of-ai/whats-different-about-enterprise-industrial-ai-3cf4ce42540c">What’s Different about Enterprise &amp; Industrial AI</a> was originally published in <a href="https://medium.com/noodle-labs-the-future-of-ai">Noodling on The Future of AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>