Dataset Ninja LogoDataset Ninja:

Pesteh Dataset

4231356
Tagfood
Taskobject detection
Release YearMade in 2021
LicenseCC BY 4.0
Download109 MB

Introduction #

Released 2021-05-03 ·Mohammad Rahimzadeh, Abolfazl Attar

The authors have unveiled and made available a novel Pesteh Dataset focusing on pistachios, comprising six videos totaling 167 seconds in length, with a total of 3927 labeled pistachios. Their objective was to introduce a novel system for quantifying the various types of pistachios using computer vision techniques. A distinctive aspect of their approach is that, unlike numerous existing studies, their model is designed to count pistachios within videos rather than static images. This poses a unique challenge as it necessitates assigning each pistachio across consecutive frames of the video, ensuring that each instance is accurately counted only once.

Motivation

In modern industries, automation plays a crucial role in enhancing efficiency and conserving resources. Among various sectors, the agricultural industry and its related fields stand out as needing further advancements in automation. Proper packaging of agricultural products not only boosts profitability but also minimizes crop losses. However, the classification of crop quality traditionally relies on human resources, leading to time-consuming processes, escalating costs, and often lacking the precision achieved by machines.

Pistachios, for instance, require human intervention for sorting and counting to evaluate crop quality based on whether their shells are open or close. Typically, pistachios are sorted into categories based on the shape of their shells—either open-mouth or closed-mouth—each with distinct pricing and value. Renowned for their nutritional value, pistachio kernels are rich in unsaturated fatty acids, fiber, carbohydrates, proteins, and various essential vitamins, making them highly beneficial for human consumption. Regular consumption of pistachio kernels has been linked to reduced risks of heart disease and positive effects on blood pressure among non-diabetic individuals, while also aiding in cancer prevention.

Pistachios hold significant economic importance, particularly in Middle Eastern countries like Iran, where they are a key agricultural product. Iran, the USA, and Turkey are the leading producers of pistachios globally. Notably, pistachios come in various types, exhibiting differences in size, color, and flavor depending on their variety and place of cultivation. Broadly, pistachios can be categorized into three main types: round, long, and jumbo, each with distinctive shell characteristics. For instance, long pistachios typically have a narrower split compared to round and jumbo varieties, which display a more pronounced shell opening.

image

Pistachios Assortment.

The average weight of a single pistachio shell is approximately 0.57 grams, translating to about 1750 shells per kilogram. Given this statistic, manually counting pistachios becomes an arduous and time-consuming task, ripe for automation through artificial intelligence. The detection and counting of pistachios serve multiple purposes, including facilitating proper packaging and assessing crop quality. Additionally, it aids in estimating future crop yields and breeding pistachio trees to enhance crop quality. Since open-mouth and closed-mouth pistachios differ significantly in price and demand, precise counting is essential for pistachio production and packaging facilities to ensure accurate inventory management. Moreover, segregating these two types of pistachios enhances the quality of export packages. The manual sorting of pistachios is not only labor-intensive but also economically impractical, making machine vision systems invaluable in this context. Furthermore, close pistachios, identified through such systems, can be recycled through mechanical opening methods, reducing losses and increasing overall crop yields. Machine vision, particularly leveraging deep learning techniques, has emerged as a powerful tool for automating tasks traditionally performed by humans. Deep convolutional neural networks, in particular, excel in recognizing and counting pistachios, although factors such as pistachio appearance and camera angles influence accuracy. The advancement of machine vision technology, coupled with the flexibility and adaptability of deep learning algorithms, offers promising prospects for automating pistachio counting and classification tasks with precision and efficiency.

Dataset description

The authors’ research marks the pioneering exploration into detecting, tracking, and counting pistachios along transportation lines, even under conditions of high density and occlusion. A significant challenge lies in accurately distinguishing between open-mouth and closed-mouth pistachios, as the former may appear as the latter when in motion or spinning on the transportation line. This phenomenon poses a formidable obstacle for many tracking algorithms, as the classification of pistachios may change between successive frames. However, the authors’ tracking and counting model successfully addresses this challenge, achieving high levels of accuracy. To detect pistachios in video frames, the authors employ the RetinaNet object detector. They adopt a stratified approach by partitioning the dataset into five folds, reserving 20 percent of the dataset for testing purposes while utilizing the remainder for training.

image

General Schematic of the proposed model.

