1. 程式人生 > >PASCAL VOC 2007 資料集分析

PASCAL VOC 2007 資料集分析

1 VOC2007基本資訊

作為標準資料集,voc-2007 是衡量影象分類識別能力的基準。
faster-rcnn,yolo -v1, yolo-v2都以此資料集為最為演示樣例,因此,有必要了解一下本資料集的組成架構。

VOC資料集共包含:訓練集(5011幅),測試集(4952幅),共計9963幅圖,共包含20個種類。

aeroplane
bicycle
bird
boat
bottle
bus
car
cat
chair
cow
diningtable
dog
horse
motorbike
person
pottedplant
sheep
sofa
train
tvmonitor


2 各類別統計資訊

20個類別中,後面數字代表資料集中對應的的正樣本影象個數(非目標個數)。

- 訓練集

aeroplane 238
bicycle 243
bird 330
boat 181
bottle 244
bus 186
car 713
cat 337
chair 445
cow 141
diningtable 200
dog 421
horse 287
motorbike 245
person 2008
pottedplant 245
sheep 96
sofa 229
train 261
tvmonitor 256

- 測試集

aeroplane 204
bicycle 239
bird 282
boat 172
bottle 212
bus 174
car 721
cat 322
chair 417
cow 127
diningtable 190
dog 418
horse 274
motorbike 222
person 2007
pottedplant 224
sheep 97
sofa 223
train 259
tvmonitor 229

可以看出,除了person數量較多,其他類別樣本個數不算多,在如此小的資料集上,深度學習能獲得較高的分類識別結果,足以說明深度學習的強大效能。

3、 VOC2007具體資訊

PASCAL VOC2012作為例子。下載地址為:點選開啟連結 下載完之後解壓,可以在VOCdevkit目錄下的VOC2012中看到如下的檔案:

資料集的組成架構如下:

  • Annotations —目標真值區域
  • ImageSets —-類別標籤
  • JPEGImages —–影象
  • SegmentationClass
  • SegmentationObjec

具體結構如下:
  • Annotation 
    • *.xml
  • ImageSets 
    • Action 
      • *_train.txt
      • *_trainval.txt
      • *_val.txt
    • Layout 
      • train.txt
      • trainval.txt
      • val.txt
    • Main 
      • *_train.txt
      • *_trainval.txt
      • *_val.txt
    • Segmentation 
      • train.txt
      • trainval.txt
      • val.txt
  • JPEGImages 
    • *.jpg
  • SegmentationClass 
    • *.png
  • SegmentationObject 
    • *.png
JPEGImages JPEGImages資料夾中包含了PASCAL VOC所提供的所有的圖片資訊,包括了訓練圖片和測試圖片。 JPEGImages 中存放原始影象,這些影象都是以“年份_編號.jpg”格式命名圖片的畫素尺寸大小不一,一般為(橫向圖) 500*375 或(縱向圖) 375*500;基本不會偏差超過100。(在之後的訓練中,第一步就是將這些圖片都resize到300*300或是500*500,所有原始圖片不能離這個標準過遠。)這些影象就是用來進行訓練和測試驗證的影象資料。
Annotations
Annotations資料夾中存放的是xml格式的標籤檔案,每一個xml檔案都對應於JPEGImages資料夾中的一張圖片。 xml檔案的具體格式如下:(對於2007_000392.jpg) [html]view plaincopy
  1. <annotation>  
  2.     <folder>VOC2012</folder>                             
  3.     <filename>2007_000392.jpg</filename>                               //檔名  
  4.     <source>                                                           //影象來源(不重要)  
  5.         <database>The VOC2007 Database</database>  
  6.         <annotation>PASCAL VOC2007</annotation>  
  7.         <image>flickr</image>  
  8.     </source>  
  9.     <size>                                               //影象尺寸(長寬以及通道數)                        
  10.         <width>500</width>  
  11.         <height>332</height>  
  12.         <depth>3</depth>  
  13.     </size>  
  14.     <segmented>1</segmented>                                   //是否用於分割(在影象物體識別中01無所謂)  
  15.     <object>                                                           //檢測到的物體  
  16.         <name>horse</name>                                         //物體類別  
  17.         <pose>Right</pose>                                         //拍攝角度  
  18.         <truncated>0</truncated>                                   //是否被截斷(0表示完整)  
  19.         <difficult>0</difficult>                                   //目標是否難以識別(0表示容易識別)  
  20.         <bndbox>                                                   //bounding-box(包含左下角和右上角xy座標)  
  21.             <xmin>100</xmin>  
  22.             <ymin>96</ymin>  
  23.             <xmax>355</xmax>  
  24.             <ymax>324</ymax>  
  25.         </bndbox>  
  26.     </object>  
  27.     <object>                                                           //檢測到多個物體  
  28.         <name>person</name>  
  29.         <pose>Unspecified</pose>  
  30.         <truncated>0</truncated>  
  31.         <difficult>0</difficult>  
  32.         <bndbox>  
  33.             <xmin>198</xmin>  
  34.             <ymin>58</ymin>  
  35.             <xmax>286</xmax>  
  36.             <ymax>197</ymax>  
  37.         </bndbox>  
  38.     </object>  
  39. </annotation>  
