We describe here a novel defect classification system that works in real-time on the images of material running on the production line, provided by a video-inspection module. The classifier is constituted of a two-levels hierarchical architecture: a set of adequate features are extracted from the image first; the defect type is then identified from them. Statistical analysis allows greatly reducing the number of features, leaving only the most significant ones. A particular version of multi-class boosting has been developed for labeling: differently from its original version, it accepts only one label for each image, the true one, and does not require the rank for the other classes. Nevertheless, the classifier is able to produce a valid rank of the defect with respect to all the classes, information that can be used to achieve an identification rate of the dangerous defects very close to 100 % on a real data set.