ClassificationResult class

Represents the result of a mosquito species classification operation.

This model contains the identified species, confidence score, inference time, related diseases, and the original image file used for classification. It's used to present classification results to users with all relevant contextual information.

Usage Example

final result = ClassificationResult(
  species: aedesAegypti,
  confidence: 0.87,
  inferenceTime: 1250,
  relatedDiseases: [dengue, zika, yellowFever],
  imageFile: File('/path/to/mosquito_image.jpg'),
);

print('Identified: ${result.species.name}');
print('Confidence: ${(result.confidence * 100).toStringAsFixed(1)}%');
print('Processing time: ${result.inferenceTime}ms');

Classification Workflow

  1. User captures or selects an image
  2. Image is processed by PyTorch Lite model
  3. Model returns species prediction with confidence
  4. Related diseases are fetched based on species
  5. ClassificationResult is created and displayed

See also:

Constructors

ClassificationResult({required MosquitoSpecies species, required double confidence, required int inferenceTime, required List<Disease> relatedDiseases, required File imageFile})
Creates a new ClassificationResult instance.

Properties

confidence double
Confidence score of the classification (0.0 to 1.0).
final
hashCode int
The hash code for this object.
no setterinherited
imageFile File
The original image file used for classification.
final
inferenceTime int
Time taken for inference in milliseconds.
final
relatedDiseases List<Disease>
List of diseases that can be transmitted by the identified species.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
species MosquitoSpecies
The identified mosquito species.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of this classification result.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited