0% found this document useful (0 votes)
3 views4 pages

Model TrainingSteps

The document outlines a step-by-step process for training a fire and smoke detection model using CCTV/NVR videos. It includes instructions for organizing project folders, extracting frames, labeling images, splitting data into training and validation sets, and running training and a dashboard. It emphasizes the importance of including normal images without fire or smoke for improving model accuracy.

Uploaded by

breezeasmr1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Model TrainingSteps

The document outlines a step-by-step process for training a fire and smoke detection model using CCTV/NVR videos. It includes instructions for organizing project folders, extracting frames, labeling images, splitting data into training and validation sets, and running training and a dashboard. It emphasizes the importance of including normal images without fire or smoke for improving model accuracy.

Uploaded by

breezeasmr1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Yes. Here is the full process with a simple example.

Example folder flow

Your project folder:

fire_smoke_nvr_pilot_v4_trainable

├── dataset
│ ├── raw_videos
│ ├── extracted_frames
│ ├── train
│ │ ├── images
│ │ └── labels
│ └── valid
│ ├── images
│ └── labels

├── models
├── extract_frames.bat
├── train_model.bat
└── run_dashboard.bat

Step 1: Put videos here

Put your CCTV/NVR videos in:

dataset\raw_videos

Example:

dataset\raw_videos\camera1_fire_test.mp4
dataset\raw_videos\camera1_normal_office.mp4
dataset\raw_videos\camera2_smoke_test.mp4

Step 2: Extract frames

Double click:

extract_frames.bat

It will create images here:


dataset\extracted_frames

Example output:

camera1_fire_test_0001.jpg
camera1_fire_test_0002.jpg
camera1_normal_office_0001.jpg

Step 3: Label images

You need a labeling tool. Use LabelImg or CVAT.

You draw box around fire/smoke and select class:

0 = fire
1 = smoke

For every image, YOLO creates a .txt file.

Example:

camera1_fire_test_0001.jpg
camera1_fire_test_0001.txt

Example YOLO label file content:

0 0.432 0.611 0.120 0.180

Meaning:

class x_center y_center width height

If it is smoke:

1 0.520 0.300 0.250 0.200

Step 4: Put labeled files into train/valid

Training data example:

dataset\train\images\camera1_fire_test_0001.jpg
dataset\train\labels\camera1_fire_test_0001.txt

Validation data example:


dataset\valid\images\camera1_fire_test_0100.jpg
dataset\valid\labels\camera1_fire_test_0100.txt

Important: image and label file names must match.

Correct:

[Link]
[Link]

Wrong:

[Link]
abc_fire.txt

Step 5: Split data

Example:

If you have 1000 images:

800 images → dataset\train\images


800 labels → dataset\train\labels

200 images → dataset\valid\images


200 labels → dataset\valid\labels

Use around:

80% train
20% valid

Step 6: Run training

Double click:

train_model.bat

After training, best model will be saved here:

models\[Link]

Step 7: Run dashboard


Double click:

run_dashboard.bat

Or run in terminal:

run_dashboard.bat

Open browser:

[Link]

Very important for accuracy

For 95%+ target, include many normal images too:

normal office
red clothes
brown clothes
wood tables
sunlight
reflections
orange bags
yellow papers
screens/lights

For normal images with no fire/smoke, label file should be empty:

normal_001.jpg
normal_001.txt

The .txt file exists but has no text inside.

This teaches AI: “this is not fire.”

You might also like