screens\classification_screen library
ClassificationScreen provides the main interface for mosquito species identification and classification.
This screen serves as the core feature of the CulicidaeLab application, enabling users to:
- Image Capture: Take photos using device camera or select from gallery
- AI Classification: Real-time species identification using PyTorch Lite models
- Result Display: Show confidence scores, inference time, and species information
- Disease Information: Access associated disease risks and detailed information
- Observation Submission: Submit findings with location data and notes to the research database
Architecture & State Management
The screen implements the MVVM pattern using:
- ClassificationViewModel for business logic and state management
- Provider pattern for reactive UI updates
- Service locator for dependency injection
- Asynchronous operations for image processing and API calls
User Workflow
1. User selects image source (camera/gallery)
2. Image is captured/selected and displayed
3. AI model processes image and returns prediction
4. Results shown with species info and confidence
5. User can view disease risks or submit observation
6. Optional: Add location data and notes for research
Key Features
- Multi-source Image Input: Camera capture and gallery selection
- Real-time Processing: On-device AI inference with progress indicators
- Rich Results Display: Species information, confidence scores, inference timing
- Disease Risk Assessment: Interactive disease list with detailed information
- Research Integration: Observation submission to CulicidaeLab database
- Error Handling: Graceful handling of classification and network errors
- Responsive Design: Adaptive layouts for different screen sizes
Performance Considerations
- On-device Processing: Uses PyTorch Lite for fast, offline classification
- Image Optimization: Automatic image resizing and preprocessing
- Memory Management: Efficient image handling and model caching
- Background Processing: Non-blocking UI during classification
Classes
- ClassificationScreen
- Main screen for mosquito species classification and identification.