  Electronic shot counters allow armourers to perform preventive and predictive
maintenance based on quantitative measurements, improving reliability, reducing
the frequency of accidents, and reducing maintenance costs. To answer a market
pressure for both low lead time to market and increased customisation, we aim
to solve the shot detection and shot counting problem in a generic way through
machine learning.
  In this study, we describe a method allowing one to construct a dataset with
minimal labelling effort by only requiring the total number of shots fired in a
time series. To our knowledge, this is the first study to propose a technique,
based on learning from label proportions, that is able to exploit these weak
labels to derive an instance-level classifier able to solve the counting
problem and the more general discrimination problem. We also show that this
technique can be deployed in heavily constrained microcontrollers while still
providing hard real-time (<100ms) inference. We evaluate our technique against
a state-of-the-art unsupervised algorithm and show a sizeable improvement,
suggesting that the information from the weak labels is successfully leveraged.
Finally, we evaluate our technique against human-generated state-of-the-art
algorithms and show that it provides comparable performance and significantly
outperforms them in some offline and real-world benchmarks.
