Dataset Viewer
Auto-converted to Parquet Duplicate
image
image
label
string
filename
string
no_lanternfly
augmented_IMG_3791_processed_0.JPG
no_lanternfly
augmented_IMG_3791_processed_1.JPG
no_lanternfly
augmented_IMG_3791_processed_2.JPG
no_lanternfly
augmented_IMG_3791_processed_3.JPG
no_lanternfly
augmented_IMG_3791_processed_4.JPG
no_lanternfly
augmented_IMG_3791_processed_5.JPG
no_lanternfly
augmented_IMG_3791_processed_6.JPG
no_lanternfly
augmented_IMG_3791_processed_7.JPG
no_lanternfly
augmented_IMG_3791_processed_8.JPG
no_lanternfly
augmented_IMG_3791_processed_9.JPG
has_lanternfly
augmented_IMG_3795_processed_0.JPG
has_lanternfly
augmented_IMG_3795_processed_1.JPG
has_lanternfly
augmented_IMG_3795_processed_2.JPG
has_lanternfly
augmented_IMG_3795_processed_3.JPG
has_lanternfly
augmented_IMG_3795_processed_4.JPG
has_lanternfly
augmented_IMG_3795_processed_5.JPG
has_lanternfly
augmented_IMG_3795_processed_6.JPG
has_lanternfly
augmented_IMG_3795_processed_7.JPG
has_lanternfly
augmented_IMG_3795_processed_8.JPG
has_lanternfly
augmented_IMG_3795_processed_9.JPG
no_lanternfly
augmented_IMG_3796_processed_0.JPG
no_lanternfly
augmented_IMG_3796_processed_1.JPG
no_lanternfly
augmented_IMG_3796_processed_2.JPG
no_lanternfly
augmented_IMG_3796_processed_3.JPG
no_lanternfly
augmented_IMG_3796_processed_4.JPG
no_lanternfly
augmented_IMG_3796_processed_5.JPG
no_lanternfly
augmented_IMG_3796_processed_6.JPG
no_lanternfly
augmented_IMG_3796_processed_7.JPG
no_lanternfly
augmented_IMG_3796_processed_8.JPG
no_lanternfly
augmented_IMG_3796_processed_9.JPG
no_lanternfly
augmented_IMG_3801_processed_0.JPG
no_lanternfly
augmented_IMG_3801_processed_1.JPG
no_lanternfly
augmented_IMG_3801_processed_2.JPG
no_lanternfly
augmented_IMG_3801_processed_3.JPG
no_lanternfly
augmented_IMG_3801_processed_4.JPG
no_lanternfly
augmented_IMG_3801_processed_5.JPG
no_lanternfly
augmented_IMG_3801_processed_6.JPG
no_lanternfly
augmented_IMG_3801_processed_7.JPG
no_lanternfly
augmented_IMG_3801_processed_8.JPG
no_lanternfly
augmented_IMG_3801_processed_9.JPG
no_lanternfly
augmented_IMG_3802_processed_0.JPG
no_lanternfly
augmented_IMG_3802_processed_1.JPG
no_lanternfly
augmented_IMG_3802_processed_2.JPG
no_lanternfly
augmented_IMG_3802_processed_3.JPG
no_lanternfly
augmented_IMG_3802_processed_4.JPG
no_lanternfly
augmented_IMG_3802_processed_5.JPG
no_lanternfly
augmented_IMG_3802_processed_6.JPG
no_lanternfly
augmented_IMG_3802_processed_7.JPG
no_lanternfly
augmented_IMG_3802_processed_8.JPG
no_lanternfly
augmented_IMG_3802_processed_9.JPG
no_lanternfly
augmented_IMG_3804_processed_0.JPG
no_lanternfly
augmented_IMG_3804_processed_1.JPG
no_lanternfly
augmented_IMG_3804_processed_2.JPG
no_lanternfly
augmented_IMG_3804_processed_3.JPG
no_lanternfly
augmented_IMG_3804_processed_4.JPG
no_lanternfly
augmented_IMG_3804_processed_5.JPG
no_lanternfly
augmented_IMG_3804_processed_6.JPG
no_lanternfly
augmented_IMG_3804_processed_7.JPG
no_lanternfly
augmented_IMG_3804_processed_8.JPG
no_lanternfly
augmented_IMG_3804_processed_9.JPG
no_lanternfly
augmented_IMG_3805_processed_0.JPG
no_lanternfly
augmented_IMG_3805_processed_1.JPG
no_lanternfly
augmented_IMG_3805_processed_2.JPG
no_lanternfly
augmented_IMG_3805_processed_3.JPG
no_lanternfly
augmented_IMG_3805_processed_4.JPG
no_lanternfly
augmented_IMG_3805_processed_5.JPG
no_lanternfly
augmented_IMG_3805_processed_6.JPG
no_lanternfly
augmented_IMG_3805_processed_7.JPG
no_lanternfly
augmented_IMG_3805_processed_8.JPG
no_lanternfly
augmented_IMG_3805_processed_9.JPG
no_lanternfly
augmented_IMG_3807_processed_0.JPG
no_lanternfly
augmented_IMG_3807_processed_1.JPG
no_lanternfly
augmented_IMG_3807_processed_2.JPG
no_lanternfly
augmented_IMG_3807_processed_3.JPG
no_lanternfly
augmented_IMG_3807_processed_4.JPG
no_lanternfly
augmented_IMG_3807_processed_5.JPG
no_lanternfly
augmented_IMG_3807_processed_6.JPG
no_lanternfly
augmented_IMG_3807_processed_7.JPG
no_lanternfly
augmented_IMG_3807_processed_8.JPG
no_lanternfly
augmented_IMG_3807_processed_9.JPG
no_lanternfly
augmented_IMG_3809_processed_0.JPG
no_lanternfly
augmented_IMG_3809_processed_1.JPG
no_lanternfly
augmented_IMG_3809_processed_2.JPG
no_lanternfly
augmented_IMG_3809_processed_3.JPG
no_lanternfly
augmented_IMG_3809_processed_4.JPG
no_lanternfly
augmented_IMG_3809_processed_5.JPG
no_lanternfly
augmented_IMG_3809_processed_6.JPG
no_lanternfly
augmented_IMG_3809_processed_7.JPG
no_lanternfly
augmented_IMG_3809_processed_8.JPG
no_lanternfly
augmented_IMG_3809_processed_9.JPG
no_lanternfly
augmented_IMG_3810_processed_0.JPG
no_lanternfly
augmented_IMG_3810_processed_1.JPG
no_lanternfly
augmented_IMG_3810_processed_2.JPG
no_lanternfly
augmented_IMG_3810_processed_3.JPG
no_lanternfly
augmented_IMG_3810_processed_4.JPG
no_lanternfly
augmented_IMG_3810_processed_5.JPG
no_lanternfly
augmented_IMG_3810_processed_6.JPG
no_lanternfly
augmented_IMG_3810_processed_7.JPG
no_lanternfly
augmented_IMG_3810_processed_8.JPG
no_lanternfly
augmented_IMG_3810_processed_9.JPG
End of preview. Expand in Data Studio

