<p>Your questions addresses several topics for using neural network pretrained models.</p>
<p><strong>Theoretical methods</strong></p>
<ol>
<li><p>In general, you can always neutralize categories by removing the corresponding neurons in the softmax layer and compute a new softmax layer only with the relevant rows of the matrix.<br />
This method will surely work (maybe that is what you meant by <em>filtering</em>) but will not accelerate the network computation time by much, since most of the flops (multiplications and additions) will remain.</p>
</li>
<li><p>Similar to decision trees, pruning is possible but may reduce performance. I will explain what pruning means, but note that the accuracy over your categories may remain since you are not just trimming, you are predicting less categories as well.</p>
</li>
<li><p>Transfer the learning to your problem. See stanford's course in computer vision <a href="http://cs231n.github.io/transfer-learning/" rel="nofollow noreferrer">here</a>. Most of the times I've seen that works good is by keeping the convolution layers as-is, and preparing a medium-size dataset of the objects you'd like to detect.</p>
</li>
</ol>
<p>I will add more theoretical methods if you request, but the above are the most common and accurate I know.</p>
<p><strong>Practical methods</strong></p>
<ol>
<li><p>Make sure you are <em><a href="https://www.tensorflow.org/serving/" rel="nofollow noreferrer">serving</a></em> your tensorflow model, and not just using an inference python code. This could significantly accelerate performance.</p>
</li>
<li><p>You can export the parameters of the network and load them in a faster framework such as <a href="https://github.com/Microsoft/CNTK" rel="nofollow noreferrer">CNTK</a> or <a href="http://caffe.berkeleyvision.org/" rel="nofollow noreferrer">Caffe</a>. These frameworks work in C++/CSharp and can inference much faster. <em>Make sure you load the weights correctly, some frameworks use different order in tensor dimensions when saving/loading (little/big endian-like issues)</em>.</p>
</li>
<li><p>If your application perform inference on several images, you can distribute the computation via several GPUs. **This can also be done in tensorflow, see <a href="https://www.tensorflow.org/programmers_guide/using_gpu" rel="nofollow noreferrer">Using GPUs</a>.</p>
</li>
</ol>
<p><strong>Pruning a neural network</strong></p>
<p>Maybe this is the most interesting method of adapting big networks for simple tasks.  You can see a beginner's guide <a href="https://jacobgil.github.io/deeplearning/pruning-deep-learning" rel="nofollow noreferrer">here</a>.</p>
<p>Pruning means that you remove parameters from your network, specifically the whole nodes/neurons in a decision tree/neural network (resp). To do that in object detection, you can do as follows (simplest way):</p>
<ol>
<li>Randomly prune neurons from the fully connected layers.</li>
<li>Train one more epoch (or more) with low learning rate, only on objects you'd like to detect.</li>
<li>(optional) Perform the above several times for validation and choose best network.</li>
</ol>
<p>The above procedure is the most basic one, but you can find plenty of papers that suggest algorithms to do so. For example
<a href="https://arxiv.org/abs/1712.01721" rel="nofollow noreferrer">Automated Pruning for Deep Neural Network Compression</a> and <a href="http://ieeexplore.ieee.org/document/572092/" rel="nofollow noreferrer">An iterative pruning algorithm for feedforward neural networks</a>.</p>
Is it possible to remove categories in a pretrained tensorflow model?
<p>I am currently using Tensorflow Object Detection API for my human detection app.
I tried filtering in the API itself which worked but I am still not contended by it because it's slow. So I'm wondering if I could remove other categories in the model itself to also make it faster. </p>

<p>If it is not possible, can you please give me other suggestions to make the API faster since I will be using two cameras. Thanks in advance and also pardon my english :)</p>