ahmedbesbes / mrnet Goto Github PK
View Code? Open in Web Editor NEWBuilding an ACL tear detector to spot knee injuries from MRIs with PyTorch (MRNet)
Home Page: https://ahmedbesbes.com
License: MIT License
Building an ACL tear detector to spot knee injuries from MRIs with PyTorch (MRNet)
Home Page: https://ahmedbesbes.com
License: MIT License
Dear Besbes,
Firstly, I thank for your sharing code. It is very nice. I test with sagittal dataset with anterior cruciate ligament tear. However, I could not reproduce your results like train & valid AUC scores. So could you explain to clarify the issue? Or maybe I acquire a mistake somewhere?
Best regard. Linh
Hello, thanks for your implementation. However, I found that the "probs" for binary classification doesn't sum up to be 1.0.
prediction = model.forward(image.float())
loss = torch.nn.BCEWithLogitsLoss(weight=weight)(prediction, label)
loss.backward()
optimizer.step()
loss_value = loss.item()
losses.append(loss_value)
probas = torch.sigmoid(prediction)
y_trues.append(int(label[0][1]))
y_preds.append(probas[0][1].item())
The issue mentioned is located in "https://github.com/ahmedbesbes/mrnet/blob/master/train.py"
IndexError Traceback (most recent call last)
in
1 import shutil
----> 2 create_patiens_cam(acl[0],plane)
in create_patiens_cam(case, plane)
19 logit = mrnet(mri)
20 size_upsample = (256, 256)
---> 21 feature_conv = feature_blobs[0]
22 # print(features_blobs[0])
23
and then I did this:
mrnet = torch.load(f'../models/{model_name}')
mrnet = mrnet.to(device)
mrnet.eval()
features_blobs = []
def hook_feature(module, input, output):
features_blobs.append(output.data.cpu().numpy())
mrnet._modules.get('pooling_layer').register_forward_hook(hook_feature);
...
global features_blobs
mri = mri.to(device)
logit = mrnet(mri)
size_upsample = (256, 256)
feature_conv = features_blobs[0]
h_x = F.softmax(logit, dim=1).data.squeeze(0)
probs, idx = h_x.sort(0, True)
probs = probs.cpu().numpy()
idx = idx.cpu().numpy()
slice_cams = returnCAM(features_blobs[-1], weight_softmax, idx[:1])
...
import shutil
create_patiens_cam(acl[0],plane)
Could you tell me what went wrong? thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.