Construction Notebook for:
U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data
Construction Notebook for:
U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data
U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data
NetModel Access
NetModel Access
This Notebook
This Notebook
NetModel["U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data","ConstructionNotebook"]
Untrained Net
Untrained Net
NetModel["U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data","UninitializedEvaluationNet"]
Trained Net
Trained Net
NetModel["U-Net Trained on Glioblastoma-Astrocytoma U373 Cells on a Polyacrylamide Substrate Data"]
Notes
Notes
The network exhibits input constraints. For a network with L levels, the image dimensions w (or h) and padding p are required to be the following:
and for any integer .
w(n-8)+4
L
2
p3-8
2+L
2
n≥Ceiling[8-3]
-L
2
Net Construction
Net Construction
Internal Functions
Internal Functions
uNetContract
uNetContract
In[]:=
Clear[uNetContract];uNetContract[chn1_Integer?Positive,crop_Integer?Positive,dropout_Real:1.0,opts:OptionsPattern[NetGraph]]:=uNetContract[chn1,chn1,crop,dropout,opts];uNetContract[chn1_Integer?Positive,chn2_Integer?Positive,crop_Integer?Positive,dropout_Real:0.5,opts:OptionsPattern[NetGraph]]:=NetGraph[<|"conv_1"ConvolutionLayer[chn1,{3,3}],"relu_1"ElementwiseLayer[Ramp],"conv_2"ConvolutionLayer[chn2,{3,3}],"relu_2"ElementwiseLayer[Ramp],"drop"DropoutLayer[dropout],"pooling"PoolingLayer[{2,2},{2,2}],"cropping"PartLayer[{All,crop;;-crop,crop;;-crop}]|>,{NetPort["Input"]"conv_1""relu_1""conv_2""relu_2""drop","drop""cropping"NetPort["Output"],"drop""pooling"NetPort["Downsample"]},opts]/;0<dropout<1uNetContract[chn1_Integer?Positive,chn2_Integer?Positive,crop_Integer?Positive,1|1.0,opts:OptionsPattern[NetGraph]]:=NetGraph[<|"conv_1"ConvolutionLayer[chn1,{3,3}],"relu_1"ElementwiseLayer[Ramp],"conv_2"ConvolutionLayer[chn2,{3,3}],"relu_2"ElementwiseLayer[Ramp],"pooling"PoolingLayer[{2,2},{2,2}],"cropping"PartLayer[{All,crop;;-crop,crop;;-crop}]|>,{NetPort["Input"]"conv_1""relu_1""conv_2""relu_2","relu_2""cropping"NetPort["Output"],"relu_2""pooling"NetPort["Downsample"]},opts]
uNetExpand
uNetExpand
In[]:=
Clear[uNetExpand];uNetExpand[chn1_Integer?Positive,opts:OptionsPattern[NetGraph]]:=uNetExpand[chn1,chn1,chn1,opts];uNetExpand[chn1_Integer?Positive,chn2_Integer?Positive,opts:OptionsPattern[NetGraph]]:=uNetExpand[chn1,chn2,chn2,opts];uNetExpand[chn1_Integer?Positive,chn2_Integer?Positive,chn3_Integer?Positive,opts:OptionsPattern[NetGraph]]:=NetGraph[<|"deconv"DeconvolutionLayer[chn1,{2,2},"Stride"{2,2}],"ramp"ElementwiseLayer[Ramp],"join"CatenateLayer[],"conv_1"ConvolutionLayer[chn2,{3,3}],"ramp_1"ElementwiseLayer[Ramp],"conv_2"ConvolutionLayer[chn3,{3,3}],"ramp_2"ElementwiseLayer[Ramp]|>,{NetPort["Upsample"]"deconv""ramp",{"ramp",NetPort["Input"]}"join""conv_1""ramp_1""conv_2""ramp_2"NetPort["Output"]},opts]
uNetBase
uNetBase
In[]:=
Clear[uNetBase];uNetBase[chn_Integer?Positive,dropout_Real:1.0,opts:OptionsPattern[NetChain]]:=If[dropout≥1,NetGraph[<|"conv_1"ConvolutionLayer[chn,{3,3}],"ramp_1"ElementwiseLayer[Ramp],"conv_2"ConvolutionLayer[chn,{3,3}],"ramp_2"ElementwiseLayer[Ramp]|>,{"conv_1""ramp_1""conv_2""ramp_2"},opts],NetGraph[<|"conv_1"ConvolutionLayer[chn,{3,3}],"ramp_1"ElementwiseLayer[Ramp],"conv_2"ConvolutionLayer[chn,{3,3}],"ramp_2"ElementwiseLayer[Ramp],"drop"DropoutLayer[dropout]|>,{"conv_1""ramp_1""conv_2""ramp_2""drop"},opts]]
Final Net
Final Net
Training
Training
(Performed separately)