Skip to content

Note

Click here to download the full example code

Classifying Mosquito Species

This tutorial demonstrates how to use the MosquitoClassifier from the CulicidaeLab library to identify mosquito species from images. We will walk through the entire process, from loading the model to evaluating its performance on a batch of data.

This guide will cover:

  • Initialization: How to load the settings and the pre-trained model.
  • Data Handling: How to use the DatasetsManager to fetch sample data.
  • Single Image Prediction: How to classify a single mosquito image.
  • Visualization: How to interpret and visualize the model's predictions.
  • Batch Evaluation: How to measure the model's accuracy on a set of test images.
  • Reporting: How to generate and visualize a comprehensive performance report.

Install the culicidaelab library if not already installed

!pip install -q culicidaelab[full]
or, if you have access to GPU
!pip install -q culicidaelab[full-gpu]

1. Initialization and Setup

Our first step is to set up the necessary components. We will initialize:

  • settings: An object that holds all library configuration, such as model paths and hyperparameters.
  • DatasetsManager: A helper class to download and manage the sample datasets used in this tutorial.
  • MosquitoClassifier: The main class for our classification task. We'll pass load_model=True to ensure the pre-trained model weights are downloaded and loaded into memory immediately.

Import necessary libraries

import matplotlib.pyplot as plt

# Import the required classes from the CulicidaeLab library
from culicidaelab import (
    DatasetsManager,
    MosquitoClassifier,
    get_settings,
)

# Get the default library settings instance
settings = get_settings()

# Initialize the services needed to manage and download data

manager = DatasetsManager(settings)

# Instantiate the classifier and load the model.
# This might take a moment on the first run as it downloads the model weights.
print("Initializing MosquitoClassifier and loading model...")
classifier = MosquitoClassifier(settings, load_model=True)
print("Model loaded successfully.")

Out:

Initializing MosquitoClassifier and loading model...
C:\Users\lenova\CascadeProjects\culicidaelab\.venv\Lib\site-packages\fastai\learner.py:455: UserWarning: load_learner` uses Python's insecure pickle module, which can execute malicious arbitrary code when loading. Only load files you trust.
If you only need to load model weights and optimizer state, use the safe `Learner.load` instead.
  warn("load_learner` uses Python's insecure pickle module, which can execute malicious arbitrary code when loading. Only load files you trust.\nIf you only need to load model weights and optimizer state, use the safe `Learner.load` instead.")
Model loaded successfully.

Inspecting Model Classes

Before we start predicting, it's useful to know which species the model was trained to recognize. We can easily access this information from the settings object.

species_map = settings.species_config.species_map
print(f"--- The model can recognize {len(species_map)} classes ---")
# Print the first 5 for brevity
for idx, name in list(species_map.items())[:5]:
    print(f"  Class Index {idx}: {name}")
print("  ...")

Out:

--- The model can recognize 18 classes ---
  Class Index 0: Aedes aegypti
  Class Index 1: Aedes albopictus
  Class Index 2: Aedes canadensis
  Class Index 3: Aedes dorsalis
  Class Index 4: Aedes geniculatus
  ...

2. Loading the Test Dataset

For this tutorial, we will use a built-in test dataset provided by the library. The DatasetsManager makes it simple to download and load this data. The dataset contains images and their corresponding correct labels, which we will use for prediction and later for evaluation.

print("\n--- Loading the 'classification' dataset's 'test' split ---")
classification_test_data = manager.load_dataset("classification", split="test")
print("Test dataset loaded successfully!")
print(f"Number of samples in the test dataset: {len(classification_test_data)}")

# Let's select one sample to work with.
# The sample is a dictionary containing the image and its ground truth label.
classification_test_data = classification_test_data.shuffle(seed=35)
sample_index = 285
sample = classification_test_data[sample_index]
image = sample["image"]
ground_truth_label = sample["label"]

print(f"\nSelected sample's ground truth label: '{ground_truth_label}'")

# Display the input image
plt.figure(figsize=(6, 6))
plt.imshow(image)
plt.title(f"Input Image\n(Ground Truth: {ground_truth_label})")
plt.axis("off")
plt.show()

