The document presents a novel reconfigurable part-based model, the and-or graph model, for recognizing object shapes in images through a structured approach involving multiple layers of classifiers and nodes. It introduces a new algorithm for structurally optimizing and training this model using weakly annotated data, which enhances its capability to detect shapes amidst background clutter. The model shows superior performance on various challenging datasets and provides a new shape database with over 1500 annotated instances for recognition and detection purposes.