Multi-Scale Pattern Recognition For Image Classification And Segmentation