{"slug": "predictive-maintenance-with-vision-ai", "title": "Predictive Maintenance with Vision AI", "summary": "Roboflow released a tutorial demonstrating predictive maintenance with vision AI, combining RF-DETR and Gemini 2.5 Pro to detect bearing defects before failure. The system uses computer vision to continuously monitor equipment for visible early-warning signs, aiming to reduce unplanned downtime and maintenance costs.", "body_md": "*Automate predictive maintenance with vision AI. Combine RF-DETR and Gemini 2.5 Pro in Roboflow to detect equipment defects before failure.*\n\nPredictive maintenance with vision uses cameras and trained computer vision models to catch the visible early-warning signs of equipment failure, surface defects, wear, corrosion, and contamination, before they escalate into unplanned downtime. Instead of waiting for a component to fail or relying on periodic manual spot checks, a vision model continuously watches for the conditions that precede failure and flags them while there is still time to act.\n\nBearings are a textbook case. They are critical components in rotating machinery such as electric motors, pumps, conveyors, compressors, and industrial fans, and even minor surface defects can increase friction, vibration, and wear, eventually leading to equipment failure, costly downtime, and unplanned maintenance.\n\nIndustry studies [estimate](https://reliamag.com/guides/bearing-failure-cause-statistics/?ref=blog.roboflow.com) that 36% of premature bearing failures are caused by lubrication issues, 34% by fatigue, 16% by improper mounting and handling, and 14% by contamination, which means many early failures stem from preventable conditions a camera can catch. Detecting visible defects before they propagate lets maintenance teams identify deteriorating bearings and schedule repairs before unexpected failure occurs.\n\nIn this tutorial, we build an automated bearing inspection system, a concrete example of predictive maintenance with vision, using Roboflow. We train an [RF-DETR](https://rfdetr.roboflow.com/latest/?ref=blog.roboflow.com) model to classify bearing conditions from inspection images and integrate it into [Roboflow Workflows](https://roboflow.com/workflows/build?ref=blog.roboflow.com).\n\nThe resulting workflow combines computer vision with [Gemini 2.5 Pro](https://playground.roboflow.com/models/google/gemini-2-5-pro?ref=blog.roboflow.com) to transform visual inspections into actionable maintenance insights. [Here's the workflow we'll build.](https://app.roboflow.com/workflows/embed/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3JrZmxvd0lkIjoiUGw3N2Z4WFlieEZZV0dTUDJWaEEiLCJ3b3Jrc3BhY2VJZCI6Im5JRk5DOGRjbU5OOXZ4d29ybWpoWTdCNjdQZTIiLCJ1c2VySWQiOiJuSUZOQzhkY21OTjl2eHdvcm1qaFk3QjY3UGUyIiwiaWF0IjoxNzgyOTE1MTAzfQ.FOO8pEgICneEQrrRuXUKo6P6bKCNxKPoLUsaQ1-wLH4?ref=blog.roboflow.com)\n\n## What Is Predictive Maintenance with Vision?\n\nMaintenance strategies fall on a spectrum. Reactive maintenance fixes equipment after it breaks, which is the most expensive option because failure is unplanned. Preventive maintenance services equipment on a fixed schedule whether it needs it or not, which wastes labor and parts. Predictive maintenance acts on the actual observed condition of a machine, servicing it only when the data shows it is starting to degrade. It is the most efficient of the three because it catches problems early without over-servicing.\n\nPredictive maintenance with vision is the approach that uses cameras and computer vision models as the sensing layer for that condition data. Many failure modes are visible before they are catastrophic: surface wear, corrosion, cracks, contamination, misalignment, leaks, and loose or missing components all show up in an image long before the machine stops. A trained vision model inspects those components continuously and objectively, flagging the early-warning signs a periodic manual check would miss.\n\n### Where Vision-Based Predictive Maintenance Is Used\n\nThe same detect and assess pattern extends well beyond bearings:\n\n**Corrosion and rust** on structures, tanks, pipework, and fasteners.**Belt and roller wear** or misalignment on conveyors and drive systems.**Leaks and lubrication issues** around seals, joints, and gearboxes.**Surface cracks and fatigue** on castings, welds, and rotating parts.**Thermal anomalies** using infrared cameras to catch overheating bearings, motors, and electrical connections.**Loose or missing components** such as bolts, guards, and pins.\n\nIn each case, the value is the same: catch the visible condition early, quantify how serious it is, and schedule the fix before an unplanned failure takes the line down. The bearing inspection system below is a concrete, buildable version of that pattern.\n\n### Step 1: Prepare the Dataset\n\nFor this tutorial, we use the bearing defect [ dataset](https://universe.roboflow.com/devdutts-workspace/bearing-defect-qc?ref=blog.roboflow.com) from\n\n[. The dataset contains over 1,100 bearing images annotated for object detection, enabling the model to identify different bearing conditions during visual inspection.](https://universe.roboflow.com/?ref=blog.roboflow.com)\n\n__Roboflow Universe__The dataset contains four primary inspection classes:\n\n- good\n- scratch\n- rust\n- grease\n\nThe good class represents healthy bearings with no visible defects, while the remaining classes correspond to common bearing conditions encountered during quality inspection. The scratch class identifies surface scratches caused by wear, contamination, or improper handling. The rust class highlights corrosion developing on the bearing surface, which may indicate moisture exposure or inadequate storage conditions. The grease class identifies excessive or visible grease around the bearing that may indicate lubrication-related conditions requiring inspection.\n\nHere are examples of the detection targets:\n\nTo begin, fork the dataset into your Roboflow workspace. Then navigate to the Train tab and select Custom Training. From the available architectures, choose RF-DETR and set the model size to Small.\n\nOnce the model architecture is selected, generate a new dataset version before starting training. Configure a 70/15/15 split for training, validation, and testing.\n\nEnable the following preprocessing steps:\n\n- Auto-orientation\n- Resize (512 × 512)\n\nNext, configure the dataset augmentations to improve the model's ability to generalize to unseen inspection conditions. For this tutorial, enable the following augmentations:\n\n- Horizontal and vertical flip\n- Random rotation (±15°)\n- Random crop (0–20%)\n- Random noise\n- Motion blur\n\nThese preprocessing steps normalize images captured under different conditions while providing a consistent input size for RF-DETR training.\n\n### Step 2: Train the RF-DETR Model\n\nOnce training begins, RF-DETR learns to detect bearings and classify their visual condition directly from the annotated examples. Rather than simply determining whether an image contains a defective bearing, the model locates each bearing using a bounding box and assigns one of the predefined condition labels, such as good, scratch, rust, or grease.\n\nUnlike defect localization datasets that annotate the precise location of damage, this dataset labels the entire bearing according to its overall condition. As a result, the model predicts the bearing's health state rather than identifying the exact location of individual defects.\n\nThis approach is still valuable for predictive maintenance because it enables rapid screening of bearings during visual inspections. Maintenance personnel can quickly distinguish healthy bearings from those exhibiting signs of corrosion, surface scratches, or excessive grease, allowing potentially faulty components to be flagged for further inspection or replacement.\n\nAfter training completes, Roboflow provides evaluation metrics that measure how accurately the model classifies each bearing condition. These metrics help determine whether the model is ready for deployment within Roboflow Workflows, where the predictions can be further analyzed by Gemini 2.5 Pro to generate maintenance observations, explain the likely causes of the detected condition, estimate its severity, and recommend appropriate maintenance actions.\n\n### Step 3: Evaluate Metrics\n\nOnce training completes, review the model's performance on the test set to evaluate its ability to classify different bearing conditions. Our RF-DETR Small model achieved excellent results across all evaluation metrics.\n\nThe model achieved 99.3% mAP@50, 99.0% precision, 98.2% recall, and an F1 score of 98.6%. These results indicate that the model can reliably distinguish between good, scratch, rust, and grease-bearing conditions across the test dataset.\n\nThe high precision score means that most predicted bearing conditions are correct, minimizing false alarms during inspection. Likewise, the strong recall ensures that defective bearings are rarely missed, making the model well-suited as the first stage of an automated predictive maintenance workflow.\n\nBecause the dataset was collected under relatively consistent imaging conditions, real-world performance may vary depending on lighting, camera placement, and bearing types.\n\nThese metrics evaluate only the RF-DETR detection model. In the next step, we will integrate Gemini 2.5 Pro to analyze the detected bearing condition, generate maintenance observations, explain the likely causes of the detected defect, estimate its severity, and recommend appropriate maintenance actions.\n\n### Step 4: Deploy to Workflows\n\nAfter training, deploy the model in Roboflow Workflows to build the automated bearing inspection pipeline. The workflow accepts an input image, runs the trained RF-DETR model to classify the bearing condition, visualizes the prediction using bounding boxes and class labels, sends the annotated image to Gemini 2.5 Pro for maintenance analysis, overlays the generated inspection report onto the final image, and records the inspection using Roboflow Vision Events.\n\nTo create the workflow, open your trained model and click Deploy Model. In the deployment dialog, select Customize With Logic. This opens the Workflow editor with your trained RF-DETR model already added, allowing you to build the remainder of the inspection pipeline.\n\n### Step 5: Configure the Detection Pipeline\n\nStart with the trained RF-DETR model and connect it to a Bounding Box Visualization block, followed by a Label Visualization block. The model classifies each detected bearing as good, scratch, rust, or grease, while the visualization blocks draw a bounding box and display the predicted class label. This produces a clean, easy-to-interpret visualization and provides Gemini with the same annotated image that users see in the final output.\n\n### Step 6: Configure the Gemini Inspection\n\nAdd a Google Gemini block after the Label Visualization block and configure it with the following settings:\n\n- Image: label_visualization.image\n- Model: Gemini 2.5 Pro\n- Task Type: Open Prompt\n\nUse the following prompt:\n\n```\nYou are an industrial predictive maintenance specialist.\n\nAnalyze the detected bearing condition together with the inspection image. The image includes RF-DETR bounding boxes and class labels for one of these bearing-condition classes: good, scratch, rust, or grease.\n\nBase your analysis only on the visible evidence in the image. Do not infer defects that are not visually present.\n\nFor each section below, write exactly one sentence with a maximum of 12 words.\n\nReturn the response using the following format:\n\nDetected Condition:\n\n<State the detected bearing condition.>\n\nObservation:\n\n<Briefly describe the visible bearing condition.>\n\nPossible Causes:\n\n<State the most likely cause of the detected condition.>\n\nSeverity:\n\n<Low, Moderate, or High, followed by a brief justification.>\n\nRecommended Action:\n\n<Recommend the next maintenance step.>\n```\n\nGemini receives the annotated image instead of the original image, allowing it to focus on the detected bearing condition and its visual appearance. Rather than acting as an object detector, Gemini interprets the model prediction, generates maintenance observations, estimates the apparent severity, and recommends the next maintenance action. This combination leverages RF-DETR for bearing condition classification and Gemini for maintenance reasoning.\n\nNext, add a Text Display block. Use the labeled image as the base image and the Gemini response as the overlay text. Position the text in the bottom-left corner using white text on a semi-transparent black background. This produces a clean output that combines the model prediction with a concise maintenance assessment.\n\nFinally, add a Roboflow Vision Events block to record each inspection as a structured vision event. Configure it to log the original input image, the annotated output image, the RF-DETR predictions, and custom workflow metadata. This provides a persistent record of each inspection for auditing, traceability, and future maintenance analysis.\n\nThe completed workflow returns a single annotated image containing the detected bearing condition together with Gemini's maintenance assessment.\n\n### Step 7: Test the Workflow\n\nClick Run in the top-right corner of the Workflow editor and upload a bearing image. The final output contains:\n\n- The detected bearing condition (good, scratch, rust, or grease)\n- Bounding box and class label\n- A Gemini-generated maintenance assessment, including observations, possible causes, severity, and recommended actions\n\nThe combination of RF-DETR and Gemini 2.5 Pro enables rapid visual inspection while transforming model predictions into actionable maintenance insights, making the workflow well-suited for predictive maintenance applications.\n\n### Extending the Solution\n\nThis workflow can be extended beyond standalone image inspection by integrating it with existing industrial systems. For example, it can connect to a Manufacturing Execution System (MES) to automatically record inspection results for each production batch or to a Computerized Maintenance Management System (CMMS) to create maintenance work orders whenever a defective bearing is detected.\n\nIt can also be integrated with Enterprise Resource Planning (ERP) systems to associate inspection results with specific assets, serial numbers, or production orders. In addition, Roboflow Vision Events provide a structured inspection history that can be used for auditing, traceability, and trend analysis.\n\nFor even greater reliability, the workflow can be combined with condition-monitoring data such as vibration, temperature, or acoustic measurements. While RF-DETR identifies the bearing condition and Gemini generates maintenance recommendations, these additional sensor inputs can help validate the diagnosis and improve maintenance decision-making. Together, they create a more comprehensive predictive maintenance solution that reduces unexpected equipment failures and downtime.\n\n## Predictive Maintenance with Vision AI using Roboflow Agent\n\nIf you'd rather not add each block by hand, use [Roboflow Agent](https://app.roboflow.com/solutions/chat/new?ref=blog.roboflow.com). Instead of configuring blocks one at a time, you describe the pipeline you want in plain text and the Agent builds it for you. Here's an example:\n\n## Predictive Maintenance with Vision Conclusion\n\nIn this tutorial, we built an end-to-end predictive maintenance workflow using RF-DETR, Roboflow Workflows, and Gemini 2.5 Pro. The solution automatically classifies bearing conditions, generates AI-assisted maintenance assessments, and records each inspection as a structured event.\n\nBy combining computer vision with multimodal reasoning, the workflow transforms visual inspections into actionable maintenance insights, providing a practical foundation for building intelligent industrial inspection systems that can be further integrated into real-world maintenance and manufacturing environments.\n\n**Further reading**\n\n[Defect Inspection AI: Automating Quality Control](https://blog.roboflow.com/defect-inspection/)[How to Train RF-DETR on a Custom Dataset](https://blog.roboflow.com/train-rf-detr-on-a-custom-dataset/)[How to Detect Small Defects with Computer Vision](https://blog.roboflow.com/detect-subtle-defects/)\n\n## Predictive Maintenance with Vision FAQ\n\n**How does computer vision enable predictive maintenance?**\n\nA camera captures images or video of a component, a trained model classifies its condition and locates any defect, and downstream logic assesses severity and triggers an action such as an alert or a work order. Because a vision model inspects every unit continuously and objectively, it catches gradual wear that periodic manual checks miss and produces consistent data for maintenance planning.\n\n### What is the difference between predictive, preventive, and reactive maintenance?\n\nReactive maintenance fixes equipment after it fails. Preventive maintenance services it on a fixed schedule regardless of condition. Predictive maintenance uses real condition data, including visual inspection, to service equipment only when it shows early signs of degrading, which reduces both unplanned downtime and unnecessary servicing.\n\n### What equipment problems can vision-based predictive maintenance detect?\n\nAny failure mode with a visible signature: bearing scratches and rust, grease and contamination, surface cracks and fatigue, corrosion, belt and roller wear, leaks, loose or missing fasteners, and, with infrared cameras, thermal anomalies like overheating motors and electrical connections.\n\n### Can predictive maintenance vision models run on the edge without the cloud?\n\nYes. Models like RF-DETR can be deployed on edge hardware such as an NVIDIA Jetson or an industrial PC and run inference locally with no internet connection, which suits plant-floor and remote-site monitoring where continuous inspection and low latency matter.\n\n**Cite this Post**\n\nUse the following entry to cite this post in your research:\n\n[Mostafa Ibrahim](/author/mostafa/). (Jul 7, 2026).\nPredictive Maintenance with Vision AI. Roboflow Blog: https://blog.roboflow.com/predictive-maintenance-with-vision/", "url": "https://wpnews.pro/news/predictive-maintenance-with-vision-ai", "canonical_source": "https://blog.roboflow.com/predictive-maintenance-with-vision/", "published_at": "2026-07-07 00:07:38+00:00", "updated_at": "2026-07-07 01:24:22.887081+00:00", "lang": "en", "topics": ["computer-vision", "machine-learning", "ai-products", "ai-tools", "generative-ai"], "entities": ["Roboflow", "RF-DETR", "Gemini 2.5 Pro", "Google"], "alternates": {"html": "https://wpnews.pro/news/predictive-maintenance-with-vision-ai", "markdown": "https://wpnews.pro/news/predictive-maintenance-with-vision-ai.md", "text": "https://wpnews.pro/news/predictive-maintenance-with-vision-ai.txt", "jsonld": "https://wpnews.pro/news/predictive-maintenance-with-vision-ai.jsonld"}}