 This study proposes a new UNET-based algorithm for automatic impurities detection in edible birds nests, EBN. The algorithm uses convolutional neural networks to extract localized features from images of EBN, which are then used to generate output probability tensors for impurities detection and positioning. This approach outperforms existing image processing-based methods, achieving a higher impurities detection rate of 96.69%, as well as a lower misclassification rate of 10.08%. Additionally, the algorithm has a reasonably high DICE coefficient of over 0.8, indicating its applicability. Overall, the proposed UNET-based algorithm successfully mitigates the intensity inhomogeneity in EBN and improves the accuracy of impurities detection. This article was authored by Yng Heng Yeo and Kin Sam Yen.