對應的圖片為: ImageSets ImageSets 中有四個資料夾【Action】【Layout】【Main】【Segmentation】

ImageSets存放的是每一種型別的challenge對應的影象資料。
Action下存放的是人的動作(例如running、jumping等等,這也是VOC challenge的一部分) Layout下存放的是具有人體部位的資料(人的head、hand、feet等等,這也是VOC challenge的一部分) Main下存放的是影象物體識別的資料,總共分為20類。 Segmentation下存放的是可用於分割的資料。
分類識別只關注【Main】,它內部儲存20個分類類別標籤,-1表示負樣本,+1為正樣本
*_train.txt 訓練樣本集 
*_val.txt 評估樣本集 
*_trainval.txt 訓練與評估樣本彙總

這些txt中的內容都差不多如下: 前面的表示影象的name,後面的1代表正樣本,-1代表負樣本。 _train中存放的是訓練使用的資料,每一個class的train資料都有5717個。 _val中存放的是驗證結果使用的資料,每一個class的val資料都有5823個。 _trainval將上面兩個進行了合併,每一個class有11540個。 需要保證的是train和val兩者沒有交集,也就是訓練資料和驗證資料不能有重複,在選取訓練資料的時候 ,也應該是隨機產生的。

1 VOC2007基本資訊

作為標準資料集,voc-2007 是衡量影象分類識別能力的基準。
faster-rcnn,yolo -v1, yolo-v2都以此資料集為最為演示樣例,因此,有必要了解一下本資料集的組成架構。

VOC資料集共包含:訓練集(5011幅),測試集(4952幅),共計9963幅圖,共包含20個種類。

aeroplane
bicycle
bird
boat
bottle
bus
car
cat
chair
cow
diningtable
dog
horse
motorbike
person
pottedplant
sheep
sofa
train
tvmonitor


2 各類別統計資訊

20個類別中,後面數字代表資料集中對應的的正樣本影象個數(非目標個數)。

- 訓練集

aeroplane 238
bicycle 243
bird 330
boat 181
bottle 244
bus 186
car 713
cat 337
chair 445
cow 141
diningtable 200
dog 421
horse 287
motorbike 245
person 2008
pottedplant 245
sheep 96
sofa 229
train 261
tvmonitor 256

- 測試集

aeroplane 204
bicycle 239
bird 282
boat 172
bottle 212
bus 174
car 721
cat 322
chair 417
cow 127
diningtable 190
dog 418
horse 274
motorbike 222
person 2007
pottedplant 224
sheep 97
sofa 223
train 259
tvmonitor 229

可以看出,除了person數量較多,其他類別樣本個數不算多,在如此小的資料集上,深度學習能獲得較高的分類識別結果,足以說明深度學習的強大效能。

3、 VOC2007具體資訊

PASCAL VOC2012作為例子。下載地址為:點選開啟連結 下載完之後解壓,可以在VOCdevkit目錄下的VOC2012中看到如下的檔案:

資料集的組成架構如下:

  • Annotations —目標真值區域
  • ImageSets —-類別標籤
  • JPEGImages —–影象
  • SegmentationClass
  • SegmentationObjec

