-
Notifications
You must be signed in to change notification settings - Fork 0
/
LiPoSeg.m
470 lines (405 loc) · 23.2 KB
/
LiPoSeg.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
lgraph = layerGraph();
tempLayers = imageInputLayer([64 1024 5],"Name","input");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],64,"Name","conv1_conv","Padding","same","Stride",[1 2])
batchNormalizationLayer("Name","conv1_BN")
reluLayer("Name","conv1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],64,"Name","conv_skip_conv","Padding","same")
batchNormalizationLayer("Name","conv_skip_BN")
reluLayer("Name","conv_skip_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
maxPooling2dLayer([3 3],"Name","conv1_pool","Padding","same","Stride",[1 2])
convolution2dLayer([1 1],16,"Name","fire1_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire1_squeeze1x1_BN")
reluLayer("Name","fire1_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],64,"Name","fire1_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire1_expand3x3_BN")
reluLayer("Name","fire1_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],64,"Name","fire1_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire1_expand1x1_BN")
reluLayer("Name","fire1_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","fire1_concat")
convolution2dLayer([1 1],16,"Name","fire2_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire2_squeeze1x1_BN")
reluLayer("Name","fire2_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],64,"Name","fire2_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire2_expand3x3_BN")
reluLayer("Name","fire2_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],64,"Name","fire2_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire2_expand1x1_BN")
reluLayer("Name","fire2_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire2_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
averagePooling2dLayer([3 3],"Name","CAM1_POOL","Padding","same","Stride",[2 2])
groupedConvolution2dLayer([1 1],1,8,"Name","CAM1_conv","Padding","same")
reluLayer("Name","CAM1_RELU")
groupedConvolution2dLayer([1 1],16,8,"Name","CAM1_conv2","Padding","same")
sigmoidLayer("Name","CAM1_SIG_2")
resize2dLayer("Name","CAM1_resize","GeometricTransformMode","half-pixel","Method","nearest","NearestRoundingMode","round","Scale",[2 2])];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = multiplicationLayer(2,"Name","CAM1_REW");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
maxPooling2dLayer([3 3],"Name","SR1_pool","Padding","same","Stride",[1 2])
convolution2dLayer([1 1],32,"Name","fire3_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire3_squeeze1x1_BN")
reluLayer("Name","fire3_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],128,"Name","fire3_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire3_expand1x1_BN")
reluLayer("Name","fire3_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],128,"Name","fire3_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire3_expand3x3_BN")
reluLayer("Name","fire3_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","fire3_concat")
convolution2dLayer([1 1],32,"Name","fire4_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire4_squeeze1x1_BN")
reluLayer("Name","fire4_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],128,"Name","fire4_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire4_expand1x1_BN")
reluLayer("Name","fire4_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],128,"Name","fire4_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire4_expand3x3_BN")
reluLayer("Name","fire4_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire4_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
averagePooling2dLayer([3 3],"Name","CAM2_POOL","Padding","same","Stride",[2 2])
groupedConvolution2dLayer([1 1],2,8,"Name","CAM2_conv","Padding","same")
reluLayer("Name","CAM2_RELU")
groupedConvolution2dLayer([1 1],32,8,"Name","CAM2_conv2","Padding","same")
sigmoidLayer("Name","CAM2_SIG_2")
resize2dLayer("Name","resize-scale","GeometricTransformMode","half-pixel","Method","nearest","NearestRoundingMode","round","Scale",[2 2])];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = multiplicationLayer(2,"Name","CAM2_REW");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
maxPooling2dLayer([3 3],"Name","SR2_pool","Padding","same","Stride",[1 2])
convolution2dLayer([1 1],48,"Name","fire5_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire5_squeeze1x1_BN")
reluLayer("Name","fire5_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],192,"Name","fire5_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire5_expand3x3_BN")
reluLayer("Name","fire5_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],192,"Name","fire5_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire5_expand1x1_BN")
reluLayer("Name","fire5_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","fire5_concat")
convolution2dLayer([1 1],48,"Name","fire6_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire6_squeeze1x1_BN")
reluLayer("Name","fire6_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],192,"Name","fire6_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire6_expand1x1_BN")
reluLayer("Name","fire6_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],192,"Name","fire6_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire6_expand3x3_BN")
reluLayer("Name","fire6_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","fire6_concat")
convolution2dLayer([1 1],64,"Name","fire7_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire7_squeeze1x1_BN")
reluLayer("Name","fire7_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],256,"Name","fire7_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire7_expand3x3_BN")
reluLayer("Name","fire7_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],256,"Name","fire7_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire7_expand1x1_BN")
reluLayer("Name","fire7_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","fire7_concat")
convolution2dLayer([1 1],64,"Name","fire8_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire8_squeeze1x1_BN")
reluLayer("Name","fire8_squeeze1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],256,"Name","fire8_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire8_expand3x3_BN")
reluLayer("Name","fire8_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],256,"Name","fire8_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire8_expand1x1_BN")
reluLayer("Name","fire8_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire8_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
averagePooling2dLayer([3 3],"Name","CAM3_POOL","Padding","same","Stride",[2 2])
groupedConvolution2dLayer([1 1],4,8,"Name","CAM3_conv","Padding","same")
reluLayer("Name","CAM3_RELU")
groupedConvolution2dLayer([1 1],64,8,"Name","CAM3_conv2","Padding","same")
sigmoidLayer("Name","CAM3_SIG")
resize2dLayer("Name","CAM3_RESIZE","GeometricTransformMode","half-pixel","Method","nearest","NearestRoundingMode","round","Scale",[2 2])];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = multiplicationLayer(2,"Name","SR3_REW");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
averagePooling2dLayer([64 64],"Name","ASPP_GAP")
groupedConvolution2dLayer([1 1],16,8,"Name","ASPP_GAP_conv","Padding","same")
batchNormalizationLayer("Name","ASPP_GAP_BN")
reluLayer("Name","ASPP_GAP_relu")
resize2dLayer("Name","ASPP_GAP_resize","GeometricTransformMode","half-pixel","Method","nearest","NearestRoundingMode","round","OutputSize",[64 64])];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
groupedConvolution2dLayer([3 3],16,8,"Name","ASPP_1_conv","Padding","same")
batchNormalizationLayer("Name","ASPP_1_BN")
reluLayer("Name","ASPP_1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
groupedConvolution2dLayer([3 3],16,8,"Name","ASPP_9_conv","DilationFactor",[9 9],"Padding","same")
batchNormalizationLayer("Name","ASPP_9_BN")
reluLayer("Name","ASPP_9_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
groupedConvolution2dLayer([3 3],16,8,"Name","ASPP_6_conv","DilationFactor",[6 6],"Padding","same")
batchNormalizationLayer("Name","ASPP_6_BN")
reluLayer("Name","ASPP_6_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
groupedConvolution2dLayer([3 3],16,8,"Name","ASPP_12_conv","DilationFactor",[12 12],"Padding","same")
batchNormalizationLayer("Name","ASPP_12_BN")
reluLayer("Name","ASPP_12_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(5,"Name","ASPP_concat")
convolution2dLayer([1 1],128,"Name","ASPP_conv_conv","Padding","same")
reluLayer("Name","ASPP_conv_relu")
convolution2dLayer([1 1],32,"Name","fire_deconv_ASPP_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv_ASPP_squeeze1x1_BN")
reluLayer("Name","fire_deconv_ASPP_squeeze1x1_relu")
transposedConv2dLayer([1 4],32,"Name","fire_deconv_ASPP_deconv","Cropping","same","Stride",[1 2])
reluLayer("Name","fire_deconv_ASPP_deconv_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],128,"Name","fire_deconv_ASPP_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv_ASPP_expand1x1_BN")
reluLayer("Name","fire_deconv_ASPP_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],128,"Name","fire_deconv_ASPP_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv_ASPP_expand3x3_BN")
reluLayer("Name","fire_deconv_ASPP_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire_deconv_ASPP_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],64,"Name","fire_deconv1_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv1_squeeze1x1_BN")
reluLayer("Name","fire_deconv1_squeeze1x1_relu")
transposedConv2dLayer([1 4],64,"Name","fire_deconv1_deconv","Cropping","same","Stride",[1 2])
reluLayer("Name","fire_deconv1_deconv_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],128,"Name","fire_deconv1_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv1_expand1x1_BN")
reluLayer("Name","fire_deconv1_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],128,"Name","fire_deconv1_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv1_expand3x3_BN")
reluLayer("Name","fire_deconv1_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire_deconv1_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = additionLayer(2,"Name","fuse_fire_deconv1_concatSR2_REW");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
depthConcatenationLayer(2,"Name","concat_fuse_fire_deconv1_concatSR2_REWfire_deconv_ASPP_concat")
convolution2dLayer([1 1],64,"Name","fire_deconv2_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv2_squeeze1x1_BN")
reluLayer("Name","fire_deconv2_squeeze1x1_relu")
transposedConv2dLayer([1 4],64,"Name","fire_deconv2_deconv","Cropping","same","Stride",[1 2])
reluLayer("Name","fire_deconv2_deconv_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],64,"Name","fire_deconv2_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv2_expand3x3_BN")
reluLayer("Name","fire_deconv2_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],64,"Name","fire_deconv2_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv2_expand1x1_BN")
reluLayer("Name","fire_deconv2_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire_deconv2_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
additionLayer(2,"Name","fuse_fire_deconv2_concatSR1_REW")
convolution2dLayer([1 1],16,"Name","fire_deconv3_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv3_squeeze1x1_BN")
reluLayer("Name","fire_deconv3_squeeze1x1_relu")
transposedConv2dLayer([1 4],16,"Name","fire_deconv3_deconv","Cropping","same","Stride",[1 2])
reluLayer("Name","fire_deconv3_deconv_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],32,"Name","fire_deconv3_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv3_expand1x1_BN")
reluLayer("Name","fire_deconv3_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],32,"Name","fire_deconv3_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv3_expand3x3_BN")
reluLayer("Name","fire_deconv3_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire_deconv3_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
additionLayer(2,"Name","fuse_fire_deconv3_concatconv1_relu")
convolution2dLayer([1 1],16,"Name","fire_deconv4_squeeze1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv4_squeeze1x1_BN")
reluLayer("Name","fire_deconv4_squeeze1x1_relu")
transposedConv2dLayer([1 4],16,"Name","fire_deconv4_deconv","Cropping","same","Stride",[1 2])
reluLayer("Name","fire_deconv4_deconv_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([3 3],32,"Name","fire_deconv4_expand3x3_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv4_expand3x3_BN")
reluLayer("Name","fire_deconv4_expand3x3_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([1 1],32,"Name","fire_deconv4_expand1x1_conv","Padding","same")
batchNormalizationLayer("Name","fire_deconv4_expand1x1_BN")
reluLayer("Name","fire_deconv4_expand1x1_relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = depthConcatenationLayer(2,"Name","fire_deconv4_concat");
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
additionLayer(2,"Name","fuse_fire_deconv4_concatconv_skip_relu")
dropoutLayer(0.5,"Name","dropout")
convolution2dLayer([3 3],3,"Name","convlast_conv","Padding","same")
reluLayer("Name","convlast_relu")
softmaxLayer("Name","softmax")
pixelClassificationLayer("Name","pixellabels")];
lgraph = addLayers(lgraph,tempLayers);
% clean up helper variable
clear tempLayers;
lgraph = connectLayers(lgraph,"input","conv1_conv");
lgraph = connectLayers(lgraph,"input","conv_skip_conv");
lgraph = connectLayers(lgraph,"conv1_relu","conv1_pool");
lgraph = connectLayers(lgraph,"conv1_relu","fuse_fire_deconv3_concatconv1_relu/in2");
lgraph = connectLayers(lgraph,"fire1_squeeze1x1_relu","fire1_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire1_squeeze1x1_relu","fire1_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire1_expand1x1_relu","fire1_concat/in1");
lgraph = connectLayers(lgraph,"fire1_expand3x3_relu","fire1_concat/in2");
lgraph = connectLayers(lgraph,"conv_skip_relu","fuse_fire_deconv4_concatconv_skip_relu/in2");
lgraph = connectLayers(lgraph,"fire2_squeeze1x1_relu","fire2_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire2_squeeze1x1_relu","fire2_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire2_expand3x3_relu","fire2_concat/in2");
lgraph = connectLayers(lgraph,"fire2_expand1x1_relu","fire2_concat/in1");
lgraph = connectLayers(lgraph,"fire2_concat","CAM1_POOL");
lgraph = connectLayers(lgraph,"fire2_concat","CAM1_REW/in2");
lgraph = connectLayers(lgraph,"CAM1_resize","CAM1_REW/in1");
lgraph = connectLayers(lgraph,"CAM1_REW","SR1_pool");
lgraph = connectLayers(lgraph,"CAM1_REW","fuse_fire_deconv2_concatSR1_REW/in2");
lgraph = connectLayers(lgraph,"fire3_squeeze1x1_relu","fire3_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire3_squeeze1x1_relu","fire3_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire3_expand1x1_relu","fire3_concat/in1");
lgraph = connectLayers(lgraph,"fire3_expand3x3_relu","fire3_concat/in2");
lgraph = connectLayers(lgraph,"fire4_squeeze1x1_relu","fire4_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire4_squeeze1x1_relu","fire4_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire4_expand3x3_relu","fire4_concat/in2");
lgraph = connectLayers(lgraph,"fire4_expand1x1_relu","fire4_concat/in1");
lgraph = connectLayers(lgraph,"fire4_concat","CAM2_POOL");
lgraph = connectLayers(lgraph,"fire4_concat","CAM2_REW/in2");
lgraph = connectLayers(lgraph,"resize-scale","CAM2_REW/in1");
lgraph = connectLayers(lgraph,"CAM2_REW","SR2_pool");
lgraph = connectLayers(lgraph,"CAM2_REW","fuse_fire_deconv1_concatSR2_REW/in2");
lgraph = connectLayers(lgraph,"fire5_squeeze1x1_relu","fire5_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire5_squeeze1x1_relu","fire5_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire5_expand3x3_relu","fire5_concat/in2");
lgraph = connectLayers(lgraph,"fire5_expand1x1_relu","fire5_concat/in1");
lgraph = connectLayers(lgraph,"fire6_squeeze1x1_relu","fire6_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire6_squeeze1x1_relu","fire6_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire6_expand1x1_relu","fire6_concat/in1");
lgraph = connectLayers(lgraph,"fire6_expand3x3_relu","fire6_concat/in2");
lgraph = connectLayers(lgraph,"fire7_squeeze1x1_relu","fire7_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire7_squeeze1x1_relu","fire7_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire7_expand1x1_relu","fire7_concat/in1");
lgraph = connectLayers(lgraph,"fire7_expand3x3_relu","fire7_concat/in2");
lgraph = connectLayers(lgraph,"fire8_squeeze1x1_relu","fire8_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire8_squeeze1x1_relu","fire8_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire8_expand3x3_relu","fire8_concat/in2");
lgraph = connectLayers(lgraph,"fire8_expand1x1_relu","fire8_concat/in1");
lgraph = connectLayers(lgraph,"fire8_concat","CAM3_POOL");
lgraph = connectLayers(lgraph,"fire8_concat","SR3_REW/in2");
lgraph = connectLayers(lgraph,"CAM3_RESIZE","SR3_REW/in1");
lgraph = connectLayers(lgraph,"SR3_REW","ASPP_GAP");
lgraph = connectLayers(lgraph,"SR3_REW","ASPP_1_conv");
lgraph = connectLayers(lgraph,"SR3_REW","ASPP_9_conv");
lgraph = connectLayers(lgraph,"SR3_REW","ASPP_6_conv");
lgraph = connectLayers(lgraph,"SR3_REW","ASPP_12_conv");
lgraph = connectLayers(lgraph,"SR3_REW","fire_deconv1_squeeze1x1_conv");
lgraph = connectLayers(lgraph,"ASPP_1_relu","ASPP_concat/in4");
lgraph = connectLayers(lgraph,"ASPP_9_relu","ASPP_concat/in1");
lgraph = connectLayers(lgraph,"ASPP_6_relu","ASPP_concat/in3");
lgraph = connectLayers(lgraph,"ASPP_GAP_resize","ASPP_concat/in2");
lgraph = connectLayers(lgraph,"ASPP_12_relu","ASPP_concat/in5");
lgraph = connectLayers(lgraph,"fire_deconv_ASPP_deconv_relu","fire_deconv_ASPP_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire_deconv_ASPP_deconv_relu","fire_deconv_ASPP_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire_deconv_ASPP_expand1x1_relu","fire_deconv_ASPP_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv_ASPP_expand3x3_relu","fire_deconv_ASPP_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv_ASPP_concat","concat_fuse_fire_deconv1_concatSR2_REWfire_deconv_ASPP_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv1_deconv_relu","fire_deconv1_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire_deconv1_deconv_relu","fire_deconv1_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire_deconv1_expand1x1_relu","fire_deconv1_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv1_expand3x3_relu","fire_deconv1_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv1_concat","fuse_fire_deconv1_concatSR2_REW/in1");
lgraph = connectLayers(lgraph,"fuse_fire_deconv1_concatSR2_REW","concat_fuse_fire_deconv1_concatSR2_REWfire_deconv_ASPP_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv2_deconv_relu","fire_deconv2_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire_deconv2_deconv_relu","fire_deconv2_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire_deconv2_expand3x3_relu","fire_deconv2_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv2_expand1x1_relu","fire_deconv2_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv2_concat","fuse_fire_deconv2_concatSR1_REW/in1");
lgraph = connectLayers(lgraph,"fire_deconv3_deconv_relu","fire_deconv3_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire_deconv3_deconv_relu","fire_deconv3_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire_deconv3_expand1x1_relu","fire_deconv3_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv3_expand3x3_relu","fire_deconv3_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv3_concat","fuse_fire_deconv3_concatconv1_relu/in1");
lgraph = connectLayers(lgraph,"fire_deconv4_deconv_relu","fire_deconv4_expand3x3_conv");
lgraph = connectLayers(lgraph,"fire_deconv4_deconv_relu","fire_deconv4_expand1x1_conv");
lgraph = connectLayers(lgraph,"fire_deconv4_expand1x1_relu","fire_deconv4_concat/in1");
lgraph = connectLayers(lgraph,"fire_deconv4_expand3x3_relu","fire_deconv4_concat/in2");
lgraph = connectLayers(lgraph,"fire_deconv4_concat","fuse_fire_deconv4_concatconv_skip_relu/in1");
plot(lgraph);