Spotted Lanternfly Detection Dataset

Dataset Description

This dataset contains 33 images of spotted lanternflies and non-lanternfly subjects, cropped to 224x224 pixels for machine learning model training. The dataset includes both original images and augmented versions created using various data augmentation techniques to improve model robustness and generalization.

Dataset Summary

The dataset is designed for training computer vision models to detect spotted lanternflies (Lycorma delicatula), an invasive species that poses a significant threat to agriculture and ecosystems. The dataset includes comprehensive data augmentation to enhance model performance and reduce overfitting.

Supported Tasks

  • Image Classification: Binary classification to detect presence/absence of spotted lanternflies
  • Object Detection: Can be adapted for bounding box detection tasks
  • Transfer Learning: Suitable for fine-tuning pre-trained models

Dataset Structure

Original Data

  • Total Images: 33
  • Has Lanternfly: 15 images
  • No Lanternfly: 18 images
  • Image Size: 224x224 pixels
  • Format: RGB images in JPG format

Augmented Data

The dataset includes augmented versions of the original images created using the following techniques:

  1. Random Rotation: Images were randomly rotated between 0 and 360 degrees
  2. Random Horizontal Flip: Images had a 50% chance of being flipped horizontally
  3. Random Vertical Flip: Images had a 50% chance of being flipped vertically
  4. Color Jitter: Random changes were applied to:
    • Brightness (up to 20% variation)
    • Contrast (up to 20% variation)
    • Saturation (up to 20% variation)
    • Hue (up to 10% variation)

