Giter Site home page Giter Site logo

keiserlab / plaquebox-paper Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 25.0 32.4 MB

Repo for Tang et al, bioRxiv 454793 (2018)

License: MIT License

Python 0.06% Jupyter Notebook 99.94%
alzheimers-disease amlyoid-plaques convolutional-neural-networks deep-learning dementia explainable-ai immunohistochemical-images interpretable-machine-learning machine-learning medical-image-analysis pathology plaques saliency-map

plaquebox-paper's People

Contributors

kangway avatar mjke avatar ziqitang919 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

plaquebox-paper's Issues

CSVs folder and excel files contents issues

I have being able to run notebooks 1.1, 1.2 and 1.3 successfully, but i am having issues with 2.1, i wanted to know how the CSVs directory and the excel files within the CSVs directory were generated, since the error message i receive when i run notebook 2.1 says, no such file directory found for both "train" and "dev".

Thank you.
Screenshot from 2024-03-19 16-51-46
Screenshot from 2024-03-19 16-51-57
Screenshot from 2024-03-19 16-52-03

Step 2.1 FileNotFoundError: [Errno 2] No such file or directory

When running 2.1) CNN Models - Model Training and Development.ipynb on my Ubuntu 18.04 machine, in the 12th cell, I get the following error:

FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "<ipython-input-5-8e25f5046706>", line 32, in __getitem__
    img_as_img = Image.open(self.img_path + single_image_name)
  File "/home/user/.local/lib/python3.7/site-packages/PIL/Image.py", line 2766, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'data/seg/size_filtered/blobs/NA4757-02_AB/NA4757-02_AB_13_24_27.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/user/.local/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/user/.local/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "<ipython-input-5-8e25f5046706>", line 34, in __getitem__
    img_as_img = Image.open(NEGATIVE_DIR + single_image_name)
  File "/home/user/.local/lib/python3.7/site-packages/PIL/Image.py", line 2766, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'data/seg/negatives/NA4757-02_AB/NA4757-02_AB_13_24_27.jpg'

This is most likely due to a faulty train.csv file or missing images in the data/seg/size_filtered/blobs/ directory. Reviewing the code, the error above is a result of the code attempting to load an image that does not exist:

 def __getitem__(self, index):
    # Get label(class) of the image based on the cropped pandas column
    single_image_label = self.labels[index]
    raw_label = self.raw_labels[index]
    # Get image name from the pandas df
    single_image_name = str(self.data_info.loc[index,'imagename'])
    # Open image
    try:
        img_as_img = Image.open(self.img_path + single_image_name)
    except:
        img_as_img = Image.open(NEGATIVE_DIR + single_image_name)
    # Transform image to tensor
    if self.transform is not None:
        img_as_img = self.transform(img_as_img)
    # Return image and the label
    return (img_as_img, single_image_label, raw_label, single_image_name)

Although I am not sure of the exact cause of this problem. I am trying to reproduce your results with your code, any ideas?

CSV file

I have a question regarding the CSV files in this repository and CSV files in the Tiles.zip file (Zenodo).

What is the significance of the numeric value for each of the classes (cored, diffuse, CAA, negative). They are not in one-hot encoding, and also do not sum to 1 over rows which would suggest a probability distribution. For example: the second row in the screenshot below has CAA=2, Negative = 0.1233, Flag=2, and Not sure=0.1233. It easy to take the argmax and assume that is the ground truth, but I would like to better understand what these numbers mean for each column. Another image has Diffuse=1.9404 and Not sure=1. What do these numbers represent? Also, what is the significance of the numeric value for the "flag" column, if any?

Screenshot from CSV file in Tiles.zip Zenodo
image

Unable to reproduce CNN scores

Hello,

I am attempting to reproduce your results but am seeing differences in the WSI CNN count results. Example WSI NA5001_2AB:

  • My results. Cored: 41, Diffuse: 288, CAA: 649
  • Your results. Cored: 7, Diffuse: 410, CAA: 595

All packages I have matched, e.g. version 3.4.1 of libopencv/opencv/py-opencv, version 0.3.0 of torch, pyvips 2.1.2 with libvips 8.2.2. I should say that I am on a Windows 10 machine so this could very well be the problem, but just wanted to check first that I haven't missed something else.

When running notebook 2.2) I get the same AUC-PRC scores and so it seems the model is working correctly and giving the correct confidence.

I have also checked the stain normalization is working as intended by comparing 256x256 patches from the training data set provided in the Zenodo link to the equivalent cropped images produced when processing the WSIs with notebooks 1.1)-1.3). So I believe the WSIs are correctly stain normalized.

Would it be at all possible to see your prediction confidence heatmap for the example above so that I can inspect? I suspect this is where the differences lie that lead to the discrepancy.

Bound Boxes Coordinates

Hi, I'm trying to use the alzhaimer dataset in a explicability metric study and I'd like to know if could you provide de bound boxes coordinate of the tiles images.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.