# User Guide

This guide explains how to use the Wildlife Monitoring Dashboard as an end user (e.g. a park ranger).


## Home Page — Live Map

The home page shows a fullscreen map of Yellowstone National Park with five camera locations marked as blue dots. Each dot represents a physical camera trap deployed in the park.

### Live Camera Feed

The cameras continuously capture images and send them to the dashboard for classification. When a new image arrives from a camera:

- The AI model classifies the captured animal in real time.
- A **toast notification** appears at the top of the screen with the detected species, camera location, and confidence level.
- The **camera marker pulses red** briefly to indicate activity at that location.
- The detection is added to the **sidebar**.

### Wolf Warnings

When a wolf is detected, a **pulsing red circle** appears around the camera location on the map as an urgent alert. The warning automatically fades after 10 seconds. This gives rangers immediate awareness of wolf activity in the park.

### Sidebar

Click the toggle button (top-right) to open or close the sidebar. It contains:

- **Detection count** — total detections received during the current session.
- **Species bar chart** — shows how many of each species have been detected. Click any species bar to overlay a heatmap on the map showing where that species has been spotted across the park. Click again to dismiss. This helps identify which areas of the park are frequented by specific animals.
- **Filter buttons** — filter the detection list by verification status:
  - **All** — show everything
  - **Unverified** — detections not yet reviewed by a ranger
  - **Verified** — confirmed correct by a ranger
  - **Corrected** — detections where a ranger changed the predicted class
- **Detection list** — scrollable list of all detections, newest first. Click any detection to view its detail page.

### Camera Pages

Click a **camera marker** on the map to view that camera's feed page, which shows a grid of all recent detections from that location with thumbnails, predicted class, confidence, and verification status. Click any card to go to the detection detail page.

## Detection Detail Page

Accessible by clicking a detection from the sidebar or a camera page.

### Verification Bar

At the top, a verification bar lets you review the AI's classification:

- **Correct** — confirms the model's prediction is accurate.
- **Wrong** — opens a dropdown to select the true species. The detection is then marked as "manually corrected" and the predicted class is updated.

Once verified, the bar shows the outcome (verified correct or manually corrected). Verification status is visible throughout the dashboard (sidebar badges, camera page cards).

### XAI Carousel

The main area shows a single image viewer with left/right navigation (arrow buttons or keyboard arrow keys). These visualisations help you understand *why* the AI made its prediction:

| Slide | Description |
|---|---|
| **Original Image** | The raw camera-trap capture |
| **ScoreCAM** | Heatmap overlay showing which regions of the image the model focused on |
| **LIME (top-1 class)** | Superpixel explanation for the most likely class — green regions support the prediction, red regions oppose it |
| **LIME (top-2 class)** | Same explanation for the second most likely class |
| **Contrastive** | Blue regions support the top-1 class over the top-2; red regions support the top-2 over the top-1 |
| **Nearest Neighbour 1–3** | The three most similar images from the training set, with species label and cosine similarity score |

Navigation dots at the bottom let you jump to any slide directly.

### Probability Chart

On the right side (always visible), a bar chart shows the model's predicted probability for each of the seven classes. The predicted class is highlighted in orange.

Below the chart, the predicted class, confidence percentage, and perplexity are displayed. Lower perplexity means the model is more certain.

## Interpreting XAI Results

- **ScoreCAM**: If the highlighted region corresponds to the animal in the image, the model is likely using relevant features. If it highlights background or irrelevant areas, the prediction may be unreliable.
- **LIME**: Green superpixels are evidence *for* the class, red superpixels are evidence *against*. A good prediction should show green on the animal.
- **Contrastive**: Helps understand *why* the model chose one class over another. Useful when the top two predictions are close in confidence.
- **Nearest Neighbours**: If the neighbours are visually similar and of the same species, the model's internal representation is coherent. Mismatched neighbours may indicate confusion.
- **Perplexity**: A value close to 1.0 means the model is very confident. Higher values (e.g. 3–7) indicate uncertainty across multiple classes.
