Shape-based classification of fruits and vegetables is one of the most important applications of image processing and machine vision technology in post-harvest processing of agricultural products. In this research, desirable (cylindrical), and undesirable (curved and conical) shapes of cucumber fruit were considered to be intelligently detected using image processing technique and artificial neural networks method. A new algorithm was programed for preprocessing and extraction of shape features from the images in MATLAB 2010a software. Beside common features, two new features including “centroid non homogeneity” and “width non homogeneity” were introduced and extracted. After feature selection, different neural network models were evaluated to classify the useful features. The best classifier model had accuracy of 97.1% with 4-20-2 structure.