Git Product home page Git Product logo

Comments (3)

mzaradzki avatar mzaradzki commented on August 11, 2024

hi @CreatCodeBuild

The main reason I wrote the function into separated steps is mostly that I wanted to compare the relative performance (as in the jupyter notebook, at the end) as the different model configuration.

Also, the model is not so easy to build from the original paper, I mean the architecture when you are not an expert in this is not crystal clear. so to get to my goal I actually iterated from the simplest one to the finest one.

The name "_blank" indeed indicates that it is a "utility/intermediate" function to build more accurate model.
The thing is that it is not simply a sequence : FCN32=>FCN16=>FCN8. That is why you have the 2 functions "32_blank to 16" and "32_blank to 8" in my code, rather than a sequential composition.
The main reason it is this way is because of the dimension/resolution that changes. Once you are at the end of 32 (not 32_blank) you cannot go directly to 8 or 16.
If it helps you can compare the diagrams for 16 and 8 in the blog :
https://medium.com/@m.zaradzki/image-segmentation-with-neural-net-d5094d571b1e
This will help you see the part that is common to the 2 models and that I "factorized" into 32_blank.

from neuralnets.

CreatCodeBuild avatar CreatCodeBuild commented on August 11, 2024

I spent some time to search how exactly "deconvolution" is computed. The so-called "deconvolution" is not an actual mathematical deconvolution. It is actually a transposed convolution operation, which is just normal convolution computation with some tricks. That I finally understand how strides(subsampling), kernel size affects the final result's size.

I found this paper useful for me: http://www.matthewzeiler.com/pubs/cvpr2010/cvpr2010.pdf
Indeed as you said, the FCN for semantic segmentation paper is not that clear for beginners.

More surprisingly, the "convolutional layer" actually does correlation instead of convolution if we use the computer vision terms.

After carefully studying your code and your medium post, I understood why are you writing your code this way. It makes a lot of sense.

Since I am using Keras 2, I will need to change the code a little bit. (Keras just loves to break API)

I wonder what you mean by "I actually iterated from the simplest one to the finest one". If you are to load weights from the matlab toolkit, don't you have to define the network exactly the same as matlab toolkit does?

from neuralnets.

mzaradzki avatar mzaradzki commented on August 11, 2024

Keras 2 : indeed I wrote most of my Keras scripts using Keras 1 and migrating my code has proven more time consuming that I would have liked to the FCN is still Keras 1. If you have time to explain me when you are done with Keras 2 what needs to be modified that would be great. If you dont time I fully understand of course.

About your question :

If you are to load weights from the matlab toolkit, don't you have to define the network exactly the same as matlab toolkit does?

The Matlab files for weights are available for both 16s and 8s versions, so I first coded 16s using these weights and then I implemented 8s with the other weight file.
Actually I found that the .mat files from vlfeat (http://www.vlfeat.org/matconvnet/pretrained/) are also useful to help clarifying the model structure as you can read the shapes of all the weights to figure out the shape of your layers !

One last thing, that may help you a lot with Keras 2, Andrew Hundt posted this link in another chat yesterday :
https://github.com/farizrahman4u/keras-contrib/blob/master/keras_contrib/applications/densenet.py#L175

from neuralnets.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.