Assuming that these are simple geometric shapes on relatively simple backgrounds (as opposed to real objects against cluttered backgrounds), then I'd suggest:
1. Determine which pixels are foreground (shapes) and background (everything else)
2. Identify individual blobs (connected sets of foreground pixels of the same type)
3. For each blob, extract meaningful features
4. Train a classifier, based on the extracted features
5. Test the system on new images
6. Celebrate!
In step 2, try using a flood fill.
In step 3, there are many features one might try, such as perimeter-to-area ratio.
In step 4, the classifier could be any learning algorithm: neural network, linear discriminant, etc.
-Will Dwinnell
Data Mining in MATLAB