Git Product home page Git Product logo

ssl4mis's People

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  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  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  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

ssl4mis's Issues

Question about MSE used here.

您好~我最近刚开始接触半监督的东西。很感谢您提供的论文及代码资源,但是在尝试的时候发现我跑train_efficient_unet_2D_mean_teacher.py这个代码的时候在有MSE那一项consistency loss的时候反而使得结果变差了,我对比了在有和没有MSE这一项(其他保持一样)的情况下,用各自最后一次迭代的模型使用test_efficient_unet_2D_acdc.py进行测试,发现在使用MSE的时候测试结果感觉已经崩溃了(使用您提供的ACDC数据)。最差的一类dice只有0.5左右。同时也发现,这个存下来的best模型通常都在迭代次数的靠前位置,而这时通常mse这一项本身就比较小,是不是mse这一项引入反而造成训练不对了。不知道您那边跑代码的过程中是否有类似的情况?或者是我运行的时候有什么需要额外注意的地方。现在都是使用默认参数直接跑了一次。

Problem in ACDC

After downloading the dataset from the link provided and placing the unzipped files in ..data/ACDC folder, whenever I run any code (e.g. mean teacher/cross pseudo supervision, both in 2D), the following error occurs. However, this is not the issue in the case of BraTS2019. It works smoothly.
image

test_2D_fully.py

Thanks for your wonderful work. When I run the test for the 2D Uncertainty_Rectified_Pyramid_Consistency according to your advice. I met the problem 'Traceback (most recent call last):
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 121, in
metric = Inference(FLAGS)
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 110, in Inference
case, net, test_save_path, FLAGS)
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 64, in test_single_volume
out_main, dim=1), dim=1).squeeze(0)
TypeError: softmax() received an invalid combination of arguments - got (tuple, dim=int), but expected one of:

  • (Tensor input, name dim, *, torch.dtype dtype)
  • (Tensor input, int dim, torch.dtype dtype)'. I do not know how to deal with it. Could you please tell me how to solve it? Thanks in advance
    1
    2
    .

test_urpc.py

Hi,
Is there provide a 2D "test_urpc.py".
I try to use your work:"train_uncertainty_rectified_pyramid_consistency_2D.py", but I don't know how to test it.
Thanks!

about training detail

Hello, when I changed batchsz=4, labelde_batchsz=2, the val set accuracy improved a lot, I don't know the reason

RuntimeError: stack expects each tensor to be equal size, but got [1, 191, 512, 512] at entry 0 and [1, 181, 512, 512] at entry 1

Hi, Xiangde
Recently, I want to use 'train_uncertainty_rectified_pyramid_consistency_3D.py' for the segmentation on my own data (heart CT). I have converted my own data to '.h5', as you did. I found maybe it's not suitable for me to do the RandomCrop, therefore, I abandon the RandomCrop. Then the code showed the mistake 'RuntimeError: stack expects each tensor to be equal size, but got [1, 191, 512, 512] at entry 0 and [1, 181, 512, 512] at entry 1'.
I searched the Internet for answers, and I found others Resize the data in the preprocessing. However, for the heart CT, the dimension of data for person A is 191512512, and for person B maybe is 181512512, and for C is 200512512. I do not know how to resize or solve the problem. Could you give me some advice? Thanks so much.
1

KeyError

image
image
image
I have tried three of the training scripts. I am pretty sure that I have downloaded all the required data and packages. Why does this constantly happen?

No module named 'val_unet_2D_dv'

Hi, I found some problem in 2ed step as following:
Traceback (most recent call last): File "train_unet_2D_dv_fully_supervised.py", line 23, in <module> from val_unet_2D_dv import test_single_volume ModuleNotFoundError: No module named 'val_unet_2D_dv'
I cant find the module "val_unet_2D_dv" in your repository or pypi, How can I get it?

Missing file

Hi,

Thanks for your great work!

On line 7 of file "efficient_encoder.py":from efficientnet_pytorch import EfficientNet, it seems that there miss the file “efficientnet_pytorch.py”. Could you provide it ?

Best wish!

resampling of pancreas data

Thank you a lot for releasing the code. Could you please also specify how to resample pancreas images to a resolution of 1.01.01.0mm?
image

As we can see from the meta-info, the SliceThickness is missing from Pancreas dataset. In that case, how do you sample over Z-axis?
By the way, Is it possible to release the data preprocessing of Pancreas-CT dataset too?

A bug about the UpBlock of the UNet

The class UpBlock is defined as:

class UpBlock(nn.Module):
    """Upssampling followed by ConvBlock"""

    def __init__(self, in_channels1, in_channels2, out_channels, dropout_p,
                 bilinear=True):

