Building Production-Grade spaCy Text Classification Pipelines for Business Data
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
By implementing product recognition capabilities in your store, you can unlock a large number of improvements in your store operations and customer experiences. Your annual counting and cycle counting can be completed faster. Automated shelf monitoring can alert your staff to low stocks. The omnichannel experience of your website and app customers can improve by informing them about product availability in real-time.
All this is possible in five steps. In implementing these steps, you'll see the many uses of product recognition in your retail environment and the crucial role of computer vision and deep learning in enabling it.
A visual search engine is at the heart of this entire system because you'll be needing it for every subsequent step. So, the first step is to implement a visual search engine for products using a deep learning image processing pipeline, a vector database for image recognition, and if needed, an optical character recognition and information extraction pipeline for fine-grained image recognition.
The deep learning pipeline can implement either object detection or instance segmentation to isolate a product from its surroundings in an image. Both are based on convolutional neural networks (CNN) for visual pattern recognition but each one brings some inherent benefits and drawbacks that you should evaluate based on the conditions in your retail environment.
Object detection isolates products in the scene as rectangular bounding boxes. Object detection models like YOLOv4 are deep learning models that can be easily fine-tuned for retail product detection and can run fast even on modestly powered smartphones. However, since the object detector treats the entire set of pixels within the bounding box as part of the product, there is a possibility that extraneous pixels get included and create problems down the line, such as including the text from a product in the background on a densely arranged shelf.
Instance segmentation, in contrast, isolates products just like people do by recognizing their irregular boundary contours. Instance segmentation models like U-Net can be fine-tuned on retail datasets for product segmentation. Compared to object detectors, they isolate occluded products better — which is a common problem in store shelves — and avoid downstream errors like spurious text characters since the segmented pixels are from only one product. However, since segmentation is a much more challenging task, they require more powerful hardware and devices, which pushes up your initial expenditure.
Projects like Detectron2 and MMDetection provide ready-to-use software and pre-trained models that make product detection and segmentation a breeze to fine-tune and use. Alternatively, you can use a cloud ML service like Amazon SageMaker which comes with built-in support for object detection and segmentation.
Regardless of the model used, it computes a numerical vector called an image embedding for each product. An image embedding is the result of the neural network looking for all the unique local and global image features that characterize each product and encoding them as a vector of numbers using a mathematical function. Each SKU is represented by a unique image embedding since each SKU will have a unique shape, textures, colors, text, barcode, and other features. These embeddings are essential to our visual search as we'll soon see.
A vector database enables us to query images and find matching image embeddings for object recognition. You need one so that when a product is shown to the system, it can search this database to check if the same product or a visually indistinguishable product has previously been registered with it and retrieve its product details.
There are many open-source, commercial, self-hosted, and managed vector databases. Milvus is an open-source self-hosted vector database that you can deploy in your cloud or on-prem infra. Pinecone is a commercial fully managed vector database-as-a-service.
Customers often have to read product labels before deciding on a purchase as many products resemble one another visually but differ in little details like flavors or ingredients. A product recognition system built around off-the-shelf cameras and smartphones is likely to run into the same problem at some point.
That’s why we suggest setting up a product text recognition model and information extraction pipeline too, though they're not necessary to get a basic visual search system up and running. The text labels enable more accurate search by requiring products matched through visual search to also match the text exactly.
With the visual search engine ready, you need to start populating its database with your product images.
The best time to do this is when your staff is adding new products to your inventory management system (IMS). You probably already have some workflow where your staff unboxes the pallets from the warehouse, records product details and SKUs in your IMS, prints out barcode labels, and transfers different products to your stockroom shelves.
You can add an additional step where your staff uses a custom smartphone app to capture photos of the products, perform some basic preprocessing to adjust brightness and contrast, link them to your SKUs, and upload them to your visual search engine. The same product segmentation model can be run on smartphones to help your staff crop photos. Multiple photos from different angles are recommended to make the visual search pose-invariant. Once uploaded, the search engine:
You can do this as part of many other workflows too:
Eventually, your complete inventory will get added to your vector database. Keep testing the accuracy and other metrics — precision, recall, AUC — of your visual search engine frequently to ensure that it's recognizing most products correctly. A staff member should be able to point their smartphone camera at a product kept in any orientation and receive its details accurately. If there are recognition errors due to too many products, the embedding space can be expanded by recalculating longer embeddings for all products.
Fixing cameras in your shelf areas enables many features that improve operational efficiencies:
For implementing these features, you can use off-the-shelf cameras or cameras specialized for shelf monitoring or even smartphones and tablets. The devices are set up opposite the shelves they monitor and typically have some pan-tilt-zoom capabilities.
The advantage of using smartphones or tablets is that they can run the same product recognition neural networks on-device if necessary. They can also do shelf monitoring by running deep neural network semantic or panoptic segmentation models on-device, measuring the areas of the shelves that are empty, and alerting the staff.
In addition to the devices fixed to your shelves, it’s a good idea to incorporate your product recognition system into smartphone apps to help your staff with their work. You've already seen earlier how your staff can use these apps to add products to the vector database. Other workflows such as annual counting and cycle counting can finish faster if your staff can simply point their phones at the shelves to have the items counted automatically.
Smartphones nowadays come with hardware acceleration support for neural networks. Mobile apps can use libraries like MediaPipe and TensorFlow Lite to run product detection, segmentation, text recognition, or information extraction neural networks — based on mobile-optimized backbone networks like YOLOv4-Tiny — directly on the device. The convenience of smartphones drastically improves the acceptance and use of the product recognition system by your staff in a way that using computers or uploading images manually just can't.
Improvements in your business operations are good reasons to adopt such a system but they pale in front of increased revenues from happy customers. A product recognition system can actually improve the omnichannel user experience of your customers.
Real-time availability of products lets your website and app customers check if the product they want is actually available on your shelf so that they can quickly visit your store to get it. In areas where shopping and parking can be a hassle, this kind of assured availability makes for happy customers.
Another feature you can provide is a visual search for products. Your omnichannel customer may spot an interesting-looking product on their way to work or while traveling. All they have to do is snap a photo and upload it to your website or app to check if your store stocks the same product. Your website or app sends the photo to your visual search engine to check if a visually similar product is available in your vector database. If it is, they can confirm availability to your customer. And if it's not, then it's a signal to your assortment plan that you may be missing a product that's in demand.
Rapid advances in deep learning, machine learning, and artificial intelligence have enabled innovative applications like product recognition and inventory management to optimize backend processes and improve customer experience. The breakneck speed of improvement is such that techniques and even algorithms from just two or three years ago are already obsolete, outperformed by newer techniques. In such an ever-changing environment, it's understandable if you aren't aware of what is possible. That's why we're here — to show you the possibilities and unlock the benefits they can bring to your retail business. Contact us!
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
We compare 12 AI text summarization models through a series of tests to see how BART text summarization holds up against GPT-3, PEGASUS, and more.
Let’s take a look at what intent classification is in conversational ai and how you can build a GPT-3 intent classification model for conversational ai and chatbot pipelines.
Discover the capabilities of zero-shot object detection, which enables anyone to use a model out-of-the-box without any training and generate production-grade results.
What is facial expression recognition and what SOTA models are being used today in production
Get a simple TensorFlow facial recognition model up & running quickly with this tutorial aimed at using it in your personal spaces on smartphones & IoT devices.
Explore accurate classification algorithms using the latest innovations in deep learning, computer vision, and natural language processing.
Learn what human activity recognition means, how it works, and how it’s implemented in various industries using the latest advances in artificial intelligence.
What is the the SetFit architecture and how does it outperform GPT-3 and other few shot large language models
What is image classification and how we build production level TensorFlow image classification systems for recognizing various products on a retail shelf.
Explore the application of intelligent document processing (IDP) in different industries and dive in-depth on intelligent document pipelines.
How to build an image classification model in PyTorch with a real world use case. How you can perform product recognition with image classification
Let's build a custom CTA generator that you'll actually want to use for your website copy
We’re going to look at how we built a state of the art NLP pipeline for blended summarization and NER to process master service agreements (MDAs) that vary the outputs based on the input document and what is deemed important information.
Get a comprehensive overview of a purchase order vs. invoice, including when businesses use each, what information goes in them, and more.
Learn what Google Shopping categories are used for and how you can automate fitting products to this taxonomy using ai.
Automatically categorize your Shopify store products to the Shopify Product Taxonomy instantly with ai based PIM software
Dive deep into 3-way invoice matching, including how it works, eight benefits for your business, and the problems with doing it manually.
Smart farming using computer vision and deep learning provides the most promising path forward in the slow-moving industry of agriculture.
How we leveraged large language models to build a legal clause rewriting pipeline that generates stronger language and more clarity in legal clauses
Using ai for document information extraction to automate various parts of the loan process.
Apply AI to your favorite sport with this guide. Learn how automated ball tracking can change the game for coaches and players.
Categorize your ecommerce products to the 2021 google product taxonomy tree instantly with our Ai software
Surveying the current landscape of ecommerce automation and how you can use ai to automate huge chunks of your product management.
Classify your product data against an existing product category database or generate categories and tags in seconds using artificial intelligence
Warehouse automation plays a crucial role across your supply chain. Learn about how machine learning and ai software can be integrated into your warehouse automation stack.
4 different NLP methods of summarizing longer input text into different methods such as extractive, abstractive, and blended summarization
iscover an invoice OCR tool that will revolutionize the way you handle invoices. There’s no human intervention needed & a dramatically lower per-invoice cost.
Instead of invoice matching taking upwards of a week, it could take mere seconds with the proper automation solution. Learn more here.
Manual and template-based invoicing are riddled with low accuracy and required human intervention. Learn how to systematically eliminate these issues with the right invoice data capture software.
A complete walkthrough guide on how to use visual search in ecommerce stores to create more sales and real examples of companies already using it.
Automating the extraction of data from invoices can reduce the stress of your accountants by finding inaccuracies, digitizing paper invoices, and more.
How you can use machine learning based data matching to compare data features in a scalable architecture for deduping, record merging, and operational efficiency
Learn how lifetime value or LTV prediction can improve your marketing strategies. Then, discover the best statistical & machine learning models for your predictions.
A deep understanding of how we use gpt-3 and other NLP processes to build flexible chatbot architectures that can handle negotiation, multiple conversation turns, and multiple sales tactics to increase conversions.
The popular HR company O.C. Tanner, which has been in business since 1927 and has over 1500 employees, was looking to research and design two GPT-3 software products to be used as internal tools with their clients. GPT-3 based products can be difficult to outline and design given the sheer lack of publicly available information around optimizing and improving these systems to a production level.
We’ll compare Tableau vs QlikView in terms of popularity, integrations, ease of use, performance, security, customization, and more.
With a context-aware recommender system, you can plan ways to recreate some of the contextual conditions that persuade them to buy more from you.
We’re going to walk through building a production level twitter sentiment analysis classifier using GPT-3 with the popular tweet dataset Sentiment140.
Find out how machine learning in medical imaging is transforming the healthcare world and making it more efficient with three use cases.
Discover ways that machine learning in health care informatics has become indispensable. Review the results of two case studies and consider two key challenges.
Accelerate your growth by pivoting key areas of your business to AI. Your business outcomes will be achieved quicker & you’ll see benefits you didn’t plan for.
We built a GPT-3 based software solution to automate raw data processing and data classification. Our model handles keyword extraction, named entity recognition, text classification | Case Study
We built a custom GPT-3 pipeline for key topic extraction for an asset management company that can be used across the financial domain | Case Study
How you can use GPT-3 to create higher order product categorization and product tagging from your ecommerce listings, and how you can create a powerful product taxonomy system with ai.
5 ways you can use product matching software in ecommerce to create real value that raises your sales metrics and improves your workflow operations.
Data mining and machine learning in cybersecurity enable businesses to ensure an acceptable level of data security 24/7 in highly dynamic IT environments. Learn how data security is getting increasingly automated.
Big data has evolved from hype to a crucial part of scaling your organization in every modern industry. Learn more about how big data is transforming organizations and providing business impacts.
Learn how natural language processing can benefit everybody involved in education from individual students and teachers to entire universities and mass testing agencies.
Here’s how automated data capture systems can benefit your business in some key ways and some real-life examples of what it looks like in practice.
Use these power ai and machine learning tools to create business intelligence in your marketing that pushes your business understanding and analytics past your competition.
We built a custom ML pipeline to automate information extraction and fine tuned it for the legal document domain.
In this practical guide, you'll get to know the principles, architectures, and technologies used for building a data lake implementation.
Find out how machine learning in biology is accelerating research and innovation in the areas of cancer treatment, medical devices, and more.
An enterprise data warehouse (EDW) is a repository of big data for an enterprise. It’s almost exclusive to business and houses a very specific type of data.
Dlib is a versatile and well-diffused facial recognition library, with perhaps an ideal balance of resource usage, accuracy and latency, suited for real-time face recognition in mobile app development. It's becoming a common and possibly even essential library in the facial recognition landscape, and, even in the face of more recent contenders, is a strong candidate for your computer vision and facial recognition or detection framework.
Learn how to utilize machine learning to get a higher customer retention rate with this step-by-step guide to a churn prediction model.
Machine learning algorithms are helping the oil and gas industry cut costs and improve efficiency. We'll show you how.
We’ll show you the difference between machine learning vs. data mining so you know how to implement them in your organization.
Here’s why you should use deep learning algorithms in your business, along with some real-world examples to help you see the potential.
Beam search is an algorithm used in many NLP and speech recognition models as a final decision making layer to choose the best output given target variables like maximum probability or next output character.
Best Place For was looking for an image recognition based software solution that could be used to detect and identify different food dishes, drinks, and menu items in images sourced from blogs and Instagram. The images would be pulled from restaurant locations on Instagram and different menu items would be identified in the images. This software solution has to be able to handle high and low quality images and still perform at the highest production level, while accounting for runtime as well as accuracy.
Deep learning recommendation system architectures make use of multiple simpler approaches in order to remediate the shortcomings of any single approach to extracting, transforming and vectorizing a large corpus of data into a useful recommendation for an end user.
Let's take a look at the architecture used to build neural collaborative filtering algorithms for recommendation systems
GPT-3 is one of the most versatile and transformative components that you can include in your framework, application or service. However, sensational headlines have obscured its wide range of capabilities since its launch. Let’s take a look at the ways that companies and researchers are achieving real-world results with GPT-3, and examine the untapped potential of this 'celebrity AI'.
How to get started with machine learning based dynamic pricing algorithms for price optimization and revenue management
Let's take a look at how you can use spaCy, a state of the art natural language processing tool, to build custom software tools for your business that increase ROI and give you data insights your competitors wish they had.
The landscape for AI in ecommerce has changed a lot recently. Some of the most popular products and approaches have been compromised or undermined in a very short time by a new global impetus for privacy reform, and by the way that the COVID-19 pandemic has transformed the nature of retail.
Extremely High ROI Computer Vision Applications Examples Across Different Industries
Building Data Capture Services To Collect High ROI Business Data With Machine Learning and AI
Software packages and Inventory Data tools that you definitely need for all automated warehouse solutions
Inventory automation with computer vision - how to use computer vision in online retail to automate backend inventory processes