Image segmentation can be used in object recognition systems. Today, it is considered in most branches of science and industry, and in many of these branches the identification of the main components of the image is very important. For example, automatic detection and tracking of moving targets in military applications and segregation of different products in industrial applications, identification of road signs, segmentation of colonies, land use and land cover classification. It is also widely used in medicine, such as diagnosing brain and tumors and self-driving. In this study, image sections are performed by a feature extraction process using a neural network. In the process of applying the neural network method, optimization was performed using the ant colony algorithm. The results show that the identification of image segments using the neural network has an accuracy of 87% alone, but increased to 90% after optimization using ant colony optimization.