аватар question@mail.ru · 01.01.1970 03:00

How to search for an object on the image using a full -bearing neural network

Hello, the task of finding an object using a full -bearing neural network is worthwhile using Keras, Theano, in Python. At the moment, this is the following network configuration:

   def   Create_encoding_layers  ():  keel =  3   filter_size =  64   parade = ""> 1    Pool_SIZE =  2    retu  [ zeropadding = (paD, paAD)),  convolution2d (Filter_size, Keel, Keel, Keel, Keel, Keel, Keel, Keel, Keel, Keel, Keel border_mode =  'valid' ),  Batchnormalization (),  Activation ( '' relu '),  Maxpooling2d (pool_size = (pool_size, pool_size)),  zeropadding2d (padding = (paAD, PAD)),  convolution2d ( 32 , keel, keel, keel, keel, keel border_mode =  'valid' ),  Batchnormalization (),  Activation ( '' relu '),  Maxpooling2d (pool_size = (pool_size, pool_size)),  zeropadding2d (padding = (paAD, PAD)),  convolution2d ( 32 , keel, keel, keel, keel, keel border_mode =  'valid' ),  Batchnormalization (),  Activation ( '' relu '),  Maxpooling2d (pool_size = (pool_size, pool_size)),  zeropadding2d (padding = (paAD, PAD)),  convolution2d ( 64 , keel, keel, keel, keel, keel border_mode =  'valid' ),  batchnormalization (),  Activation ( '' relu '), ]   deg   Create_Decoding_layers  ():  keel =  3   filter_size =  64   paAD =  1   pool_size =  2    retu  [ zeropadding2d (Padding),  Convolution2D ( 64 , keel, keel, border_mode =  'Valid' ),  Batchnormalization (),  Upsampling2d (size = (pool_size, pool_size)),  zeropadding2d (padding = (PAD, PAD)),  Convolution2d ( 32 , keel, keel, Keel, Keel, Keel border_mode =  'valid' ),  batchnormalization (),  upsampling2d (size = (pool_size, pool_size), ),  Zeropadding2d (Padding = (PAD, PAD)),  Convolution2d ( 32 , keel, keel, border_mode =  'Valid' ),         BatchNormalization(),        UpSampling2D(size=(pool_size,pool_size)),        ZeroPadding2D(padding=(pad,pad)),        Convolution2D(filter_size, keel, keel, border_mode =  'valid' ),  batchnormalization (),  zeropadding2d ( 1 )), ]  segnet_basic = models.sequential ()  segnet_basic.add (input_shape = ( 120 ,  420 ,  1 )))  segnet_basic.encoding_layers = Create_encoding_layers ()   for  l  in  segnet_basic.encoding_layers:  segnet_basic.add (l)  segnet_basic.decoding_layers = creatcoding_layers ()   for  l  in  segnet_basic.decoding_layers:  segnet_basic.add (l)  segnet_basic.add ( 1 ,  1 ,  1 , border_mode =  '`ipan'))  segnet_basic.summary ()      segnet_basic.add ((reshape (( 420 ,  1 )))     

is a photograph and mask (the region, where it is located, where it is located, where it is located, where The object is filled with units, and the rest of the area is zeros). As I understand it, at the exit we must get the same mask. I tried different functions of losses. The output is nonsense. Actually the question: what needs to be fixed in order to get a similar mask at the exit? What function of losses and optimizer to use? In the picture, an example of the work of an already trained network. Image - the image that is fed by the network, Label is the expected result that I am multiplying to the display by 255, result - what the network issues. It also multiplied by 255 for the conclusion

аватар answer@mail.ru · 01.01.1970 03:00

Based on what is indicated in the question, we can draw conclusions:

  • your NS is likely to overcome. This follows from the fact that on Train you have good results, and none on the test. One of the possible option is the use of regulatory. In addition, try using the dropout method. This technique helps to reduce retraining by random exclusion of ties in the NS.
  • You need to do Cross-Validation (CV). This procedure is carried out to evaluate the model and selection of parameters. We are interested in an assessment. In scikit-lea there are wonderful mechanisms that allow you to do it. One of the CV options (it suits you more, since your sample is small) is that the original set is divided into 2 parts (for example): 0.3 - 0.7. The part that is more than 0.7 is a training set. The part that is smaller is valid. We conduct training on a training set. Then we check our result on the validation. We will do so many times. Take, for simplicity 10. It all depends on the dispersion of answers and the size of the set. If CV is not done, then it is impossible to judge the model in any way.
  • another probable reason for retraining is the presence of a large number of layers in the NS with a short number of examples.
  • In order to increase the number of examples, you can use the cutting of images. We take and cut each image on the unable areas that are comparable to the object of interest (it is desirable that the area be larger than the object). It is better to cut the picture so that the zones lie down in the overlook. For example, let the original picture has a size of 400x400. Cut it into Semplers 20x20. We will move the 20x20 window in step 10. Then it tus out that each window will lie down on the previous one. For each window, you can carry out a prediction that you wanted to do.
  • Another possible option is the rotation of pictures on small angles. But this type of transformation can be addicted (depending on the task).

Further advice is difficult to give, since the whole set is not visible, and the ultimate goal of the task is also incomprehensible.

.

Latest

Similar