A team of researchers has developed a new mechanism that uses machine-learning algorithms to distinguish between genuine and counterfeit versions of the same product.