Comments (8)
You can get the dice score with a function like this:
def dice_coefficient(truth, prediction):
return 2 * np.sum(truth * prediction)/(np.sum(truth) + np.sum(prediction))
from 3dunetcnn.
You can get the dice score with a function like this:
def dice_coefficient(truth, prediction): return 2 * np.sum(truth * prediction)/(np.sum(truth) + np.sum(prediction))
Thank you for your kind reply. Your framework is quite useful. I have two questions:
-
According to your reply, I insert the function into the function
_batch_loss
like follows:
`def _batch_loss(model, images, target, criterion, regularized=False, vae=False):
output = model(images)
batch_size = images.size(0)
if regularized:
try:
output, output_vae, mu, logvar = output
loss = criterion(output, output_vae, mu, logvar, images, target)
except ValueError:
pred_y, pred_x = output
loss = criterion(pred_y, pred_x, images, target)
elif vae:
pred_x, mu, logvar = output
loss = criterion(pred_x, mu, logvar, target)
else:
loss = criterion(output, target)score
iflat = output.view(-1).float()
tflat = target.view(-1).float()
intersection = (iflat * tflat).sum()
smooth = 0
score = 2. * intersection + smooth)/(iflat.sum() + tflat.sum() + smooth)
return loss, batch_size, scoreI want to check whether the score is
Mead dice` in Table 1, in your paper Trialing U-Net Training Modifications
for Segmenting Gliomas Using Open Source Deep Learning Framework?
-
Can you provide some experimental results of IoU?
-
Can this framework be used for general segmentation datasets, such as ShapeNet? If yes, how to modify the framework?
I appreciate your help!
from 3dunetcnn.
- Yes, the dice score should be consistent with the reported dice scores. However, those dice scores were computed on the validation set by the BRATS challenge organizers. I do not have access to their validation dataset.
- I have not calculated any IoU scores for my experiments.
- The way my framework operates is that it requires a "Sequence" or "Loader" that reads the input and target data from file and then passes it to the model for 3D data. The sequences that I have made read in NIFTI files which are designed for medical imaging. I'm not familiar with ShapeNet, but to get it to work you would need to either convert the data set to NIFTI format or create a custom sequence to load the data.
from 3dunetcnn.
Thank you! I have another question: Why is the number of channels different between images and target? To verify this, I print the shapes in epoch_training function:
for i, (images, target) in enumerate(train_loader): print("images.shape: ", images.shape) print("target.shape: ", target.shape)
output:
images.shape: [1, **4**, 112, 112, 112] target.shape: [1, **3**, 112, 112, 112]
As the output is shown, the image has 4 channels, but the target has 3 channels. I thought that both image and target have 3 channels meaning RGB. Could you explain why the image has an extra channel?
Thanks for your kindness.
@ellisdg
from 3dunetcnn.
I assume you are referring to the BRATS dataset and model.
The input channels refer to separate MR acquisition parameters. They are T1 weighted (T1w), T1w with contrast enhancing agent, FLAIR, and T2 weighted.
The output channels refer to separate labeled regions: whole tumor, enhancing tumor, and necrotic core.
from 3dunetcnn.
Thank you! Do output channel [0], output channel [1], and output channel [2] represent WT, TC, and ET, respectively? Because I get the score of dice decreasing from channel [0] to channel [2].
I assume you are referring to the BRATS dataset and model. The input channels refer to separate MR acquisition parameters. They are T1 weighted (T1w), T1w with contrast enhancing agent, FLAIR, and T2 weighted. The output channels refer to separate labeled regions: whole tumor, enhancing tumor, and necrotic core.
from 3dunetcnn.
Do output channel [0], output channel [1], and output channel [2] represent WT, TC, and ET, respectively?
Yes, that is correct.
from 3dunetcnn.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are still wanting followup to this issue, please ping the thread by leaving a comment. You may also contact [email protected] with questions.
from 3dunetcnn.
Related Issues (20)
- TypeError: __init__() missing 1 required positional argument: 'dtype' HOT 1
- hi i want to use your pretrained model but i get 0.3 for dice how i can get your result ? HOT 1
- Dice score of MMWHS dataset HOT 1
- the shape fo image and labels? HOT 2
- Valued Error on BraTS20 Training HOT 6
- scripts problems HOT 9
- problems in cross validation training HOT 8
- About Evaluation metrics for BraTS example HOT 3
- KeyError: 'config' during evaluation on brats example HOT 4
- I didn't make any changes. I couldn't find the file when I ran the sample file. HOT 2
- An error occurred during the evaluation HOT 2
- Issue with predict.py and resampling scans back into the original space. HOT 2
- The train.py seems no args of "model_filename" and "training_log_filename" HOT 2
- 請問已經訓練出模型出來,該如何去測試模型分割是否理想? HOT 6
- How to use it to train in my own dataset HOT 2
- I'm really sorry for bothering you. HOT 3
- I'm really sorry for bothering you HOT 2
- Unable to clone HOT 2
- Runtime errror HOT 5
- Runtime error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3dunetcnn.