Ceramic tiles are susceptible to a range of defects, from chipping to cracks to holes on the surface of the ceramic tile. Thus, ceramic must be handled with extreme care, and run through extensive quality assurance processes to ensure the integrity of the material before shipping and distribution.
In this guide, we are going to show you how to detect defects in ceramic using computer vision, a modern variant of machine learning that can be customized to your exact business use cases. We will use a pre-trained model that identifies holes, cracks, and edge chips on ceramic tiles.
Here is an example of the result from our model:
Without further ado, let’s get started!
Machine Vision vs. Computer Vision for Ceramic Defects
Traditionally, purpose-built cameras such as those manufactured by Cognex and Keyence could be used to identify defects in ceramic. Such cameras can specialize in a single check, such as ensuring that the edges of a tile meet an expected, predefined pattern.
With computer vision, you can customize advanced logic that performs multiple checks. For example, you can check for cracks and edge chips at the same time. You can do so using any camera that you can stream to a computer.
You can also train a computer vision system using your own data, allowing you to build a system that recognizes defects unique to your product. If the system struggles with a particular ceramic defect, you can tune the system as required to improve performance. This is particularly useful in dynamic environments that have changing processes or production lines because you can quickly update your model to account for any new
Use Computer Vision to Identify Ceramic Defects
Let’s experiment with using computer vision to identify defects in ceramic tiles. For this guide, we will use the “ceramic-tile-defects” dataset on Roboflow Universe, the world’s largest community of open computer vision models and datasets. We can use this model without additional training . Later in this guide, we will give information about how to build your own model.
Step #1: Create a Roboflow Account
To get started, first create a free Roboflow account. This will allow you to run computer vision models from Roboflow Universe.
Step #2: Run the Universe Model
Open the Ceramic Tile Defect Detection model on Roboflow Universe. Then, click “Visualize” in the sidebar. This will open an interactive window in which you can test the model on your own images or videos. You can also select an image from the “Test Set” in the left sidebar.
Here is an example of the model working to identify holes, lines, and edge cracks:
Step #3: Deploy the Model
You can run this model in the cloud or on your own hardware. For manufacturing use cases, we recommend running the model on your hardware for maximum performance.
To run the model on an image, first open a programming terminal. Run the following command:
pip install inference supervision opencv-python
Then, create a new Python file and add the following code:
from inference import get_roboflow_model
import supervision as sv
image = cv2.imread("image.jpg")
model = get_roboflow_model(model_id="ceramic-tile-defect-detection/1")
results = model.infer(image)
labels = [i.class_name for i in results.predictions]
detections = sv.Detections.from_inference(results.dict(by_alias=True, exclude_none=True))
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
Above, replace image.jpeg with the name of the file on which you want to run your model.
Then, export your Roboflow API key into an environment variable called
Then, run the script.
A window will appear that shows the results from the model:
Our model successfully identified defects in our ceramic tile.
Next Steps: Building a Model and Logic
If the ceramic tile model we used above works for your use case, you can use it in your application.
With that said, we recommend training a fine-tuned model on data from your manufacturing facility. A fine-tuned model is a system that has learned from annotated examples of defects that you want to identify.
Using a fine-tuned model will allow you to achieve the best possible performance for identifying the defects present in the type of ceramic material with which you are working.
You can use active learning, integrated into Roboflow, to collect data in real time as your model is deployed. You can then use this data to train new versions of your model. This approach to building models allows you to gather representative data that will help you boost model performance. You can also prevent model drift, where the performance of your model decreases over time due to changes in the environment in which your model is deployed.
To get started building your model, refer to the Roboflow Getting Started guide. You can have the first version of a computer vision model trained and deployed on your own hardware in a day.
Once you have a model ready, you can start integrating business logic into your model. For example, you could:
- Build an automated rejection system if a tile contains more than one defect.
- Create an internal database that logs at what stage of production defects are found.
- Analyze data over time to identify trends in defects (i.e. are defects more common after a tile goes through a particular stage of the manufacturing process).
- Identify where defects are most common (i.e. on the edge of a tile, in the middle).
- And more.
To learn more about integrating computer vision into your business logic, refer to Roboflow Templates. Roboflow Templates is a collection of over a dozen guides you can use to integrate computer vision into your business logic.
If you need assistance integrating computer vision into your ceramic tile manufacturing process, contact a member of the Roboflow sales team.