This repo is the pytorch implementation of the following paper:
The detailed paper will be updated when the publication is completed. The most highlight of this proposed method is to improve m-IoU and F1 without any additional crack image. The generated knowledge plays a role of a new crack image. This knowledge is transferred to crack detection newtork, then the accuracy is increased regrardless of newtork architecture.
This codes are inspired by Jun-Yan Zhu*, Taesung Park*, Phillip Isola, and Alexei A. Efros. "Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks", in IEEE International Conference on Computer Vision (ICCV), 2017. In particular, 'option' based implementation is heavily borrowed from their code (Link).
The full dataset is provided by Bianchi, Eric; Hebdon, Matthew (2021). Concrete Crack Conglomerate Dataset. University Libraries, Virginia Tech. Dataset. This dataset can be download at (Link). This code has been implemented to operate using sample from original data.
Please cite this paper if the code helps your research.
@article{Shim_AUTCON_2025,
title={Semantic segmentation for crack detection via generative knowledge distillation},
author={Shim, Seungbo},
journal={Automation in Construction},
volume={175},
pages={106201},
year={2025},
publisher={Elsevier}
}
- CUDA 12.1
- pytorch == 2.1.2
- python-opencv == 4.9.0.80
- matplotlib == 3.8.2
git clone https://github.com//phylun/GenKDCrack.gitDownload the sample dataset via the link (Link). Unzip it into the folder dataset_sample
dataset_sample/labeled/trainConc/JPEGImages
/SegmentationClass
/valConc/JPEGImages
/SegmentationClass
/testConc/JPEGImages
/SegmentationClass
/unlabeled/trainConc/JPEGImages
This code needs pre-trained weight models for teacher networks. The teacher networks are FRRNA and FRRNB whose weights can be downloaded via (Link) and (Link), respectively. Move them in the folder pretrained
python EnsemKD_SegTrain.py --name project_name \
--Snet RegSeg \
--n_epoch 3000 \
--consist_weight 0.001 \
--gpu_ids 0
Use your own project name (e.g. KDEnsem_FRRNAB_RegSeg). Snet means segmenation model. In this code, eight models are provided such as CGNet, FDDWNet, ERFNet, DDRNet, RegSeg, PIDNet, Deeplabv3p, and LEDNet.
In case of supervised learning, use the below script
python Super_SegTrain.py --name project_name \
--Snet RegSeg \
--gpu_ids 0
python SegTest.py --name project_name \
--Snet RegSeg \
--gpu_ids 0
This script evaluates the accuracy for all saved models in the folder outputs/project_name with valConc. When the option of --epoch 100, then 100th saved model is called and m-IoU is assessed. Also, adding --phase test, the accuracy of m-IoU and F1 is evaluated by testConc
- April 08th, 2024: Updated by author
