Hi. I trained unet. This is an example of an input image with its mask images, their sizes are 3840*2160*3
and 3840*2160*1
And this is my spec file:
random_seed: 42
model_config {
model_input_width: 960
model_input_height: 960
model_input_channels: 3
num_layers: 18
all_projections: true
arch: "resnet"
use_batch_norm: False
training_precision {
backend_floatx: FLOAT32
}
}
training_config {
batch_size: 2
epochs: 100
log_summary_steps: 20
checkpoint_interval: 1
loss: "cross_dice_sum"
learning_rate:0.00001
regularizer {
type: L2
weight: 2e-5
}
optimizer {
adam {
epsilon: 9.99999993923e-09
beta1: 0.899999976158
beta2: 0.999000012875
}
}
}
dataset_config {
dataset: "custom"
augment: False
augmentation_config {
spatial_augmentation {
hflip_probability : 0.5
vflip_probability : 0.5
crop_and_resize_prob : 0.5
}
brightness_augmentation {
delta: 0.2
}
}
input_image_type: "grayscale"
train_images_path:"/workspace/fire_detection/fire/images/train"
train_masks_path:"/workspace/fire_detection/fire/masks/train"
val_images_path:"/workspace/fire_detection/fire/images/val"
val_masks_path:"/workspace/fire_detection/fire/masks/val"
test_images_path:"/workspace/fire_detection/fire/images/val_resize"
data_class_config {
target_classes {
name: "foreground"
mapping_class: "foreground"
label_id: 0
}
target_classes {
name: "background"
mapping_class: "background"
label_id: 1
}
}
}
Here my questions:
- When I set the input_image_type: “color”, the evaluate is as follows:
"{'foreground': {'precision': 1.0, 'Recall': 1.0, 'F1 Score': 1.0, 'iou': 1.0}, 'background': {'precision': nan, 'Recall': nan, 'F1 Score': nan, 'iou': nan}}"
and when I set the input_image_type: “grayscale”, the evaluate is as follows:
"{'foreground': {'precision': 0.9991926, 'Recall': 0.99150133, 'F1 Score': 0.9953321053846278, 'iou': 0.9907076}, 'background': {'precision': 0.9933318, 'Recall': 0.99936754, 'F1 Score': 0.9963404918179835, 'iou': 0.9927078}}"
I want to know what caused this result?
- when I set the “input_image_type: “grayscale””, the evaluate is as follows:
"{'foreground': {'precision': 0.9991926, 'Recall': 0.99150133, 'F1 Score': 0.9953321053846278, 'iou': 0.9907076}, 'background': {'precision': 0.9933318, 'Recall': 0.99936754, 'F1 Score': 0.9963404918179835, 'iou': 0.9927078}}"
Then when I use inference, the spec file used is as above. When my input image is 3840*2160*3
, the result is as follows, its size is 960*960*1
.
The result is very poor. I am very confused and hope to get your help.