Skip to content

Some of the generated images are normal and some contain noise spots #12

@fxsly

Description

@fxsly

Hello, when I trained the model with my own dataset(MRI slices) about 1000 npy files, I encountered the problem above. According to your updated code, I transformed my npy files to PIL images , the detailed code is as follows:

`def npy_to_pil(file):

np_array=np.load(file)

np_img=normalize_data(np_array)#0-255

np_img=np_img.round().astype('uint8')

pil_images=Image.fromarray(np_img.squeeze(0),mode='L')

return pil_images

def normalize_data(data):

min=data.min()

max=data.max()

data=(data-min)/(max-min)*255.0

return  data`

And my settings are as follows:
CUDA_VISIBLE_DEVICES={DEVICES} python3 main.py
--mode train
--model_type DDPM
--img_size 256
--num_img_channels 1
--dataset {DATASET_NAME}
--train_batch_size 8
--eval_batch_size 8
--eval_sample_size 1000
--segmentation_guided
Here are my results and mask used:
图片1
图片2

I have some guesses:
First is the number of my dataset. Is it possible that the number of my dataset is too small?
Second is the type of my dataset. My dataset is MRI, is MRI training difficultly? Because MRI is little more comlex compared to CT. Should I train my dataset with more epochs?
Third is the range of the data. When I trained my dataset with the code at first for 400 epochs, the range of my data is [-1,1 ], the trained result is as follows:
微信图片_20240730172008
It looks worse than the PIL image. So does the range of data have bad influence on the result at the same epochs? If I use [-1,1] data range, I trained the model with more epochs, will the influence vanish and generate images with no noises?
Hope to get your response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions