I am assuming you have a labelled dataset, and that your dataset is LMDB. You can easily create LMDB's using the included convert_imageset tool.
In the net definition .prototxt, there are many blocks like
layer {
name: ""
... etc ...
num_output: 1000
}
go to the last fully connected layer one, like you said, and change its name to something else. e.g. `name: "fc_food"`. Also change the `num_output` to the number of classes in your dataset.
I assume you have a solver.prototxt, and know about choosing a solver, learning rate policy, batch sizes, etc. I also assume you have downloaded the pre-trained .caffemodel file. In solver.prototxt you set `snapshot_prefix` to the path you want your model's trained weights to go.
The command to fine-tune using pretrained weights is:
/path/to/caffe/build/tools/caffe train \
--solver ./edited_solver.prototxt \
--weights ./pretrained_weights.caffemodel
That's it in a nut shell. A next step is to use the python interface to obtain great control over your training process, and to save features.