ncoudray / DeepPATH

Classification of Lung cancer slide images using deep-learning
489 stars 210 forks source link

Color classification problem in 3-Analyze the outcome #137

Closed Gaodelike closed 1 year ago

Gaodelike commented 1 year ago

Hi Nicolas, It's me again. I want to ask if this sentence means to distinguish different categories by different colors?

colors are: black for class 1, red for class 2, blue for class 3, orange for class 4, green for class 5, purple otherwise

For example, I have four categories in my data, so will only use black, red, blue and orange in the generated heat map?

And there is another problem: Why are there a few blank places in the spliced pathology pictures? As shown in the figure below: image I haven't found how to perform splicing in the code,so I haven't solved this problem looking forward to your reply.Thanks!

Best

ncoudray commented 1 year ago

Hi -

For the colors, yes, it's the way it should work - (that code is now in the archive sub-folder - I actually don't use it anymore and will need to update the README at some point. I now use the "0f_HeatMap_nClasses_Overall.py there is a "project" option leading to different heatmaps with different colors, but you can easily change the code to add your own option / modify the colors)"

For the blank regions, regions where the tissue appears to dim or where there may be too much background is not saved. You can modify the threshold when tiling using the "-B" option to allow for more background (and the "-D" set to 0 if you're using the latest version of the code).

Best

Gaodelike commented 1 year ago

Hi,

I found my 4-category output file out_ filename_ Stats.txt does not seem to be fully applicable to 0f_ HeatMap_ nClasses_ Overall.py script. I checked the code of the script and found that dict_tiles_stats() the return value of the function is ['0 ',' 0 ',' 1 ',' 0 ',' 0 ']. I feel something is wrong. I think it should return the column [0.02164917 0.01519341 0.89687777 0.01225705 0.069666585]. I don't know if I understand it correctly. Here is my out_ filename_ Stats.txt, I don't know whether this output is consistent with yours. out_filename_Stats.txt

Hope to get your reply. Best

ncoudray commented 1 year ago

Hi. -which script did you use to get that out_filename_Stats.txt? It is only supported for a softmax trained model, not the multi-class sigmoid one

Best

Gaodelike commented 1 year ago

I use the script under the xClass directory: nc_ imagenet_ Eval.py, so it seems that I should use the multiClasses directory?

And I see tf.app.flags.DEFINE_ String ('mode ','0_softmax', "" "0_softmax or 1_sigmoid." ") This code assumes that only this parameter needs to be modified. How can I use this script correctly to get out_ filename_Stats.txt What about results?

ncoudray commented 1 year ago

the one under the xClass directory is the one you should use. But which options did you set? If mode was set to "1_sgimoid", then this is not compatible with the heatmap, etc... steps which are developed now for the softmax only

Gaodelike commented 1 year ago

I am using the parameter '1_sigmoid', is it only the heatmap that does not support multi-classification? Or can modify your source code to achieve the purpose? , In addition, does the probability distribution graph of Code in 03_postprocessing/multiClasses for probability distributions (mutation analysis) support multi-classification?

ncoudray commented 1 year ago

Hi - The multi-classification is indeed no longer used, but feel free to modify whatever needs to be modified for it to work in your case. I would of course suggest to double check the probability distributions code gives sensible results.