Convert object to Map.
Map<String, dynamic> toMap() { return {'activity': activity, 'confidence': confidence}; }