A Unet model is built segment the different parts of maize ear. However, the accuracy does not meet the needs of application. In the paper, a new activation function named R_S is defined on the basis of the analysis and research on two commonly used activation functions ReLU and Swish. And the new activation function combined the advantages of these two functions and effectively avoided the problems of hard saturation, mean shift and complicated calculations. The U-Net deep learning model with R_S as the activation function, which is used for image segmentation of maize ears, not only had fast convergence speed and high accuracy, but also avoided local convergence effectively. Next, in order to determine the optimal value of adjustment factor, seven U-Net models are built. The adjustment factors are separately 1.7,1.3,1.0,0.8,0.6,0.3,0.05. Experiment results showed that the model could reach the best comprehensive performance when using the self-defined activation function on condition that the adjustment factor is 0.8. Finally, the optimal model is used as the classifier to build the automatic maize ear image segmentation method. The experiment results demonstrate that the accuracy of the model on test set is 94.34%.