Variational autoencoder-based anomaly detection in time series data for inventory record inaccuracy

Creative Commons License

Argun H., ALPTEKİN S. E.

Turkish Journal of Electrical Engineering and Computer Sciences, vol.31, no.1, pp.163-179, 2023 (SCI-Expanded) identifier identifier

  • Publication Type: Article / Article
  • Volume: 31 Issue: 1
  • Publication Date: 2023
  • Doi Number: 10.55730/1300-0632.3977
  • Journal Name: Turkish Journal of Electrical Engineering and Computer Sciences
  • Journal Indexes: Science Citation Index Expanded (SCI-EXPANDED), Scopus, Academic Search Premier, Applied Science & Technology Source, Compendex, Computer & Applied Sciences, INSPEC, TR DİZİN (ULAKBİM)
  • Page Numbers: pp.163-179
  • Keywords: anomaly detection, Inventory record inaccuracy, time series data, variational autoencoder
  • Galatasaray University Affiliated: Yes


Retail companies monitor inventory stock levels regularly and manage them based on forecasted sales to sustain their market position. Inventory accuracy, defined as the difference between the warehouse stock records and the actual inventory, is critical for preventing stockouts and shortages. The root causes of inventory inaccuracy are the employee or customer theft, product damage or spoilage, and wrong shipments. In this paper, we aim at detecting inaccurate stocks of one of Turkey's largest supermarket chain using the variational autoencoder (VAE), which is an unsupervised learning method. Based on the findings, we showed that VAE is able to model the underlying probability distribution of data, regenerate the pattern from time series data, and detect anomalies. Hence, it reduces time and effort to manually label the inaccuracy in data. Since the distribution of inventory data depends on selected product/product categories, we had to use a parametric approach to handle potential differences. For individual products, we built univariate time series, whereas for product categories we built multivariate time series. The experimental results show that the proposed approaches can detect anomalies both in the low and high inventory quantities.