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.
A 2021 report estimated that the adoption of precision agriculture increased U.S. crop yields by 4% and broader adoption will potentially increase them by as much as 6%. Farmers, suppliers, agricultural marketing companies, and farm financing companies are just a few of the businesses in the industry that can expect to see their revenues grow by investing in precision agriculture.
Smart farming using artificial intelligence, deep learning, and computer vision provide the most promising path forward to achieve high yields quickly in a slow-moving industry. In this article, we’ll explain the kind of things AI-assisted computer vision can help you achieve in your agricultural business.
The illustration above shows the stages of an agricultural cycle and the activities in each stage. We’ll explore how computer vision for precision agriculture is being used to automate these activities.
Among all the factors that affect crop yield, soil wields the most influence. Soil properties decide which crops can be planted and how well they’ll grow. For example, corn needs well-drained loamy soil with a medium texture, high water retention, and containing particular levels of nutrients.
During the planning stage, farmers need to know the properties of the soil in every section of their farms for optimum crop planning and crop rotation. Traditionally, this is a time-consuming and labor-intensive process, but smart farming speeds it up dramatically with minimal human labor.
Digital soil mapping is done before the planting cycle starts. Multispectral cameras are fitted to drones or other unmanned aerial vehicles (UAVs) whose flight paths are automated.
As the drones fly around the farm at a height of about 50 meters, they collect imagery in the optical, near-infrared, and infrared bands at centimeter resolutions. The intensities of the radiation that a soil reflects or emits is its spectral signature. It embeds valuable information about soil properties like texture, soil moisture, acidity, minerals, and more.
The spectral video feed is sent to an edge device on the ground kept within the communication range of the drone. It cleans and processes the images by running computer vision algorithms either locally or in the cloud.
First, the images are pre-processed using image stitching, optical flow for video stabilization, deblurring, and so on to improve the accuracy of classification.
Once an image is cleaned up, the system is ready to segment its pixels. Soil properties can vary a lot even within a small area. Moreover, different soils may have irregular-shaped boundaries between them. That’s why we prefer pixel-level classification using semantic segmentation instead of area-level classification using object detection.
A deep neural network architecture for segmentation, like U-Net, is trained to classify different soils based on their spectral signatures. These training datasets are annotated by soil experts who mark pixel-level annotations on a set of training images.
When the drone’s video feed starts, the edge device runs this model on the feed. It generates a near-real-time semantic segmentation map for each frame where every pixel is classified as a particular soil or a non-soil pixel. We can box all of these algorithms together into a simple and easy to use computer vision system.
Every crop cycle depletes the soil’s nutrients and modifies its properties in particular ways depending on the crop grown in that area. To restore the area’s soil to its original state naturally, farmers use a crop rotation strategy — instead of replanting the same crop in an area, they plant a different crop (or sequence of crops) that restores the soil’s properties. For example, corn depletes the soil’s nitrogen content but it can be restored by planting legumes in that soil in the next cycle.
For effective decision-making on crop rotation, farmers need to know:
Machine learning algorithms give us the ability to learn the best fit combination of crops to optimize crop rotation and other agricultural processes.
The crop rotation problem can be a time series prediction problem — given a history of crop and soil maps, what will be the predicted soil conditions, and which crops are best suited for those conditions?
Computer vision applications help prepare the soil maps and crop maps (as described in other sections). It also helps convert these visual maps into numerical vectors that are suitable for time series prediction. Convolutional neural networks express the visual features — like crop boundaries, crop types, soil texture, and so on — as vectors.
These vectors are then supplied to the time series prediction model. Algorithms like random forests, XGBoost, recurrent neural networks, or even transformer networks are then used to predict the new soil variables.
A crop’s phenotype refers to its physical characteristics like shape, size, appearance, texture, and so on. The phenotype directly affects the crop’s food grade and marketability.
The phenotype can be influenced by modifying specific genes of the seed. This mapping from the genotype to the phenotype is done by agricultural scientists, both in lab and field environments. During the planning stage, farmers can purchase seeds with suitable genotypes that will eventually produce crops with the desired phenotypes.
Automated edge devices, fitted with optical cameras or LIDAR sensors, drive around the farm capturing images of crops and sending them to an edge device. The edge device measures phenotype characteristics using the computer vision techniques explained next.
The raw images are first cleaned up using optical flow for video stabilization and image stitching to remove overlapping areas.
Next, an object detection neural network, like Yolo, is used to find parts of a crop like leaves, buds, seeds, flowers, stems, and so on.
Using photogrammetry, images of a crop are combined to create 3D versions which are easier to measure accurately. Finally, parts of the plant are measured visually against calibrated reference measurements to get values for each of the phenotype characteristics.
Crop mapping classification can also be used alongside time series models for crop yield estimation.
Crop maps identify the crops grown in an area over time, along with accurate georeferencing. They are critical to many agricultural applications like yield estimation, crop rotation planning, agricultural policies, insurance agencies, and more.
Data for crop mapping can come from a variety of sources:
Data from drones or robots is first sent to a nearby edge device (like a laptop) over wireless technologies like LoRa or narrowband IoT (Internet of Things). The data is then processed either locally or in the cloud using computer vision.
We combine several image processing, video processing, traditional computer vision, and state-of-the-art deep learning technologies to prepare crop maps.
The images and videos taken from moving platforms like drones and robots suffer unwanted effects like motion blurs, image overlaps, and sensor noise. To clean them up, we use image and video processing algorithms like:
Satellite imagery may require cloud removal and image stitching to prepare them for the next phase.
Crop map preparation is fundamentally a classification problem to answer the question: What is the thing that’s growing in a particular area? Because georeferencing is essential, you need localization in addition to classification.
Both object detection and semantic segmentation are capable of localizing and classifying. The former reports a single class for an entire rectangular area of pixels while the latter classifies every pixel.
The preferred method depends on the input data. On satellite images, pixel-level segmentation is preferred because every pixel represents anywhere from 100 square meters to half an acre of crops. Pixels of the same class are then combined using clustering.
But for drone and robot images with centimeter resolutions, we prefer object detection because segmentation’s fine-grained results are too noisy and simply unnecessary.
About $300 billion was lost due to plant diseases and invasive insects and about 20-40% of global production was lost to pests — these are the losses reported by the UN Food and Agriculture Organization. Monitoring crop health for diseases and pests is vital to reduce these losses and meet yield targets.
Crop diseases leave telltale signs on leaves, fruits, or other parts of a crop. Pests and insects can be identified by setting up automated motion detection.
Both monitoring tasks are done using automated robots fitted with cameras and infrared sensors. The exercise may also include farm workers using smartphone-based recognition apps for closer inspections. Video feeds from the robots and the apps are sent to an edge device that processes them locally or in the cloud.
When a disease or pest is detected using computer vision, that area is micro-targeted by the robot for localized treatment using pesticides or herbicides. Alternatively, a beneficial companion crop — like onions for carrots — is suggested to ward off a pest.
Diseases often manifest as irregularly shaped discolorations and damage to different parts of the crop. The diseased areas are localized using deep learning algorithms for object detection or semantic segmentation. Though segmentation is slower, its higher accuracy is useful for automated treatment. Both techniques are done using deep convolutional neural network models like Yolo or U-Net.
For closer inspection by farm workers, smartphone-based deep learning models like MobileNet are used for disease detection.
These object detection models are also used for pest and insect detection. In addition, motion detection and object tracking techniques like background subtraction, optical flow, and Kalman filter are used to track pests and insects as they move.
Yield prediction forecasts the amount of likely produce per unit of land area. It’s used at the start of a farming cycle by many players in the value chain:
Yield prediction is largely based on the current soil map and historical crop map data.
Yield estimation is done throughout the crop production stage to foresee any risks and ensure that the final yield matches the predicted yield. Yield estimation includes additional information about the planted crops like their genotypes and phenotypes, growth rates, diseases, and so on.
Yield estimation is a regression problem — given the soil map, crop map, phenotype measurements, disease rates, weather conditions, and other environmental factors, predict the yield per unit area based on historical yields. These four or five sets of input information consist of hundreds of factors between them with all kinds of effects on one another.
Hence, robust non-linear regression models like XGBoost or deep neural networks provide the most accurate results over simple statistical models. Let’s explore how computer vision is used in this process.
We’ve already explored how computer vision is used for all the subtasks that contribute to yield estimation — soil maps, crop maps, plant phenotyping, and disease detection.
But computer vision is used a second time in this pipeline. A deep convolutional neural network extracts characteristic visual features from the soil and crop maps and converts them to numerical vectors that can be input to the non-linear regression model.
One of the most important applications of computer vision is in quality control of harvested produce. All governments specify quality standards for them and impose fines for not meeting them. For example, the U.S. Department of Agriculture specifies minimum sieve sizes, minimum weights, and limits on the foreign material in corn. Every product is given a food grade based on how well it meets the standards.
The rest of the supply chain and end customers too have expectations of the quality. Each food grade is destined for different market segments. For example, exporting produce is often highly profitable but involves meeting the highest food grades and quality thresholds.
So, precision is vital for quality control. Unlike the field-based systems we’ve seen so far, quality inspections are done inside food processing plants by purpose-built machine vision systems with sophisticated detection, non-invasive testing, and measurement capabilities.
Traditional image processing techniques are widely used here because, unlike in the field, the system can easily create the ambient conditions necessary for the ML algorithms to return accurate results. The following techniques are common:
Using photogrammetry and camera calibration, dimensions can be measured accurately.
For complex products that show a lot of variety — like greens, fruits, and vegetables — deep neural networks are preferred because they can classify, detect, or segment complex objects accurately.
Whether you’re a farmer, marketer, supplier, bank, insurer, or involved in some other way in the agricultural sector, our extensive experience in computer vision and deep learning are available to help you implement agricultural automation in your 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.
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.
Product recognition software has tremendous potential to improve your profits and slash your costs in your retail business. Find out just how useful it is.
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