Are ANTsRNet functions available for **training** and **testing** UNet models?
Hi Nick et al,
I'm quite new to ANTsRNet. I see that the ANTsRNet package offers several different script examples for creating UNet models (such as createUnetModel3D(), etc). I also see that ANTsRNet also provides UNet ulitities for encoding and decoding the labels.
But are there ANTsRNet functions (or example ANTsRNet scripts) available for training and for testing 3D ANTsRNet models?
Thanks, Jay
P.S. (1) Background: I wish to write an ANTsRNet script for segmenting non-brain structures. So I don't have the option of using the pre-trained weights of models trained on brain structures. I tried to look at the UNet training examples in Nick's GitHub (https://github.com/ntustison/ANTsRNetExamples/tree/master/Examples/UnetExample), but it says the examples are deprecated. I tried to press ahead anyway, but have been stumped by errors.
(2) I see that the aforementioned UNet scripts in Nick's GitHub use evaluate() and predict() for testing purposes. Is this still the correct way for testing trained UNet models?
The scripts that we use to train are typically application-specific such that they don't really fit in ANTsRNet as a generic utility package. However, we have no problem providing sample training scripts that we've used in the past. For example, you might find this repository useful as it contains all the work I wrote for this paper describing work on a non-brain application. In fact, it contains the training scripts in both R and Python.
Thank you very much, Nick. I'll check it out.
Hi Nick,
Thank you for pointing to the ElBincho training code that you pointed to in your response above. I successfully modified the ANTsRNet code to work with my image dataset.
However, there was no testing code in the ElBincho directory. So I've been trying for a few weeks, without success, to write the testing code myself in ANtsRNet. (I've successfuly hacked Python code to do my segmentation task, but unfortunately it's ordinary python, and not ANTsPy/ANtsPyNet.) I really want to write ANTsX code, preferably ANTsRNet, to do the same.
The ANTsRNet testing code I've tried to write is largely hacked from the ANTsRNet code in your github.
It runs ok until the predict call, but then it's killed, please see the error log attached herewith. My biggest problem has been that a lot of the key testing calls, such as predict(), evaluate(), etc are so generic that it's been hard for me to figure out exactly how the input arguments should be formatted.
Adding to this problem is that I don't have any ANTsRNet testing script that works. If I had one, I think I'd be able to tinker with it and figure things out, just the way I learned a lot by tinkering with your aforementioned ElBincho training scripts. Thank you again for that code.
Any help you can provide will be very helpful to me. Thank you very much!
Jay
A couple things:
-
The testing code is what is actually put into the repo for the users to use for their data (who tend to not do much training as users of ANTsXNet). So here is the el bicho prediction code. It consists of the preprocessing that was used for network training followed by prediction.
-
Something that I wish I would've understood better when I started out is that most deep learning folk using Python directly. Although accessible through R, the deep learning libraries are more easily interfaced through Python which makes using R a bit more complicated (in my opinion). In my case, I knew R better when I first started tinkering with deep learning which is why ANTsRNet got written before ANTsPyNet. However, because of the complexity associated of Python vs. R, I now train exclusively in Python even though it required a bit of a learning curve initially. If you're doing you're own training, you might also find it advantageous to start with ANTsPyNet over ANTsRNet.
(1) Thank you very much for the code. This is exactly what I was looking for! I'm looking forward to not only getting my prediction script working, but also to figuring out what I was doing wrong before.
(2) Thank you for letting me know. As an ANTsX user, it's good for me to have this in mind going forward.