Confused about constant loss and metrics

Mah_Neh: <h2>
<a name="context-1" class="anchor" href="#context-1"></a>Context</h2>
<p>I have been training a network using VGG16 and the simple datasets from Caltech101.</p>
<p>I added to the headless VGG16 a simple regression head, and trained the network to output a bounding box to the objects.</p>
<p>Both for “stop signs” dataset and “airplanes” it draws a very accurate bounding box.</p>
<p>The net also works well if I train for binary classification between “stop signs” and “airplanes” so I am assuming the code is correct.</p>
<h2>
<a name="problem-2" class="anchor" href="#problem-2"></a>Problem</h2>
<p>My next step was to download a barcode dataset from Roboflow, clean up the data and run it again.</p>
<p>However I get a constant accuracy for the evaluation set and error, and for the training set as well.</p>
<p>I am confused as to what would be the reason for this, supposing that the code is correct.<br>
It has been frustrating and I wonder if any person with more knowledge could give some advice.</p>

J_Johnson: <p>Barcodes, if properly aligned, could likely be best run with just one layer, or with Conv1d layers. They are only varied in the horizontal dimension. Whereas CNNs like VGGs are trained to detect 2 dimensional features.</p>
<p>Additionally, pooling layers may effectively remove important information from a barcode.</p>
<p>Lastly, if you do use Conv layers, a limited number of them would likely be ideal with barcodes.</p>

Mah_Neh: <p>when you say “just” one layer, do you mean no deep network? just a single dense layer?</p>
<p>in this case the barcodes (1 or 2 D) are embedded in images though, I am not sure if you talk about the same? I amt trying to get the bounding box around it (one per image for now.)</p>
<p>but I appreciate your input, I started the process of getting rid of the large NN and write a custom smaller one.</p>

Mah_Neh: <aside class="quote no-group" data-username="J_Johnson" data-post="2" data-topic="172496">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/j_johnson/48/55494_2.png" class="avatar"> J_Johnson:</div>
<blockquote>
<p>, pooling layers may effectively remove important information from a barco</p>
</blockquote>
</aside>
<p>maybe something like this would be better?</p>
<ol start="0">
<li>grey input</li>
<li>conv2d</li>
<li>flatten<br>
3.regression</li>
<li>output vector (x1,y1,x2,y2)</li>
</ol>

J_Johnson: <p>If you’re going to use kernels, should make sure it is at least as wide as each spacing sequence in the barcode.</p>
<p>Additionally barcodes have different symbologies which each reader must be adapted to.</p>
<p>You’ll probably get better results just feeding the model the numbers of the bar code, either tokenized, or as an image with a CNN and something which tokenizes the barcode convention being used.</p>

Mah_Neh: <p>But I am not reading it, just finding the position (coordinates in the image). I dont need the value in rhis case. I guess tokenizing is mostly if I wanted the value right?</p>

Mah_Neh: <p>VGG16 is just a CNN. To get the bounding box, feeding cnns with labelled images is normally not enough.</p>
<p>You can use Sliding window, R-CNN, or SDD-VGG etc etc</p>
<p>I ended up using Yolov7, worked great.</p>