training set is small. Then we would better download some open-source implementation of a neural network and download not just the code, but also the weights of this
network. There are a lot of networks; you can download that have been trained on, i.e.,
the ImageNet dataset, which has 1000 different classes. The network typically contains
a softmax layer used as the output layer, which contains 1000 units. You usually need
to modify the softmax layer and create your own softmax unit that outputs epithelial,
inflammatory, fibroblasts, or miscellaneous.
Since our training dataset is small, we would better freeze the first few layers of the
neural network and then just train the parameters associated with finial several layers.
For most machine vision tasks, the first few layers of the network are usually used to
extract common fundamental features of input images, such as edges, gradients, etc.
And by using the pretrained weights, we can get very good performance even with a
small data sets. Many current deep learning frameworks support using parameters to
specify training or freezing the weights associated with a particular layer. This method
is usually used to solve the problem of overfitting caused by insufficient training data.
But if you have enough data, you could use the downloaded weights just as initialization to replace random initialization. And then you can do gradient descent training,
updating all the weights in all the layers to train the whole network.
This is the transfer learning for the training of ConvNet. In practice, because many
network weights are publicly available on the internet, you can easily download these
open source weights that someone else has spent weeks working with a large computing device to initialize your network model. This will greatly improve your work
efficiency. You can refer to [16] for more details.
4 Generate Training Dataset
When your network is built, you need to provide the image it will use to train a new
detection classifier. Most deep neural network models require at least hundreds of
images to train a detection classifier. Many computer vision researchers are willing to
share their data online, i.e., ImageNet. And other researchers can also train their
algorithms on these databases
To train a robust classifier, the training images should have random objects in the
image along with the desired objects and should have a variety of backgrounds and
lighting conditions. There should be some images where the desired object is partially
obscured, overlapped with something else, or only halfway in the picture. Make sure
the images are not too large. The larger the images are, the longer it will take to train
the classifier. As my advice, the images size should be less than 200 KB each, and their
resolution should not be more than 1280 Â 720.
In practice, after you have all the pictures you need, we usually use 80% of them as
the training images and 20% of them as testing images. Make sure there are a variety of
pictures in both directories of the training and testing data.
With all the pictures gathered, it is time to label the desired objects in every picture.
LabelImg [17] is a tool for labeling images, and its GitHub page has very clear
instructions on how to install and use it. Once you have labeled each image, there will
162
X. Zhang et al.
Précédent

- 174/679

Suivant