multidimensional elastic matching -- Optimization methods in multilayer classifier