Closed ecm200 closed 3 years ago
Hi, did you have the correct format of ground-truth mask annotation for evaluation?
Hi @v-qjqs,
Thanks for you reply.
The format for the validation dataset is identical to that of the training set, and produced at the same time using the same algorithm.
All checks and tests for quality are performed on both datasets, so my feeling is that if the training is performing correctly, and the loss functions for the different parts of the network are reporting what look to be sensible values, then this indicates that the format is being read correctly by the network during training?
Here are example loss functions for each part of the network for a model that trained well. This produced 0.0 values for SEGM metrics when tested.
Specifically, the loss_mask is defined for both the training and validation datasets.
So, given that the validation loss functions are well defined, this then suggests that the format of the label data is correct, doesn't it?
Here's an example entry for an object annotation in my JSON file for the validation dataset.
A couple of things I have noticed whilst producing these plots and example annotation file:
As the polygon coordinates have been rounded, there are duplicate points in the polygon list, would this cause issues with the evaluation metrics?
For overlapping particles, I have not occluded the particle mask where overlap occurs. Should the particle masks be modified to remove the parts that are covered by another object?
{'id': 5153,
'image_id': 25,
'category_id': 1,
'bbox': [1052, 258, 19, 15],
'area': 103.21989078633487,
'segmentation': [[1071,
265,
1071,
266,
1070,
266,
1069,
267,
1069,
267,
1068,
267,
1068,
267,
1067,
268,
1067,
268,
1066,
268,
1065,
268,
1065,
269,
1064,
268,
1063,
268,
1061,
269,
1061,
269,
1060,
268,
1059,
269,
1059,
269,
1058,
269,
1057,
270,
1057,
270,
1056,
269,
1055,
269,
1055,
269,
1054,
268,
1054,
268,
1055,
267,
1054,
266,
1054,
266,
1053,
264,
1053,
264,
1053,
264,
1054,
264,
1054,
264,
1056,
263,
1056,
263,
1057,
263,
1058,
262,
1058,
262,
1059,
262,
1059,
262,
1060,
262,
1061,
262,
1062,
262,
1062,
262,
1063,
262,
1064,
261,
1064,
261,
1065,
261,
1066,
262,
1068,
261,
1068,
261,
1069,
261,
1070,
261,
1070,
262,
1069,
263,
1070,
264,
1070,
264,
1071,
265,
1071,
265]],
'iscrowd': 0}
For completeness, here's an example image from the validation dataset, showing both the bounding boxes and polygons. These have been loaded from the JSON annotations file using the COCO API.
Anybody have ideas what might be causing the 0.0 values in the SEGM metrics?
Very late but I am getting a similar issue when training my bbox-only model. The training loss decays nicely but all evaluation metrics are zero. It goes away when I switch around some operations in the training and testing pipelines, so I believe it's a data pipeline issue (i.e. an inconsistency between the training and testing data format). I opened a new issue here because I couldn't figure out what causes it to work or not work. I couldn't find much documentation on data augmentation that indicated there should be any issue like this.
Describe the bug
When using a custom dataset that trains adequately using Mask R-CNN architectures, evaluation of the test images results in 0.0 values for Segmentation Metrics (SEGM). I use a test script based on the example from the COCO documentation. There are no issues with the data training, with reasonable values for all losses. Also the COCO evaluation metrics report reasonable numbers for the BBOX metrics.
The training was performed using 4 Tesla P40 GPUs in parallel. The inference was undertaken on a single P40. The BBOX metrics of the final iteration for the evaluation are the same as those produced during the model training.
The resulting output from the evaluation call are shown below.
Evaluation Script Results
Steps taken so far
I have made many checks on the quality of my custom COCO dataset including making sure of the following:
The custom COCO dataset JSON uses the single array for mask description [[x1,y1,x2,y2,...,xn,yn]].
The example output from running the evaluation script can be seen below.
The model was trained and evaluated with MMDET version V2.0.0 and MMCV v0.5.3.
Environment for training and evaluation
I have since loaded the model weights into MMDET V2.3.0 and performed the same test, only to get the same results with BBOX metrics, and 0.0's for SEGM metrics.
Additional environment for testing
Reproduction
This is the evaluation script, which uses the evaluation method of the COCO dataset class to perform the metrics evaluation. The custom dataset class written for the custom dataset only merely changes the CLASSES class attributes to align with the custom dataset. All other methods are inherited unchanged from the CocoDataset class.
Evaluation Script with Test Set
Training Script
The model was trained using a custom training script based on the COCO example, and uses a custom modified COCO class dataset type.