Wrong labels in SVHN dataset? [closed]

I’ve been doing some experimentation with SVHN dataset, mainly I wanted to crop out each digit before doing some training when accidentally I noticed that image 53.png from test dataset has wrong labels (9 and 3, instead of 3 and 3).

I’m curious if anyone can also replicate the problem and if the labels are really wrong maybe suggest what should be done with it?

I downloaded dataset from the official website, unzipped it and tried reading digitStruct.mat.
my code (assuming all the data is in data/train folder):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import os
from PIL import Image
from pymatreader import read_mat
import matplotlib.pyplot as plt
train_mat = read_mat('data/train/digitStruct.mat')
print(train_mat['digitStruct']['name'][52])
print(train_mat['digitStruct']['bbox'][52])
</code>
<code>import os from PIL import Image from pymatreader import read_mat import matplotlib.pyplot as plt train_mat = read_mat('data/train/digitStruct.mat') print(train_mat['digitStruct']['name'][52]) print(train_mat['digitStruct']['bbox'][52]) </code>
import os
from PIL import Image
from pymatreader import read_mat
import matplotlib.pyplot as plt
train_mat = read_mat('data/train/digitStruct.mat')

print(train_mat['digitStruct']['name'][52])
print(train_mat['digitStruct']['bbox'][52])

Returns

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>>>53.png
>>{'label': [9.0, 3.0], 'height': [84.0, 84.0], 'width': [59.0, 52.0], 'left': [160.0, 208.0], 'top': [34.0, 18.0]}
</code>
<code>>>53.png >>{'label': [9.0, 3.0], 'height': [84.0, 84.0], 'width': [59.0, 52.0], 'left': [160.0, 208.0], 'top': [34.0, 18.0]} </code>
>>53.png
>>{'label': [9.0, 3.0], 'height': [84.0, 84.0], 'width': [59.0, 52.0], 'left': [160.0, 208.0], 'top': [34.0, 18.0]}

I also tried displaying other images in case there are similar anomalies but I haven’t noticed anything.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import cv2
from matplotlib import pyplot as plt
fig = plt.figure(figsize=(10, 7))
# Read the images using OpenCV (OpenCV loads images in BGR format)
image1 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][0])
image2 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][27])
image3 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][52])
image4 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][90])
# Convert the images from BGR to RGB format so Matplotlib can display them correctly
image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2RGB)
image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2RGB)
image3 = cv2.cvtColor(image3, cv2.COLOR_BGR2RGB)
image4 = cv2.cvtColor(image4, cv2.COLOR_BGR2RGB)
# Add the first image to the figure (top-left position)
plt.subplot(2, 2, 1) # 2 rows, 2 columns, first position
plt.imshow(image1)
plt.axis('off') # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][0] + 'n' + str(train_mat['digitStruct']['bbox'][0]['label']))
# Add the second image to the figure (top-right position)
plt.subplot(2, 2, 2) # 2 rows, 2 columns, second position
plt.imshow(image2)
plt.axis('off') # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][27] + 'n' + str(train_mat['digitStruct']['bbox'][27]['label']))
# Add the third image to the figure (bottom-left position)
plt.subplot(2, 2, 3) # 2 rows, 2 columns, third position
plt.imshow(image3)
plt.axis('off') # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][52] + 'n' + str(train_mat['digitStruct']['bbox'][52]['label']))
# Add the fourth image to the figure (bottom-right position)
plt.subplot(2, 2, 4) # 2 rows, 2 columns, fourth position
plt.imshow(image4)
plt.axis('off') # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][90] + 'n' + str(train_mat['digitStruct']['bbox'][90]['label']))
</code>
<code>import cv2 from matplotlib import pyplot as plt fig = plt.figure(figsize=(10, 7)) # Read the images using OpenCV (OpenCV loads images in BGR format) image1 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][0]) image2 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][27]) image3 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][52]) image4 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][90]) # Convert the images from BGR to RGB format so Matplotlib can display them correctly image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2RGB) image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2RGB) image3 = cv2.cvtColor(image3, cv2.COLOR_BGR2RGB) image4 = cv2.cvtColor(image4, cv2.COLOR_BGR2RGB) # Add the first image to the figure (top-left position) plt.subplot(2, 2, 1) # 2 rows, 2 columns, first position plt.imshow(image1) plt.axis('off') # Hide the axis labels plt.title(train_mat['digitStruct']['name'][0] + 'n' + str(train_mat['digitStruct']['bbox'][0]['label'])) # Add the second image to the figure (top-right position) plt.subplot(2, 2, 2) # 2 rows, 2 columns, second position plt.imshow(image2) plt.axis('off') # Hide the axis labels plt.title(train_mat['digitStruct']['name'][27] + 'n' + str(train_mat['digitStruct']['bbox'][27]['label'])) # Add the third image to the figure (bottom-left position) plt.subplot(2, 2, 3) # 2 rows, 2 columns, third position plt.imshow(image3) plt.axis('off') # Hide the axis labels plt.title(train_mat['digitStruct']['name'][52] + 'n' + str(train_mat['digitStruct']['bbox'][52]['label'])) # Add the fourth image to the figure (bottom-right position) plt.subplot(2, 2, 4) # 2 rows, 2 columns, fourth position plt.imshow(image4) plt.axis('off') # Hide the axis labels plt.title(train_mat['digitStruct']['name'][90] + 'n' + str(train_mat['digitStruct']['bbox'][90]['label'])) </code>
import cv2 
from matplotlib import pyplot as plt  

fig = plt.figure(figsize=(10, 7))

# Read the images using OpenCV (OpenCV loads images in BGR format)
image1 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][0])
image2 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][27])
image3 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][52])
image4 = cv2.imread('data/train/' + train_mat['digitStruct']['name'][90])

# Convert the images from BGR to RGB format so Matplotlib can display them correctly
image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2RGB)
image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2RGB)
image3 = cv2.cvtColor(image3, cv2.COLOR_BGR2RGB)
image4 = cv2.cvtColor(image4, cv2.COLOR_BGR2RGB)

# Add the first image to the figure (top-left position)
plt.subplot(2, 2, 1)  # 2 rows, 2 columns, first position
plt.imshow(image1)  
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][0] + 'n' + str(train_mat['digitStruct']['bbox'][0]['label']))

# Add the second image to the figure (top-right position)
plt.subplot(2, 2, 2)  # 2 rows, 2 columns, second position
plt.imshow(image2)  
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][27] + 'n' + str(train_mat['digitStruct']['bbox'][27]['label'])) 

# Add the third image to the figure (bottom-left position)
plt.subplot(2, 2, 3)  # 2 rows, 2 columns, third position
plt.imshow(image3) 
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][52] + 'n' + str(train_mat['digitStruct']['bbox'][52]['label']))  
# Add the fourth image to the figure (bottom-right position)
plt.subplot(2, 2, 4)  # 2 rows, 2 columns, fourth position
plt.imshow(image4)  
plt.axis('off')  # Hide the axis labels
plt.title(train_mat['digitStruct']['name'][90] + 'n' + str(train_mat['digitStruct']['bbox'][90]['label']))

Output: SVHN comparison

New contributor

nikola310 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật