Skip to content

Latest commit

 

History

History
79 lines (66 loc) · 3.54 KB

README.md

File metadata and controls

79 lines (66 loc) · 3.54 KB

MFCM_segmentation (Python 3.5)

Tissue Segmentation Using Modified Fuzzy C-Means Algorithm on Mammography (Image segmentation)

This code uses modified fuzzy c-means algorithm (MFCM) to do tissue segmentation on mammography. This code is a implementation of The paper:

[1] Z. Chen and R. Zwiggelaar, 2010. 'A Modified Fuzzy C Means Algorithm for Breast Tissue Density Segmentation in Mammograms’, IEEE/Information Technology and Applications in Biomedicine (ITAB) (https://ieeexplore.ieee.org/document/5687751)

How to run?

Run on mini data as default option

You just run main.py in editor or enter python main.py in command prompt. (In img directory, there are 2 images for the test. These images are part of mini-MIAS database. (http://peipa.essex.ac.uk/info/mias.html) )

User mode

If you want to replace the mini data with your own data, put your images to img directory or edit path for your direrectory in main.py.
If you change parameters of your experiment, you can change parameters by changing the default value of the argument in main.py or you can you the command line in command prompt.

  • You can see all the adjustable parameters and usage. python main.py --help (For example, if you want to cluster with 5 clusters, enter this command in your command prompt. python main.py -c 5)

Results

Getting filtered image..(This process can be time consuming.)
Time : 53.16970419883728
Iteration 0 : cost = 383.503160
Iteration 1 : cost = 130.096540
Iteration 2 : cost = 52.057745
Iteration 3 : cost = 36.463114
Iteration 4 : cost = 33.625992
Iteration 5 : cost = 40.136341
Iteration 6 : cost = 42.462534
Iteration 7 : cost = 29.869172
Iteration 8 : cost = 16.829851
Iteration 9 : cost = 10.073875
Iteration 10 : cost = 6.756716
Iteration 11 : cost = 4.957472
Iteration 12 : cost = 3.912657
Iteration 13 : cost = 3.158448
Iteration 14 : cost = 2.573333
Iteration 15 : cost = 2.098461
Iteration 16 : cost = 1.710719
Iteration 17 : cost = 1.394245
Iteration 18 : cost = 1.136231
Iteration 19 : cost = 0.925994
Iteration 20 : cost = 0.754842
Iteration 21 : cost = 0.615388
Iteration 22 : cost = 0.501762
Iteration 23 : cost = 0.409169
Iteration 24 : cost = 0.333715
Iteration 25 : cost = 0.272221
Iteration 26 : cost = 0.222079
Iteration 27 : cost = 0.181186
Iteration 28 : cost = 0.147834
Iteration 29 : cost = 0.120628
Iteration 30 : cost = 0.098434
Iteration 31 : cost = 0.080326
Iteration 32 : cost = 0.065552
Iteration 33 : cost = 0.053496
Iteration 34 : cost = 0.043659
Image Result
mdb321.jpg
mdb322.jpg

Troubleshooting:

  1. If it is not an 8-bit image, the code needs to be modified.
  2. When there is a problem with the environment, you can try this command line in your command prompt.
     pip install -r requirements.txt 

References

TODO:

  • It takes a lot of time to get the filtered image. This problem can be solved by using numpy.lib.stride_tricks.as_strided.