A Flexible Framework for Learning Visual Quality Inspection door