I’m looking to build a MNIST type database with my own images in order to train a One-Class CNN. I have the images processed in Julia (Gray, 28x28), I know the label of each one, but I don’t know how to build the database.
Any idea, please?
Hello and welcome!
Do you want to follow the exact MNIST format? I worked with Knet framework, so I will base my example on that
I suggest the intro in the example here:
dtst are special Knet Types containing the multidimensional array of images: 28 x 28 x 1 x nimages and the vector of labels: usually integers. (and some other stuff like batch size etc…)
xtrn = fill(Float32(0),w,h,nr_channels,nr_images) # here you push images
ytrn = fill(UInt8(0),nr_files)# here you push labels
after this you can simply call:
dtrn = Knet.minibatch(xtrn, ytrn, batchsize; shuffle=true, xtype=xtype, o...)
Do that also for test dataset and your’re good to go.
I think I can come with a more complete example for you a little later if you need more info.
Thank you for support. As you may know, Ambrosia weed is a very undesired plant, who cause trouble to a lot of people. I’m involved in a project of detecting that plant from aerial images taken by drone flying at medium to high altitude. I have prepared the training set and, based on your suggestion, I’ll migrate it into a database form, ready to be processed in Julia ML.