, where the default value of bilinear is "True".
However, the real value of bilinear is not fed into the UpBlock class, as follows:

self.up1 = UpBlock(
    self.ft_chns[4], self.ft_chns[3], self.ft_chns[3], dropout_p=0.0)

Therefore, the 'nn.Upsample' is always selected in the UpBlock.
You can check whether the bug exists or not.

KeyError

Dear Luoxd1996:

When I try to run your code train_2D_fully_supervised.py, it said KeyError, and here is the error information, could you help solve it?

Traceback (most recent call last):
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_fully_supervised.py", line 218, in
train(args, snapshot_path)
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_fully_supervised.py", line 73, in train
labeled_slice = patients_to_slices(args.root_path, args.labeled_num)
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_fully_supervised.py", line 64, in patients_to_slices
return ref_dict[str(patiens_num)]
KeyError: '50'

It is fine with train_2D_adversarial_network.py and train_unet_2D_entropy_minimization.py. As for others, it got the similar wrong information, such as

Traceback (most recent call last):
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_interpolation_consistency_training.py", line 301, in
train(args, snapshot_path)
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_interpolation_consistency_training.py", line 121, in train
labeled_slice = patients_to_slices(args.root_path, args.labeled_num)
File "D:/github/Medical/SSL4MIS-master/SSL4MIS-master/code/train_unet_2D_interpolation_consistency_training.py", line 79, in patients_to_slices
return ref_dict[str(patiens_num)]
KeyError: '300'

Could you help me?

问题

为什么我运行trainxx2D.py 很多都会出来这个错误呢,我我确信每个文件没有错误,但是运行就会出错ModuleNotFoundError: No module named 'vision_transformer'

The first supplied array does not contain any binary object

Hi, thank you so much for your efforts in implementing all these methods.

After training on ACDC with labeled_num=3, the testing code on ACDC gives me this error "The first supplied array does not contain any binary object", which is raised near:
image

The problem is that the trained model does not predict labeled 2 and label 3, which can be seen here:
image

The visualized dice on validation set shows that there is a performance peak at 600th step
image

The test performance on the validation set (at 600th step) looks normal
image

It's confusing that on a test set image the same model does not prediction label 2 and 3 at all. Have you met this issue and could you give me some advice?

Many thanks.

your results

Thank you so much for releasing the code and dataset. Is it possible to show the performance comparison of these methods in your environment? or at least the best performance of your proposal on acdc and Brats?

Comparison of 2d and 3d data

Hi,
Have you compared the result of 2D and 3D image for the same dataset, like ACDC dataset or BraTS?
Thank you in advance.
Best wish.

The difference between the code and the official implementation of mean teacher

Hi Xiangde,

I checked the official implementation of mean teacher and found that consistency loss is calculated on the samples in the entire batch, not just unlabeled samples.

cons_logit is assigned from logit1 or logit2 according to different settings of args.logit_distance_cost, and they are calculated through different fully connected layers to loosen the link between the classification prediction and the consistency cost.

I was wondering if my understanding of the code is biased, or if there is a bug in the implementation.

Sincerely,
tea

RGB Input

Hello,
Suppose I have datasets with RGB channels, should I use the 3d models? I simply changed in_chns to 3 and feed data with shape (bs, 3, 256, 256) but it would give errors, for both unet_3d and attention unet:
RuntimeError: Given groups=1, weight of size [16, 3, 3, 3, 3], expected input[32, 1, 9, 256, 256] to have 3 channels, but got 1 channels instead

This error came from conv1 = self.conv1(inputs)
Is there anything that I missed? It would be greatly appreciated if you could provide training/testing scripts for RGB images since they are more usual.
Thank you very much.

question about train uncertainty rectified pyramid consistency

Thanks for the excellent job!

I have some problems with the train-uncertainty-rectified-pyramid consistency experiment, and the experimental results are poor when I transform the code to my datasets. It is very insteresting to realize semi-supervised segmentation using a single model, but one single model cannot correct the training errors for the unlabeled data. I have upload some intermediate predictions for the unlabeled training data from epoch 60 and epoch 75. It is observed that p0 is not good and it tends to learning the serrated edges because of the low resolution of the outputs_aux1, outputs_aux2 and outputs_aux3.

It would be very grateful if you could clear up my confusion.
imgs.zip

Input of 3D semi-supervised medical image segmentation

Hello, I have seen many semi-supervised segmentation models of 3D medical images recently, and found that almost all the data sets used are 2018LA and the input format is H5 file. I would like to know whether the input is niI format, or whether the current 3D semi-supervised medical image segmentation can only use H5 input。thanks

SimpleITK or nibabel