In the authors’ research, one of the most relevant studies is fruit detection and counting, which employs various tools including black and white (B/W) cameras, color cameras, thermal cameras, and spectral cameras. However, the nature of the data dictates that color becomes a crucial feature, rendering B/W cameras unsuitable for the task. Similarly, the spectral camera’s time delay makes it impractical for this application. Despite its sensitivity to size, the thermal camera is not suitable for analyzing the data due to its inability to detect split pistachios. Consequently, the color camera emerges as the most suitable tool for the job. Additionally, color cameras offer the advantage of widespread availability, particularly in mobile phones, which can facilitate remote monitoring and control. While alternative methods such as sensors exist for counting, they are not suitable for this specific task due to the challenge of accurately counting split and non-split pistachios.

In Iran, pistachios are commonly referred to as Pesteh hence why the authors named their dataset Pesteh-Set. This dataset comprises two main components. The first part consists of 423 images, each meticulously labeled with ground truth data. The pistachios in these images are categorized into two classes: open and close with bounding boxes provided for each class. The number of pistachios per image varies from 1 to 27, totaling 3927 pistachios across all images. The second part of the dataset comprises six videos, totaling 9486 frames, which were utilized for the counting phase. These videos feature 561 pistachios in motion and over 350,000 individual pistachios collectively across all frames. Recorded using a cell phone camera with a resolution of 1920 × 1080 pixels, the dataset’s videos are captured at varying frame rates. Five of the videos are recorded at a frame rate of 60 frames per second (fps), while the remaining video is recorded at 30 fps. The cell phone camera was positioned on a wall above the transportation line for the pistachios. This line was designed to allow the pistachios to roll, a crucial feature as it enables open-mouth pistachios to reveal their open side as they roll, which may not be visible otherwise.

image

The General View of how Pesteh-Set was recoreded and the proposed system for counting the pistachios.

The authors utilized a self-developed program, leveraging the OpenCV library in Python, to label selected frames from the videos. In this labeling process, the pistachios were categorized into two classes: open-mouth and closed-mouth pistachios. Furthermore, the authors generously shared the self-developed labeling program along with all associated data, facilitating its use by other researchers to expand the Pistachio Dataset.

image

Some of the images in the Pesteh Set.

Number of Open-mouth Pistachios Number of Closed-mouth Pistachios Number of All the Pistachios
Video 1 50 20 70
Video 2 60 20 80
Video 3 70 20 90
Video 4 90 20 110
Video 5 100 20 120
Video 6 39 52 91
All Videos 409 152 561
All Images 1993 1934 3927

This table shows the distribution of Pistachios in the Pesteh Set.

ExpandExpand
Dataset LinkHomepageDataset LinkResearch PaperDataset LinkKaggle

Summary #

Pesteh Dataset is a dataset for object detection and counting tasks. It is used in the agricultural industry.

The dataset consists of 423 images with 3929 labeled objects belonging to 1 single class (pistachio).

Images in the Pesteh dataset have bounding box annotations. All images are labeled (i.e. with annotations). There are no pre-defined train/val/test splits in the dataset. Alternatively, the dataset could be split into 2 pistachios categories: open (1995 objects) and close (1934 objects). The dataset was released in 2021 by the University of Science and Technology, Iran and Sharif University of Technology, Iran.

Dataset Poster

Explore #

Pesteh dataset has 423 images. Click on one of the examples below or open "Explore" tool anytime you need to view dataset images with annotations. This tool has extended visualization capabilities like zoom, translation, objects table, custom filters and more. Hover the mouse over the images to hide or show annotations.

OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
OpenSample annotation mask from PestehSample image from Pesteh
👀
Have a look at 423 images
View images along with annotations and tags, search and filter by various parameters

Class balance #

There are 1 annotation classes in the dataset. Find the general statistics and balances for every class in the table below. Click any row to preview images that have labels of the selected class. Sort by column to find the most rare or prevalent classes.

Search
Rows 1-1 of 1
Class
Images
Objects
Count on image
average
Area on image
average
pistachio
rectangle
423
3929
9.29
6.75%

Images #

Explore every single image in the dataset with respect to the number of annotations of each class it has. Click a row to preview selected image. Sort by any column to find anomalies and edge cases. Use horizontal scroll if the table has many columns for a large number of classes in the dataset.

Object distribution #

Interactive heatmap chart for every class with object distribution shows how many images are in the dataset with a certain number of objects of a specific class. Users can click cell and see the list of all corresponding images.

