Mask_rcnn: The prediction class is always 1

Created on 11 Apr 2018  路  4Comments  路  Source: matterport/Mask_RCNN

I used this work (just a mock of coco.py)and fed my own medical image data into the model,
the train and validation process looks good with a valid loss,
but the test result is terrible, and the class is always 1 with a high confidence.

Anyone has ideas to how to debug? I don't know how to see the result when training, which only indicates the losses.

Most helpful comment

Start by verifying that your Dataset class is generating the data correctly. Use the inspect_data notebook to visualize the images and verify that the code is generating the correct training targets.
If that's all okay, then use the inspect_model notebook to visualize the prediction process step by step and that should help you locate where the error is happening.

All 4 comments

  1. Are you sure your model isn't overfit ? (check your mrcnn_class_loss and val_mrcnn_class_loss)
  2. try to check your data whether each class data is balance.
  3. try to edit DETECTION_MAX_INSTANCES and DETECTION_MIN_CONFIDENCE

Thanks for your reply.

  1. No actually. And both losses are around 0.4.
  2. No, it is around 1:1.
  3. I haven't tried it and I will have a try.

Start by verifying that your Dataset class is generating the data correctly. Use the inspect_data notebook to visualize the images and verify that the code is generating the correct training targets.
If that's all okay, then use the inspect_model notebook to visualize the prediction process step by step and that should help you locate where the error is happening.

@wadmes This problem also occurs to me. And I found it calculates confidence as P(class|object), which doesn't take objectness into account. I revised some part of model.py(https://github.com/keineahnung2345/Mask_RCNN/commit/dfdfc7888ff7b74efd624082363a8eafff6ae043) and it calculate confidence as P(class|object)*P(object).
After this modification, it gives me a lower false positive rate.

Was this page helpful?
0 / 5 - 0 ratings