A system (100; 2000) comprising: at least one hardware processor (2012, 2014); and a computer-readable medium (2032, 2034, 2036) storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations comprising: using a first machine learning algorithm to train a contour model to identify contours of product shapes of products in input images and to identify backgrounds in the input images; using a second machine learning algorithm to train a plurality of shape-specific classification models to output identifications of products in input images; obtaining a candidate image of one or more products; passing the candidate image to the contour model to obtain output of one or more tags identifying product contours in the candidate image; passing the candidate image and the one or more tags to a multi-hierarchy classification system, which is configured for dynamically searching and invoking a plurality of shape-specific classification models based on geometry tags and hierarchical categories, and using said multi-hierarchy classification system to identify one or more of the shape-specific classification models for one or more individual product shapes in the candidate image; and using the one or more of the shape-specific classification models to distinguish between one or more products in the candidate image and one or more unknown products in the candidate image. at least one hardware processor (2012, 2014); and a computer-readable medium (2032, 2034, 2036) storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations comprising: using a first machine learning algorithm to train a contour model to identify contours of product shapes of products in input images and to identify backgrounds in the input images; using a second machine learning algorithm to train a plurality of shape-specific classification models to output identifications of products in input images; obtaining a candidate image of one or more products; passing the candidate image to the contour model to obtain output of one or more tags identifying product contours in the candidate image; passing the candidate image and the one or more tags to a multi-hierarchy classification system, which is configured for dynamically searching and invoking a plurality of shape-specific classification models based on geometry tags and hierarchical categories, and using said multi-hierarchy classification system to identify one or more of the shape-specific classification models for one or more individual product shapes in the candidate image; and using the one or more of the shape-specific classification models to distinguish between one or more products in the candidate image and one or more unknown products in the candidate image. using a first machine learning algorithm to train a contour model to identify contours of product shapes of products in input images and to identify backgrounds in the input images; using a second machine learning algorithm to train a plurality of shape-specific classification models to output identifications of products in input images; obtaining a candidate image of one or more products; passing the candidate image to the contour model to obtain output of one or more tags identifying product contours in the candidate image; passing the candidate image and the one or more tags to a multi-hierarchy classification system, which is configured for dynamically searching and invoking a plurality of shape-specific classification models based on geometry tags and hierarchical categories, and using said multi-hierarchy classification system to identify one or more of the shape-specific classification models for one or more individual product shapes in the candidate image; and using the one or more of the shape-specific classification models to distinguish between one or more products in the candidate image and one or more unknown products in the candidate image.