EfficientNet is a wonderful classification network. the efficientnet implementation refer to [EfficientNet-PyTorch](https://github.com/lukemelas/EfficientNet-PyTorch). I refer much of the code from the above implementation, and construct a network with the efficientnet feature extract layers and a fc layer of 3 output node for my fire & smoke detection task.
Fire and smoke classification and detection by training an efficientnet classifier,detections are implemented through classify crop patch of the input image.
Python 3.7、PyTorch1.3...
Download the pretrained model and simkai.ttf font from BaiduNetDisk: code: awnf
simple run:
python fire_smoke_demo.py
will get the classification results as follows:
or try the detection demo:
python fire_smoke_detection.py
will get results:
I visual the activation of some of the feature map as follows:
As we can see, the cnn can automatically learn the edge or shape or ROI of the predict targets,
some of the filters can recognize the fire, some can deal with other features.
here offer a scrip to train ur own classification model using EfficientNet:
python train.py --data [ur dataset path] --arch [efficientnet model:efficientnet-b0-7] --num_cls [ur task class num]
Refer to the cold for args details.
For inference, u should change the label map txt for ur task.
In my task:
python train.py --data ./cropdata --arch efficientnet-b0 --num_cls 3