Class sizes #

The table below gives various size properties of objects for every class. Click a row to see the image with annotations of the selected class. Sort columns to find classes with the smallest or largest objects or understand the size differences between classes.

Search
Rows 1-1 of 1
Class
Object count
Avg area
Max area
Min area
Min height
Min height
Max height
Max height
Avg height
Avg height
Min width
Min width
Max width
Max width
pistachio
rectangle
3929
0.76%
1.99%
0%
1px
0.17%
118px
19.67%
71px
11.83%
1px
0.09%
124px
11.59%

Spatial Heatmap #

The heatmaps below give the spatial distributions of all objects for every class. These visualizations provide insights into the most probable and rare object locations on the image. It helps analyze objects' placements in a dataset.

Spatial Heatmap

Objects #

Table contains all 3929 objects. Click a row to preview an image with annotations, and use search or pagination to navigate. Sort columns to find outliers in the dataset.

Search
Rows 1-10 of 3929
Object ID
Class
Image name
click row to open
Image size
height x width
Height
Height
Width
Width
Area
1
pistachio
rectangle
60-20_563.jpg
600 x 1070
90px
15%
64px
5.98%
0.9%
2
pistachio
rectangle
60-20_563.jpg
600 x 1070
42px
7%
67px
6.26%
0.44%
3
pistachio
rectangle
60-20_563.jpg
600 x 1070
78px
13%
61px
5.7%
0.74%
4
pistachio
rectangle
60-20_563.jpg
600 x 1070
58px
9.67%
63px
5.89%
0.57%
5
pistachio
rectangle
60-20_563.jpg
600 x 1070
72px
12%
49px
4.58%
0.55%
6
pistachio
rectangle
60-20_563.jpg
600 x 1070
82px
13.67%
59px
5.51%
0.75%
7
pistachio
rectangle
60-20_563.jpg
600 x 1070
71px
11.83%
68px
6.36%
0.75%
8
pistachio
rectangle
60-20_563.jpg
600 x 1070
94px
15.67%
57px
5.33%
0.83%
9
pistachio
rectangle
60-20_563.jpg
600 x 1070
74px
12.33%
62px
5.79%
0.71%
10
pistachio
rectangle
60-20_563.jpg
600 x 1070
60px
10%
48px
4.49%
0.45%

License #

Pistachios Dataset is under CC BY 4.0 license.

Source

Citation #

If you make use of the Pistachios data, please cite the following reference:

@article{rahimzadeh2021detecting,
  title={Detecting and counting pistachios based on deep learning},
  author={Rahimzadeh, Mohammad and Attar, Abolfazl},
  journal={Iran Journal of Computer Science},
  pages={1--13},
  year={2021},
  publisher={Springer}
}

Source

If you are happy with Dataset Ninja and use provided visualizations and tools in your work, please cite us:

@misc{ visualization-tools-for-pistachios-dataset,
  title = { Visualization Tools for Pesteh Dataset },
  type = { Computer Vision Tools },
  author = { Dataset Ninja },
  howpublished = { \url{ https://datasetninja.com/pistachios } },
  url = { https://datasetninja.com/pistachios },
  journal = { Dataset Ninja },
  publisher = { Dataset Ninja },
  year = { 2024 },
  month = { apr },
  note = { visited on 2024-04-14 },
}

Download #

Dataset Pesteh can be downloaded in Supervisely format:

As an alternative, it can be downloaded with dataset-tools package:

pip install --upgrade dataset-tools

… using following python code:

import dataset_tools as dtools

dtools.download(dataset='Pesteh', dst_dir='~/dataset-ninja/')

Make sure not to overlook the python code example available on the Supervisely Developer Portal. It will give you a clear idea of how to effortlessly work with the downloaded dataset.

The data in original format can be downloaded here.

. . .

Disclaimer #

Our gal from the legal dep told us we need to post this:

Dataset Ninja provides visualizations and statistics for some datasets that can be found online and can be downloaded by general audience. Dataset Ninja is not a dataset hosting platform and can only be used for informational purposes. The platform does not claim any rights for the original content, including images, videos, annotations and descriptions. Joint publishing is prohibited.

You take full responsibility when you use datasets presented at Dataset Ninja, as well as other information, including visualizations and statistics we provide. You are in charge of compliance with any dataset license and all other permissions. You are required to navigate datasets homepage and make sure that you can use it. In case of any questions, get in touch with us at hello@datasetninja.com.