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
- User captures or selects an image
- Image is processed by PyTorch Lite model
- Model returns species prediction with confidence
- Related diseases are fetched based on species
- ClassificationResult is created and displayed
See also:
- ClassificationService for the classification logic
PyTorchLiteModelfor the AI model implementation- WebPredictionResult for server-based classification results
Constructors
- ClassificationResult({required MosquitoSpecies species, required double confidence, required int inferenceTime, 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
-
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