# Unsupervised segmentation for defect detection

**URL:** <https://discuss.pytorch.org/t/unsupervised-segmentation-for-defect-detection/67372>\
**Category:** vision\
**Created:** [January 22, 2020, 1:25pm UTC](https://discuss.pytorch.org/t/unsupervised-segmentation-for-defect-detection/67372 "2020-01-22T13:25:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spiovesan](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@spiovesan](https://discuss.pytorch.org/u/spiovesan)\
**Post date:** [January 22, 2020, 1:25pm UTC](https://discuss.pytorch.org/t/unsupervised-segmentation-for-defect-detection/67372/1 "2020-01-22T13:25:50Z")

</div>

I would like to train a network for defect detection, on the same type of object (i.e. a production line for plastic caps); I have an image set good with parts and an image set with defective parts. I know that someone is able to do it using a sliding window of `patch_size` to process the entire image, with a certain overlap, just using the two datasets. Does someone know if there is anything similar in pytorch or give me some hint for this?