Input Image (Ground Truth: culex_pipiens)

Out:

--- Loading the 'classification' dataset's 'test' split ---
Cache hit for split config: test C:\Users\lenova\AppData\Local\culicidaelab\culicidaelab\datasets\mosquito_species_classification\4d967a30111bf29f
Test dataset loaded successfully!
Number of samples in the test dataset: 328

Selected sample's ground truth label: 'culex_pipiens'
C:/Users/lenova/CascadeProjects/culicidaelab/docs/en/examples/tutorial_part_4_mosquito_classification.py:125: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

3. Classifying a Single Image

Now we'll use the classifier to predict the species of the mosquito in our selected image. The predict() method takes an image (as a NumPy array, file path, or PIL Image) and returns a list of predictions, sorted from most to least confident.

Run the classification on our sample image

result = classifier.predict(image)

# Print the top 5 predictions in a readable format
print("--- Top 5 Predictions ---")
for p in result.predictions[:5]:
    print(f"{p.species_name}: {p.confidence:.2%}")

Out:


 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]




--- Top 5 Predictions ---
Culex pipiens: 100.00%
Culex quinquefasciatus: 0.00%
Aedes canadensis: 0.00%
Culex inatomii: 0.00%
Culex tritaeniorhynchus: 0.00%

4. Visualizing and Interpreting the Results

A raw list of predictions is useful, but visualizations make the results much easier to understand. We'll create two plots:

  1. A Bar Plot: This shows the model's confidence for every possible species. It's great for seeing not just the top prediction, but also which other species the model considered.
  2. A Composite Image: This uses the built-in visualize() method to create a clean image that displays the top predictions alongside the input image.

Create a bar plot to visualize the probabilities for all species

plt.figure(figsize=(10, 8))

# The predictions are already sorted, so we can plot them directly
species_names = [p.species_name for p in result.predictions]
probabilities = [p.confidence for p in result.predictions]

# We'll reverse the lists (`[::-1]`) so the highest probability is at the top
bars = plt.barh(species_names[::-1], probabilities[::-1])

# Highlight the bars that meet our confidence threshold
conf_threshold = settings.get_config("predictors.classifier.confidence")
for bar in bars:
    if bar.get_width() >= conf_threshold:
        bar.set_color("teal")
    else:
        bar.set_color("lightgray")

# Add a reference line for the confidence threshold
plt.axvline(
    x=conf_threshold,
    color="red",
    linestyle="--",
    label=f"Confidence Threshold ({conf_threshold:.0%})",
)
plt.xlabel("Assigned Probability")
plt.title("Species Classification Probabilities")
plt.legend()
plt.tight_layout()
plt.show()

Species Classification Probabilities

Out:

C:/Users/lenova/CascadeProjects/culicidaelab/docs/en/examples/tutorial_part_4_mosquito_classification.py:187: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

Now, let's use the built-in visualizer for a clean presentation

annotated_image = classifier.visualize(image, result)

# Display the final annotated image
plt.figure(figsize=(10, 6))
plt.imshow(annotated_image)
plt.title("Classification Result")
plt.axis("off")
plt.show()

Classification Result

Out:

C:/Users/lenova/CascadeProjects/culicidaelab/docs/en/examples/tutorial_part_4_mosquito_classification.py:198: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

5. Evaluating Model Performance on a Batch

While classifying a single image is useful, a more rigorous test involves evaluating the model's performance across an entire dataset. The evaluate_batch() method is designed for this. It processes a batch of images and their corresponding ground truth labels, then computes aggregate metrics.

The result is a report dictionary containing key metrics like mean accuracy and a confusion matrix, which shows exactly where the model is succeeding or failing.

Let's evaluate the first 30 images from the test set for this example

num_samples_to_evaluate = 30
batch_samples = classification_test_data.select(range(num_samples_to_evaluate))
batch_images = [sample["image"] for sample in batch_samples]
ground_truths = [sample["label"] for sample in batch_samples]

print(f"\n--- Evaluating a batch of {len(batch_images)} images ---")

# Run the batch evaluation.
# The method can take images and ground truths separately, or it can
# run predictions internally if you only provide the images.
report = classifier.evaluate_batch(
    input_data_batch=batch_images,
    ground_truth_batch=ground_truths,
    show_progress=True,
)

