Integrating Artificial Intelligence With Simulation Modeling
Integrating Artificial Intelligence With Simulation Modeling
com
Fall 2017
• The pervasive adoption of AI technology in business and society means that our
simulation models must reflect and adopt AI as well
• In the foreseeable future all but the simplest simulation models will incorporate
AI tech either in the model itself or in the development of the model
2
PwC | Artificial Intelligence Accelerator | 12/4/2017
Agenda
3
PwC | Artificial Intelligence Accelerator | 12/4/2017
Application of AI ranges from automating existing processes to disrupting markets
and business models
Disrupting your Core Business Innovating with New Services Redesigning your Business Model
Automate your business processes & augment your decision Innovate with new products and services for your Fundamentally redesign your business model or disrupt
making before other disruptors do it to you customers based on big data, analytics and AI adjacent markets based on your core capabilities
Example: Legal and accounting firms are using robotic and Example: Electronic retailers are using their extensive Example: Auto manufacturers are fundamentally
cognitive process automation, and blockchain to disrupt and transactional and behavioral data of their customers to offer rethinking their business model as ‘Personal Mobility’ service
re-engineer their business processes (e.g., Ross as a them new ways of trying, experiencing and purchasing their providers instead of manufacturers of vehicles to exploit
disruptor, PwC) products (e.g., Amazon with Alexa, Baidu with Chatbots) autonomous cars and car share/ride share trends (e.g., GM
with MAVEN, BMW with DriveNow)
Automating business processes with AI will soon become table-stakes, leaving the
differentiation to those using AI to change the way they interact with customers
4
PwC | Artificial Intelligence Accelerator | 12/4/2017
Artificial Intelligence is not a single technology. Here are five key areas that PwC is focusing
on. We consider simulation to be an AI technology.
• Unstructured data analysis for • Audio analysis used to identify sales call features and
Deep audio, image, and text assess traits of effective conversations
Learning • Automation and learning systems • Deep reinforcement learning used to learn optimal
operating policies for a rideshare business
• Information extraction, workflow • Tax workflow automation that could save the client
Natural automation, and text generation ~$65M annually
Language • Insights from unstructured data • Customer contact center complaint analytics platform
Understanding • Chat bots and IPA • Comprehensive chat bot study
• Industrial IoT • Predictive maintenance applying ML on oil/gas pump
• Streaming and real time data sensor streaming data in a scalable manner
Data at Scale • Large scale data processing
architecture
• Operations analysis • Designed a go to market strategy for a new personal
• Strategy support mobility service
Simulation • Consumer behavior modelling • Patent for autonomous vehicle resource management
• New market entry analysis in a rideshare environment
7
PwC | Artificial Intelligence Accelerator | 12/4/2017
Deep learning components can replace rules based models of human behavior and decision
making in new service and strategic simulation models
8
PwC | Artificial Intelligence Accelerator | 12/4/2017
AI techniques can address crippling optimization/calibration problems in large scale agent
based models
• Traditional optimization approaches often fail because they take much too long
• Machine learning and intelligent sampling approaches can be used to create meta models
that dramatically speed up calibration
– Meta models run much faster than the full simulation model
– Machine learning makes it possible to capture the non-linear behavior and
discontinuities in agent based models
9
PwC | Artificial Intelligence Accelerator | 12/4/2017
Example Problem: Autonomous
Vehicle behavior using Deep
Reinforcement Learning
A common application for simulation is develop “optimal” decision rules for agents in a
complex system. This is a problem that can be tackled with AI technologies combined with
simulation.
• PwC is working with a team at a large car company that is looking to roll out autonomous
vehicles for the purpose of transporting customers
• Using a very complex AnyLogic AB/DE model simulated vehicles that follow hand coded
rules to make their decisions
11
PwC | Artificial Intelligence Accelerator | 12/4/2017
Reinforcement Learning - an area of machine learning focused on teaching a computer an
optimal decision policy over time using rewards and penalties as signals
Key Takeaways
Simple Physics RL Examples
Cart Pole • The agent’s goal is to select
actions that maximize the
future reward
Pendulum Balance
• Representative model of how
humans learn from experiences
• We implement Deep
Reinforcement Learning for
more complex problems using
Deep Neural Networks
12
PwC | Artificial Intelligence Accelerator | 12/4/2017
RL Agent Vs Environment – RL is composed of two entities, the agent making decisions
and the world it is acting in. An Agent (Car) will communicate actions to the world and as a
result it will recieve a reward and a new observation.
State/Observation
Reward
13
PwC | Artificial Intelligence Accelerator | 12/4/2017
Deep Q Network – The CNN acts as a value function for a particular state and outputs a Q-
Value for each action. Depending on the action policy, the action that yields the highest value
is chosen by the agent and then performed in the environment.
Environment
• Exploration–Exploitation: є-greedy
Q- Value 2
(Action Up)
exploration is used where with
State
probability є choose a random action,
otherwise go with “greedy action
14
PwC | Artificial Intelligence Accelerator | 12/4/2017
Making it real: Integrating AI directly
into AnyLogic simulation
Specialized AI toolsets are fine for developing specific components but to model
entire systems we need to integrate AI directly into AnyLogic
Python is well known as the prominent language for data science toolkits. However, we needed a java-based library to achieve
our goal of integrating AI into an AnyLogic simulation.
With these requirements, we landed on Deeplearning4j (dl4j). Deeplearning4j is a commercial grade library designed for data
scientists in business environments. Whilst it is always recommended to research libraries for each use case, here are some dl4j
highlights:
• JVM-based distributed deep learning framework
• Dl4j leverages ND4J for data management which is also distributed
• Integrates with Hadoop, Spark and Kafka
• Strong documentation and community
16
PwC | Artificial Intelligence Accelerator | 12/4/2017
The deep learning model is constructed externally and may be trained before
integrating into AnyLogic
1a 2 3 4 5 6
Import NN to Run AnyLogic
Develop neural network Train neural Export NN Train NN inside simulation
AnyLogic as a simulation with agent
(NN) in Eclipse with dl4j network in dl4j (.jar file) model
dependency behavior driven by NN
1b
Build simulation model in
AnyLogic Simulation data
Training data
Optional Steps
17
PwC | Artificial Intelligence Accelerator | 12/4/2017
To explore this process we modified the “Schelling Segregation model” to train and
utilize a simple neural net that replaces the rules based agent decision
Agents evaluate whether there are The neural network is trained on ‘historical
enough like-minded neighbors each movement data’ i.e. data generated from the
time they move or a neighbor changes. rule-based simulation
Agents can also move randomly for no
reason
If there are enough like- If there are not enough Given the number of like-minded individuals
minded agents, they stay in like-minded agents, they and threshold, the neural network makes a
their current location move to a random location decision to move or not move
Both models converge but in the neural-network driven simulation, we arrive at the
result without prior knowledge of the relationship between threshold and like-
minded neighbor count
18
PwC | Artificial Intelligence Accelerator | 12/4/2017
AI can also be embedded into AnyLogic and used in replacement of manually
encoded behaviors or processes
• Pervasive AI in the real world means that we will have pervasive AI in our simulated world
as well
• AI will not only appear in our models but will help us build them as well
20
PwC | Artificial Intelligence Accelerator | 12/4/2017
Thank you
21
PwC | Artificial Intelligence Accelerator | 12/4/2017