Abstract:Aiming at the difficult samples in image segmentation, a new cost function of generalized region loss is proposed; Firstly, a parameter is introduced to change the previous method of focusing on difficult samples by setting weights or focal in the cost function. Secondly, the label image and the prediction image are divided into regions, and the difficult samples divided into four regions are classified and focused. Finally, the absolute losses of the four regions are calculated respectively, and then the weighted combination is carried out; In order to verify the performance of the algorithm, the CamVid data set is used as experimental data. The cost function is verified on the FCN and u-net image segmentation networks. Compared with the 12 cost functions commonly used in the current image segmentation field, the IOU index is increased by 1.93% and 2.99% respectively, which proves that this cost function is superior to most image segmentation cost functions; The final experimental results show that the proposed cost function based on pixel segmentation can effectively improve the accuracy of image segmentation and provide a reference for the research of image segmentation.