Purpose of research is to develop an image segmentation algorithm based on the persistent homology for solving problems of searching and classifying defects. The algorithm is aimed at improving the quality of products at enterprises with continuous production (metallurgy, woodworking, and others).Methods. To segment an image, it is proposed to specify links between pixels in the image. In the future, during the iterative breaking of links, as their weights increase, pixels will be combined into groups called holes. Pixels that are in a single group have both their original characteristics and characteristics common for the entire group, and they also change the weights of their links with representatives of other groups. This creates a history of the formation of separate groups of pixels which can be specified as segments with a time-based characteristic of the change.Results. The result of the research is the development of an algorithm designed to search for and classify defects in various materials. The optimal algorithm for applying the principle of persistent homology to images has been developed, and factors determining the transition boundaries of image objects have been analyzed and selected. The segmentation algorithm was tested on metal images obtained from sheet rolling equipment. The results of comparing the proposed algorithm with the K-means and Mean-Shift segmentation algorithms for different parameters are provided in the article.Conclusion. Using persistent homology in image segmentation tasks can enable creating a tool that can be applied to materials with different structures without any need for significant changes. The software implementation of the segmentation process based on the principles of computer topology has shown high flexibility due to the storing of the history of segment changes.