A novel smart system for contaminants detection and recognition in water