具體結構如下:
  • Annotation 
    • *.xml
  • ImageSets 
    • Action 
      • *_train.txt
      • *_trainval.txt
      • *_val.txt
    • Layout 
      • train.txt
      • trainval.txt
      • val.txt
    • Main 
      • *_train.txt
      • *_trainval.txt
      • *_val.txt
    • Segmentation 
      • train.txt
      • trainval.txt
      • val.txt
  • JPEGImages 
    • *.jpg
  • SegmentationClass 
    • *.png
  • SegmentationObject 
    • *.png
JPEGImages JPEGImages資料夾中包含了PASCAL VOC所提供的所有的圖片資訊,包括了訓練圖片和測試圖片。 JPEGImages 中存放原始影象,這些影象都是以“年份_編號.jpg”格式命名圖片的畫素尺寸大小不一,一般為(橫向圖) 500*375 或(縱向圖) 375*500;基本不會偏差超過100。(在之後的訓練中,第一步就是將這些圖片都resize到300*300或是500*500,所有原始圖片不能離這個標準過遠。)這些影象就是用來進行訓練和測試驗證的影象資料。
Annotations
Annotations資料夾中存放的是xml格式的標籤檔案,每一個xml檔案都對應於JPEGImages資料夾中的一張圖片。 xml檔案的具體格式如下:(對於2007_000392.jpg) [html]view plaincopy
  1. <annotation>  
  2.     <folder>VOC2012</folder>                             
  3.     <filename>2007_000392.jpg</filename>                               //檔名  
  4.     <source>                                                           //影象來源(不重要)  
  5.         <database>The VOC2007 Database</database>  
  6.         <annotation>PASCAL VOC2007</annotation>  
  7.         <image>flickr</image>  
  8.     </source>  
  9.     <size>                                               //影象尺寸(長寬以及通道數)                        
  10.         <width>500</width>  
  11.         <height>332</height>  
  12.         <depth>3</depth>  
  13.     </size>  
  14.     <segmented>1</segmented>                                   //是否用於分割(在影象物體識別中01無所謂)  
  15.     <object>                                                           //檢測到的物體  
  16.         <name>horse</name>                                         //物體類別  
  17.         <pose>Right</pose>                                         //拍攝角度  
  18.         <truncated>0</truncated>                                   //是否被截斷(0表示完整)  
  19.         <difficult>0</difficult>                                   //目標是否難以識別(0表示容易識別)  
  20.         <bndbox>                                                   //bounding-box(包含左下角和右上角xy座標)  
  21.             <xmin>100</xmin>  
  22.             <ymin>96</ymin>  
  23.             <xmax>355</xmax>  
  24.             <ymax>324</ymax>  
  25.         </bndbox>  
  26.     </object>  
  27.     <object>                                                           //檢測到多個物體  
  28.         <name>person</name>  
  29.         <pose>Unspecified</pose>  
  30.         <truncated>0</truncated>  
  31.         <difficult>0</difficult>  
  32.         <bndbox>  
  33.             <xmin>198</xmin>  
  34.             <ymin>58</ymin>  
  35.             <xmax>286</xmax>  
  36.             <ymax>197</ymax>  
  37.         </bndbox>  
  38.     </object>  
  39. </annotation>  
對應的圖片為: ImageSets ImageSets 中有四個資料夾【Action】【Layout】【Main】【Segmentation】

ImageSets存放的是每一種型別的challenge對應的影象資料。
Action下存放的是人的動作(例如running、jumping等等,這也是VOC challenge的一部分) Layout下存放的是具有人體部位的資料(人的head、hand、feet等等,這也是VOC challenge的一部分) Main下存放的是影象物體識別的資料,總共分為20類。 Segmentation下存放的是可用於分割的資料。
分類識別只關注【Main】,它內部儲存20個分類類別標籤,-1表示負樣本,+1為正樣本
*_train.txt 訓練樣本集 
*_val.txt 評估樣本集 
*_trainval.txt 訓練與評估樣本彙總

這些txt中的內容都差不多如下: 前面的表示影象的name,後面的1代表正樣本,-1代表負樣本。 _train中存放的是訓練使用的資料,每一個class的train資料都有5717個。 _val中存放的是驗證結果使用的資料,每一個class的val資料都有5823個。 _trainval將上面兩個進行了合併,每一個class有11540個。 需要保證的是train和val兩者沒有交集,也就是訓練資料和驗證資料不能有重複,在選取訓練資料的時候 ,也應該是隨機產生的。