Data Fields

  • image: RGB image (224x224 pixels) as PIL Image object
  • label: String label ("has_lanternfly" or "no_lanternfly")
  • filename: Original filename of the image

Data Splits

  • original: All 33 images (no train/test split provided)

Usage

Basic Usage

from datasets import load_dataset

# Load the dataset
dataset = load_dataset("rlogh/lanternfly-images", split="original")

# View a sample
example = dataset[0]
image = example['image']  # PIL Image object
label = example['label']
filename = example['filename']

print(f"Label: {label}")
print(f"Image size: {image.size}")
print(f"Image mode: {image.mode}")

# Display the image
image.show()

Training a Model

from datasets import load_dataset
from transformers import AutoImageProcessor, AutoModelForImageClassification
import torch

# Load dataset
dataset = load_dataset("rlogh/lanternfly-images", split="original")

# Load a pre-trained model
model_name = "microsoft/resnet-50"
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(
    model_name, 
    num_labels=2,
    id2label={0: "no_lanternfly", 1: "has_lanternfly"},
    label2id={"no_lanternfly": 0, "has_lanternfly": 1}
)

Dataset Creation

Source Data

Images were collected and manually labeled for the presence or absence of spotted lanternflies. The original images were processed using computer vision techniques to automatically detect and crop around the spotted lanternfly subjects.

Image Processing Pipeline

  1. Object Detection: Used color-based and edge detection algorithms to identify spotted lanternflies
  2. Cropping: Automatically cropped 224x224 pixel regions around detected subjects
  3. Quality Control: Manual verification and labeling of all cropped images
  4. Data Augmentation: Applied comprehensive augmentation techniques to increase dataset diversity

Annotations

All images were manually annotated by domain experts with binary labels:

  • has_lanternfly: Image contains one or more spotted lanternflies
  • no_lanternfly: Image does not contain spotted lanternflies

Personal and Sensitive Information

This dataset does not contain any personal or sensitive information.

Considerations for Using the Data

Social Impact of Dataset

This dataset can be used to develop automated detection systems for spotted lanternflies, which can help in:

  • Early Detection: Identifying invasive species before they spread
  • Agricultural Monitoring: Protecting crops and agricultural resources
  • Environmental Conservation: Supporting ecosystem health and biodiversity
  • Research Applications: Advancing scientific understanding of invasive species

Discussion of Biases

The dataset may contain biases related to:

  • Lighting Conditions: Variations in natural lighting during image capture
  • Background Environments: Different settings where lanternflies were photographed
  • Seasonal Variations: Changes in lanternfly appearance across seasons
  • Geographic Location: Limited to specific regions where images were collected

Other Known Limitations

  • Limited Dataset Size: 33 images may be insufficient for complex deep learning models
  • Single Geographic Region: May not generalize to other geographic areas
  • Adult Focus: Primarily contains adult spotted lanternflies (nymphs may look different)
  • Manual Labeling: Subject to human annotation errors and inconsistencies

AI-Assisted Development

This dataset and its associated code were developed with the assistance of AI as a coding co-pilot. The AI helped with:

  • Image processing and cropping algorithms
  • Data augmentation implementation
  • Dataset formatting and upload to Hugging Face
  • Code optimization and error handling

The human developer maintained full control over the dataset design, labeling decisions, and final implementation, with AI serving as a collaborative tool to accelerate the development process.

Citation

@dataset{spotted_lanternfly_detection_2024,
  title={Spotted Lanternfly Detection Dataset with Data Augmentation},
  author={Your Name},
  year={2024},
  url={https://huggingface.co/datasets/rlogh/lanternfly-images},
  note={Includes original images and augmented versions with rotation, flipping, and color jitter}
}

License

This dataset is released under the MIT License. You are free to use, modify, and distribute this dataset for both commercial and non-commercial purposes.

Downloads last month
28

Models trained or fine-tuned on rlogh/lanternfly-images

Space using rlogh/lanternfly-images 1