This project focuses on detecting the mass for mammogram based on Mask RCNN models using part of CBIS-DDSM dataset. Considering the small size of dataset, we preprocess it carefully and generate clean data using opencv and scikit. Finally, we use Mask-RCNN pretrained on ImageNet dataset to train based on detectron2.😄
The preprocess includes removing artifact, removing pectoral and adding black border based on opencv and scikit. Some outcomes are showed below. (The figures of outcome)
methods
1. cv2.equalizeHist() 2. skimage.feature.canny() 3. cv2.morphologyEx() 4. skimage.filter.sobel()procedures
1. remove_artifact: image —> gray image —> (cv2.THRESH_OTSU) thresh —> (cv2.MORPH_CLOSE, cv2.MORPH_OPEN, cv2.MORPH_DILATE,cv2.morphologyEx) morph —> (get_largest_area)mask —> remove artifact2. remove_pectoral: image removed artifact —> orient —> equalHist —> canny detection —> sobel —> morphological operation —> canny edge detection
3. add_border_denoise
usage
1. adjust your directory like this:|--CBIS-DDSM
|&emsp |--mass_train
|&emsp &emsp |--mass_train
| &emsp |--mass_test
| &emsp &emsp |--mass_test
2. upload the image_process.py
3. adjust the original directory of CBIS-DDSM and run it
Here are some test results and if you want to see more, you can read from the direcotry of /preprocess/preprocess_test_result
original figure | after thresholding and morph | after removing artifact |
---|---|---|
after equalHist,canny,sobel | after morph | after canny |
---|---|---|
after hough line detection | after selecting |
---|---|
usage
1. upload the utils.py2. run the code
- CBIS-DDSM is not completely used and this experiment just use about 1200 mass train dataset and about 360 mass test datasets.
- The quality of medical images are not stable so some pictures can not be preprocessed well while some others can.
- The procedure of preprocessing also generates noise of images which can be seen obviously through artifact_mask.jpg
- I would appreciate it very much if you could give me a star.❤️
- Improvements are encouraged and I am expected to that.🌈
Many thanks for useful references below💗