Electric vehicle fire risk

In this tutorial you will learn:

  • How to perform training (parameter learning) to learn the probabilities in the factor graph

  • How to use inference to query the model and reason about probabilities

  • How to perform inference in the model editor or the Python SDK

  • How to interpret the results of inference

We will use an electric vehicle fire dataset as our example of choice (Chen et al. 2022). This network is simple and illustrates key principles that can be applied to other forms of risk management and mitigation in a business operation setting. We will attempt to answer the following:

Problem statement: Based on some known risk factors about an electric vehicle, what is the probability of an electric vehicle fire disaster?

The model files and sample data for this example is provided below:

Model file for the electric vehicle fire risk example before training
Model file for the electric vehicle fire risk example after training
Sample data for the electric vehicle file risk example

Network variables and categories

For this network we will use the following variables:

Variables
Categories
Description

ACF

[yes, no]

Air conditioning equipment failure?

AM

[yes, no]

Any artificial modifications to vehicle?

AWE

[yes, no]

Not aware of early fire?

BEP

[yes, no]

Blocked exhaust pipe?

BF

[yes, no]

Battery failure?

BO

[yes, no]

Battery overcharged?

CBI

[yes, no]

The car body is ignited?

CEF

[yes, no]

Charging equipment fault?

CI

[yes, no]

Collision ignition?

DTH

[yes, no]

Defroster temperature too high?

EC

[yes, no]

Electrical circuit failure?

ECF

[yes, no]

Electronic component failure?

FFE

[yes, no]

The vehicle is not equipped with fire-fighting equipment?

HF

[yes, no]

Human factor?

IS

[yes, no]

Ignition source?

ISC

[yes, no]

Risk of internal spontaneous combustion of electric vehicles?

MMA

[yes, no]

Man made arson?

OFE

[yes, no]

The early open fire was not extinguished?

REI

[yes, no]

Risk of external ignition?

SCB

[yes, no]

Short circuit in battery?

TLD

[yes, no]

Transmission line damage?

VFD

[yes, no]

Electric vehicle fire disaster?

Examining the network

Although the model is stored internally in Genius as a factor graph, it is often more intuitive to examine the Bayesian network. This network has the following structure:

Bayesian network for the electric vehicle fire dataset

Here are some things we can conclude from this network:

  • The probability of electrical circuit failure (ECF) depends on air conditioning equipment failure (ACF), defroster temperature too high (DTH), electronic component failure (ECF), and transmission line damage (TLD).

  • The probability of short circuit in battery (SCB) depends on battery failure (BF), battery overcharge (BO), and charging equipment failure (CEF).

  • The risk of external ignition (REI) depends on human factors (HF) (such as whether the car was artificially modified (AM) or if there was man made arson (MMA)) and whether the car body was ignited (CBI).

  • The probability of an electric vehicle fire disaster depends on whether the early open fire was not extinguished (OFE), the risk of external ignition (REI), and risk of internal spontaneous combustion of the vehicle (ISC)

Parameter learning

Unlike the medical diagnosis and insurance examples, here we will assume that while the Bayesian network is known for this task, the probabilities for each factor (parameters) are not known. Therefore, we will need to go out and collect data from the real world first to use to learn the parameters. Assuming that we are able to access this data from previous electric vehicle fires, we end up with a table like the one previewed below:

AM
CBI
REI
ECF
DTH
BEP
...

no

no

no

yes

no

no

...

yes

no

no

no

no

no

...

no

no

no

no

no

no

...

no

no

no

no

no

no

...

yes

no

no

no

yes

no

...

...

...

...

...

...

...

...

If this file exists as a CSV we can load it into Genius to learn the probabilities given a pre-existing model structure. We will assume that the probabilities are uniformly distributed before learning.

The model file, before and after learning is provided in the model files and sample data section below.

Here we follow the steps for workflow #2 in the model editor. However, we could also use workflow #1 and use the Data to Model Wizard.

First, we must build the model in the model editing canvas using the Model Panel interface and set all the probabilities to uniform. This choice of probabilities is the default when we first create a model in the model editor. Now we are ready to perform training (parameter learning). To make this process quicker, the model with uniform probabilities is provided below in the model files and sample data section.

  1. Select Model in the main menu.

  2. Click Open to load a model from JSON and load the file electricvehicle_uniform.json into the model editing canvas.

You should see the model appear in the model editing canvas. If you inspect the properties of each factor you will see that the probabilities are set to uniform. The next step is to train the model to learn the parameters.

  1. Select Model in the main menu.

  2. Click Train.

  3. Follow the prompts on the screen to upload the electricvehicle_2000.csv dataset for training.

If you inspect the probabilities for each factor you will see that the values have changed from uniform to new values determined by the imported data.

Inference

Finally, we can use the network to answer our problem statement. Let's use the following fictitious scenario:

Suppose after we build the above network a vehicle comes in to the warehouse. It is observed have battery failure (BF), a blocked exhaust pipe (BEP), an electrical circuit failure (ECF), and short circuit in the battery (SCB). We now want to assess: what is the probability of an electric vehicle fire disaster (VFD) for this vehicle?

First, click on the inference tab in the information panel and select VFD. Then under "what do you want to observe?" set the following variables to "yes": BF, BEP, ECF, SCB, and VFD. Then click "Run". We see the following:

Probability of electric vehicle fire disaster

Interpreting the results

These results tell us that the risk of an electric fire disaster is very low based on the data observed.

Last updated