Hello, I find that when I use nibabel to read a picture as numpy, numpy will rotate 90 degrees, but when I finally save numpy as nibabel, the picture direction is correct again, is this ok? What is the reason for this? SimpleITK is pronounced numpy and I find the orientation is normal
Thank you very much

models

I installed all the moudels, but the model still has the problem that models are not defined. I have tried many methods. When I input from torchvision import models, the problem is solved, but this problem occurs again? How to solve it?
image
image
image

Baidu link not working

Hello, thanks for your nice repository, however, I tried to download the two datasets from Baidu repository but the links are not working. Can you please look into this?

Missing file

Hi,

Thanks for your great work! I met some questions.

On line 24 of file "train_uncertainty_rectified_pyramid_consistency_3D.py":from dataloaders.GTV import..., it seems that there miss the file “GTV.py”. Could you provide it ?

Best wish!

question about adversarial_network_2D.py

Thank you for the work!

These is a quesiton I would like to ask about, I am trying to run the train_adversarial_network_2D.
I am confused about the input of DAN, which shown in the following line,
DAN_outputs = DAN(outputs_soft[args.labeled_bs:], volume_batch[args.labeled_bs:])

DAN_outputs = DAN(
outputs_soft[args.labeled_bs:], volume_batch[args.labeled_bs:])

In your code, you took the output of model(softmax prediction) and unlabeled data as input for FCDiscriminator, but would you pls tell me why?

Thank you.

BRaTS2019 settings

Hi,

Thanks for your fantastic work. One question is why we preprocess the BRaST2019 into a binary problem. According to your paper (https://arxiv.org/pdf/2105.09511v3.pdf), the dataset has four classes (including b.g.). Did anyone do it before? Please share the reference.

Cheers,

model performance

Hi,I have a confusion hope can be helped,
In semi-supervised segmentation, why the performance improvement always becomes smaller as the amount of labeled data increases?
~YDFZQ7)L~JM2M_K T~VC
Thanks!

error for two classes segmentation

My dataset just have two classes to segmentation.When I train the dataset using your code,I got abnormal result.Could you update the code for two classes segmentation? Thanks in advanced.

Miss test file

Hi,
Thank you very much for sharing your work, but I do not find the test file for ' Cross Teaching between CNN and Transformer'. Is it convenient for you to upload the test file? Thanks again.
good luck

data preprocessing

Hello, I preprocessed ACDC using acdc_data_processing.py and then checked my h5 file with yours by using np.allclose. It seems after patient 90 my data is different from yours some even does not match in shape for example patient 91.
May I know how exactly you processed the test set?

Guidance regarding semi-supervised learning

Thanks for your code.
I tested your code and learned a lot from it. Now I am trying to use it for other datasets for medical imaging and while implementation to one problem I am getting really bad results using the URPC method. I am new to semi-supervised learning so didn't have proper knowledge of how to train for new datasets and which hyperparameters we can tune like consistency ramp up or other training techniques. Can you suggest how to tune for others datasets?
Secondly, if I include more unlabeled data, can it help to gain better performance than the fully supervised method? Like If I train with 100 labeled images and similar results can be obtained using 20-80 label-unlabeled settings. And If I include 50 more unlabeled data from another source can I get better performance than 100 labeled image results?

about ACDC

代码中的ACDC数据集是什么类型MRI数据集,没有查到,求大佬告知

why .h5?

hello, why is the data in .h5 format?How do I visualize it?

Support of code for the URPC method

Hello
How are you?
Thanks for contributing to this project.
I can NOT find the code for the paper "Efficient Semi-Supervised Gross Target Volume of Nasopharyngeal Carcinoma Segmentation via Uncertainty Rectified Pyramid Consistency" (https://arxiv.org/pdf/2012.07042.pdf).
But the author of this paper said that the code is avaiable in this project.

image

How should I understand this?
Thanks

About the calculation of metrics

Thanks for your wonderful work. I have learned a lot from it. I'm a little confused about the calculation of the metrics (e.g., Dice, ASD) in test_3D_utils on line 106 (metric = calculate_metric_percase(label == 1, prediction == 1)). I am wondering the order of 'label == 1' and 'prediction == 1' could be changed.

Great project, I have a question about About the cross teaching between CNN and Transformer paper....

Table 2: Mean 3D DSC and HD95 (mm) on the ACDC dataset. All results are based on
the same backbone (UNet) with a fixed seed. Mean and standard variance (in
parentheses) are presented in this table. Red numbers denote the p-value < 0.05
based on paired t-test when comparing with the others

How to get the Mean and standard variance (in parentheses) are presented in this table? And how to generate the Red numbers denote the p-value < 0.05 based on paired t-test when comparing with the others? Could your please share the code? Thank you.
@Luoxd1996 Looking forward to your reply.

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.