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:
Network variables and categories
For this network we will use the following variables:
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:

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:
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.
Select
Modelin the main menu.Click
Opento load a model from JSON and load the fileelectricvehicle_uniform.jsoninto 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.
Select
Modelin the main menu.Click
Train.Follow the prompts on the screen to upload the
electricvehicle_2000.csvdataset 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.
First, we load in a version of the electric vehicle model that contains uniform probabilities:
Assuming the dataset is stored in a file called electricvehicle_2000.csv, we can learn the model parameters as follows:
If you inspect the factor probabilities you will see that learning is successful.
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:

We define the evidence/data and run inference:
{'yes': 0.041706068658108, 'no': 0.958293931341892}
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