Unofficial implementation of SSD with EfficientNet backbone using tf keras.
Here is the link for official EfficientNet implementation for TPU training.
- Python 3.X
- TensorFlow 1.13.1 (Use current version 1.14 would cause a wired dimension mismatch caused by se-expand operation in se block.)
- TensorFlow Models master branch
- Protoc 3.5.7
- Put
efficientnet.py
andefficient_feature_extractor.py
underobject_detection/models
directory - Modify
model_builder.py
and add SSDEfficientNetFeatureExtractor and SSDEfficientNetFPNFeatureExtractor
from object_detection.models.efficientnet_feature_extractor import SSDEfficientNetFeatureExtractor, SSDEfficientNetFPNFeatureExtractor
SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = {
...
'ssd_efficientnet': SSDEfficientNetFeatureExtractor,
'ssd_efficientnet_fpn': SSDEfficientNetFPNFeatureExtractor,
}
- Replace
ssd.proto
file underprotos
with this one. Then make sure to rerunprotoc object_detection/protos/ssd.proto --python_out=.
- Install TensorFlow object detection api: see here
- Train model following official steps
- Refer to
ssd_efficientnet.config
andssd_efficientnet_fpn.config
as example config (If usessd_efficientnet_fpn
backbone, make sureuse_explicit_padding
istrue
to prevent potential mismatch error during top down addition operation).