print("\n--- Evaluation Report Summary ---")
for key, value in report.items():
    if key != "confusion_matrix":
        # Check if value is a float before formatting
        if isinstance(value, float):
            print(f"  {key}: {value:.4f}")
        else:
            print(f"  {key}: {value}")

Out:

--- Evaluating a batch of 30 images ---

 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/30 00:00<?]

 |██----------------------------------------------------------| 3.33% [1/30 00:00<00:00]

 |████--------------------------------------------------------| 6.67% [2/30 00:00<00:00]

 |██████------------------------------------------------------| 10.00% [3/30 00:00<00:00]

 |████████----------------------------------------------------| 13.33% [4/30 00:00<00:00]

 |██████████--------------------------------------------------| 16.67% [5/30 00:00<00:00]

 |████████████████████████████████████████████████████████████| 100.00% [30/30 00:00<00:00]
C:\Users\lenova\CascadeProjects\culicidaelab\.venv\Lib\site-packages\sklearn\metrics\_ranking.py:424: UndefinedMetricWarning: Only one class is present in y_true. ROC AUC score is not defined in that case.
  warnings.warn(
C:\Users\lenova\CascadeProjects\culicidaelab\.venv\Lib\site-packages\sklearn\metrics\_ranking.py:424: UndefinedMetricWarning: Only one class is present in y_true. ROC AUC score is not defined in that case.
  warnings.warn(
C:\Users\lenova\CascadeProjects\culicidaelab\.venv\Lib\site-packages\sklearn\metrics\_ranking.py:424: UndefinedMetricWarning: Only one class is present in y_true. ROC AUC score is not defined in that case.
  warnings.warn(
C:\Users\lenova\CascadeProjects\culicidaelab\.venv\Lib\site-packages\sklearn\metrics\_ranking.py:424: UndefinedMetricWarning: Only one class is present in y_true. ROC AUC score is not defined in that case.
  warnings.warn(

--- Evaluation Report Summary ---
  confidence_mean: 0.9960
  confidence_std: 0.0095
  accuracy_mean: 0.9667
  accuracy_std: 0.1795
  top_5_correct_mean: 1.0000
  top_5_correct_std: 0.0000
  top_1_correct_mean: 0.9667
  top_1_correct_std: 0.1795
  count: 30
  roc_auc: nan

6. Visualizing the Evaluation Report

The generated report dictionary contains a wealth of information, but the confusion matrix is best understood visually. The visualize_report() method creates a comprehensive plot that summarizes the evaluation results.

How to read the confusion matrix: - Each row represents the actual ground truth species. - Each column represents the species that the model predicted. - The diagonal (from top-left to bottom-right) shows the number of correct predictions for each class. - Off-diagonal numbers indicate misclassifications. For example, a number in row "A" and column "B" means an image of species A was incorrectly classified as species B.

Pass the report dictionary to the visualization function

classifier.visualize_report(report)

Model Evaluation Report, Confusion Matrix

Out:

C:\Users\lenova\CascadeProjects\culicidaelab\culicidaelab\predictors\classifier.py:285: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

7. Batch Prediction for Efficiency

If your goal is to classify many images using predict_batch() is much more efficient than looping over predict(), if it leverages the GPU to process images in parallel, results will be returned in a significant speed-up.

We'll use the same small batch from our evaluation example

print(
    f"\n--- Classifying a batch of {len(batch_images)} images with predict_batch ---",
)
batch_predictions = classifier.predict_batch(batch_images, show_progress=True)

print("\n--- Batch Classification Results (Top prediction for each image) ---")
for i, single_image_preds in enumerate(batch_predictions):
    if single_image_preds:  # Check if the prediction list is not empty
        top_pred_species = single_image_preds.predictions[0].species_name
        top_pred_conf = single_image_preds.predictions[0].confidence
        print(
            f"  - Image {i+1} (GT: {ground_truths[i]}): "
            f"Predicted '{top_pred_species}' with {top_pred_conf:.2%} confidence.",
        )
    else:
        print(f"  - Image {i+1} (GT: {ground_truths[i]}): Prediction failed.")

Out:

--- Classifying a batch of 30 images with predict_batch ---

 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





 |------------------------------------------------------------| 0.00% [0/1 00:00<?]

 |████████████████████████████████████████████████████████████| 100.00% [1/1 00:00<00:00]





--- Batch Classification Results (Top prediction for each image) ---
  - Image 1 (GT: aedes_aegypti): Predicted 'Aedes aegypti' with 100.00% confidence.
  - Image 2 (GT: culex_tritaeniorhynchus): Predicted 'Culex tritaeniorhynchus' with 99.95% confidence.
  - Image 3 (GT: aedes_koreicus): Predicted 'Aedes koreicus' with 100.00% confidence.
  - Image 4 (GT: culiseta_annulata): Predicted 'Culiseta annulata' with 100.00% confidence.
  - Image 5 (GT: aedes_albopictus): Predicted 'Aedes albopictus' with 100.00% confidence.
  - Image 6 (GT: aedes_aegypti): Predicted 'Aedes aegypti' with 98.94% confidence.
  - Image 7 (GT: aedes_vexans): Predicted 'Aedes vexans' with 100.00% confidence.
  - Image 8 (GT: aedes_dorsalis): Predicted 'Aedes dorsalis' with 99.96% confidence.
  - Image 9 (GT: aedes_albopictus): Predicted 'Aedes albopictus' with 100.00% confidence.
  - Image 10 (GT: culiseta_annulata): Predicted 'Culiseta annulata' with 100.00% confidence.
  - Image 11 (GT: aedes_vexans): Predicted 'Aedes vexans' with 100.00% confidence.
  - Image 12 (GT: aedes_albopictus): Predicted 'Aedes albopictus' with 100.00% confidence.
  - Image 13 (GT: culex_inatomii): Predicted 'Culex inatomii' with 100.00% confidence.
  - Image 14 (GT: culiseta_longiareolata): Predicted 'Culiseta longiareolata' with 98.63% confidence.
  - Image 15 (GT: anopheles_sinensis): Predicted 'Anopheles sinensis' with 100.00% confidence.
  - Image 16 (GT: aedes_aegypti): Predicted 'Aedes aegypti' with 100.00% confidence.
  - Image 17 (GT: aedes_aegypti): Predicted 'Aedes aegypti' with 100.00% confidence.
  - Image 18 (GT: culiseta_annulata): Predicted 'Culiseta annulata' with 99.98% confidence.
  - Image 19 (GT: culex_tritaeniorhynchus): Predicted 'Culex tritaeniorhynchus' with 95.28% confidence.
  - Image 20 (GT: aedes_albopictus): Predicted 'Aedes albopictus' with 100.00% confidence.
  - Image 21 (GT: aedes_vexans): Predicted 'Aedes vexans' with 98.64% confidence.
  - Image 22 (GT: culex_tritaeniorhynchus): Predicted 'Culex tritaeniorhynchus' with 100.00% confidence.
  - Image 23 (GT: aedes_albopictus): Predicted 'Aedes aegypti' with 98.10% confidence.
  - Image 24 (GT: culex_pipiens): Predicted 'Culex pipiens' with 100.00% confidence.
  - Image 25 (GT: aedes_triseriatus): Predicted 'Aedes triseriatus' with 99.98% confidence.
  - Image 26 (GT: aedes_dorsalis): Predicted 'Aedes dorsalis' with 99.97% confidence.
  - Image 27 (GT: aedes_vexans): Predicted 'Aedes vexans' with 100.00% confidence.
  - Image 28 (GT: aedes_canadensis): Predicted 'Aedes canadensis' with 99.26% confidence.
  - Image 29 (GT: aedes_aegypti): Predicted 'Aedes aegypti' with 99.41% confidence.
  - Image 30 (GT: culex_pipiens): Predicted 'Culex pipiens' with 100.00% confidence.

Total running time of the script: ( 0 minutes 28.751 seconds)

Download Python source code: tutorial_part_4_mosquito_classification.py

Download Jupyter notebook: tutorial_part_4_mosquito_classification.ipynb

Gallery generated by mkdocs-gallery