Clear Filters
Clear Filters

mask rcnn does not detect mask

8 views (last 30 days)
영훈 정
영훈 정 on 19 Apr 2024
Answered: Shubham on 17 May 2024
I'm practicing mrcnn.
I entered img, box, labeling, and mask well to proceed with the training.
The trained network recognizes and distinguishes boxes and labels well.
Mask appears as the same single array as the number of boxes.
But the mask was an array that was all zeros.
In this case, the problem is that you entered the mask incorrectly?
Or this net still unable to distinguish it due to the small amount of training?
I did not allocate much time to training due to a problem with computer specifications. It is a network that did 10 epoch 900 iteration.

Answers (1)

Shubham
Shubham on 17 May 2024
When you encounter a situation where the Mask R-CNN model is able to recognize and distinguish boxes and labels correctly but the masks are just arrays of zeros, there are a few potential issues to consider. Let's explore both possibilities you mentioned:
1. Incorrect Mask Input
It's crucial to ensure that the masks are correctly prepared and fed into the network. Masks should be binary arrays that indicate the pixels of an object for segmentation. Each mask should correspond to an object in the image, with the same dimensions as the input image but focusing only on the object it represents. Common mistakes include:
  • Incorrect mask format: Masks should be binary (0s and 1s), where 1s represent the object and 0s represent the background.
  • Incorrect mask dimensions or alignment: Each mask should align perfectly with its corresponding object in the input image. Misalignment or incorrect dimensions can lead the network to learn incorrect representations.
  • Improper handling of multiple objects: Ensure that for images with multiple objects, each object has a separate mask array, and these are correctly associated with their respective bounding boxes and labels.
2. Insufficient Training
Although Mask R-CNN can achieve significant results even with relatively small datasets, the amount of training can greatly influence its performance, especially for complex tasks such as instance segmentation. Here are a few considerations:
  • Underfitting: With only 10 epochs and 900 iterations, the network might not have had enough exposure to the data to learn the complex task of mask prediction. This is especially true if the dataset is varied or the task is particularly challenging.
  • Learning rate and optimization: If the learning rate is not set appropriately, the network might not converge to a good solution. Similarly, the choice of optimizer and its settings can impact training effectiveness.
  • Complexity of the dataset: Some datasets are inherently more challenging due to factors like object occlusion, variability in object appearance, or complex backgrounds. More training time or a larger dataset might be necessary to achieve good performance.
Next Steps
  • Verify Mask Inputs: Double-check how the masks are prepared and fed into the network. Ensure they are correctly formatted, aligned, and associated with their corresponding objects.
  • Increase Training: If possible, try to increase the number of epochs or iterations, given your hardware limitations. This could help the network learn more complex patterns and improve mask prediction.
  • Experiment with Hyperparameters: Adjusting learning rates, batch sizes, or even the architecture (e.g., the depth of the feature extractor) can sometimes yield better results.
  • Data Augmentation: If you're limited by dataset size or diversity, data augmentation can be a powerful tool to improve model robustness and performance without needing more original data.
In summary, it could be a combination of both issues: incorrect mask inputs and insufficient training. Addressing both could help improve your model's performance on mask prediction.
I hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!