{"slug": "rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow", "title": "RF-DETR Semantic Segmentation: Fine-Tuning and NAS on Roboflow", "summary": "Roboflow released a new family of RF-DETR semantic segmentation models in six sizes, from Nano to 2XL, that label every pixel in an image fast enough for live video. The Nano model processes a full image in 2.3 ms on an NVIDIA T4 and scores 48.2 mIoU on ADE20K, beating YOLO26-M's 47.2 mIoU at less than half YOLO26-M's 5.2 ms latency, while the 2XL model reaches 54.7 mIoU at 23.8 ms. All six checkpoints ship with 150 ADE20K classes out of the box, and Roboflow also introduced Neural Architecture Search to find the best accuracy-latency tradeoff for a user's own segmentation data.", "body_md": "We're introducing a new family of RF-DETR (opens in a new tab) models and Neural Architecture Search (NAS), specialized for semantic segmentation. Previously RF-DETR could detect and segment objects, and locate their keypoints. Now it can label every pixel in an image, fast enough for live video.\n\nThe new models come in six sizes, Nano to 2XL. Nano labels a full image in 2.3 ms on an NVIDIA T4 and scores 48.2 mIoU on ADE20K, ahead of YOLO26-M at less than half the latency.\n\nThere are three ways to use them:\n\nRun a pre-trained model. One API call labels 150 everyday classes.\n\nFine-tune on your own data. Fine-tune any size in Roboflow without writing code.\n\nNeural Architecture Search. NAS automatically finds the best accuracy-latency tradeoff for your semantic segmentation data.\n\nWhat is RF-DETR semantic segmentation?\n\nRF-DETR started as an object detector, and later grew to support instance segmentation and keypoint detection tasks. Semantic segmentation is the newest addition to the family.\n\nDetection, instance segmentation and semantic segmentation answer different questions. A detector draws a box around each object. An instance segmentation model outlines each object. A semantic segmentation model gives every pixel a class, and it does not separate one object from the next. Two patches of corrosion on the same beam are both just corrosion.\n\nThe models come in six sizes, so you can match the model to your hardware and latency budget. The smaller sizes are faster, and the larger sizes pick up finer detail. You refer to each one by its model ID.\n\nPre-trained Model ID\n\nResolution\n\nT4 latency (ms)\n\nADE20K mIoU\n\nrfdetr-sem-nano\n\n312 × 312\n\n2.3\n\n48.2\n\nrfdetr-sem-small\n\n384 × 384\n\n3.2\n\n49.5\n\nrfdetr-sem-medium\n\n432 × 432\n\n4.0\n\n50.0\n\nrfdetr-sem-large\n\n500 × 500\n\n5.9\n\n52.0\n\nrfdetr-sem-xlarge\n\n560 × 560\n\n8.8\n\n52.8\n\nrfdetr-sem-2xlarge\n\n880 × 880\n\n23.8\n\n54.7\n\nOut of the box, every size knows 150 everyday classes, such as sky, building, road, floor and person. The classes come from ADE20K, a public dataset of more than 20,000 indoor and outdoor scenes. ADE20K is also the standard benchmark for this task.\n\nHow does RF-DETR semantic segmentation compare to other models?\n\nTwo things matter when you pick a model: how accurate it is, and how long it takes on each image. This chart shows both for RF-DETR and five other model families.\n\nHigher is more accurate, and farther left is faster. Accuracy is mIoU on ADE20K, on a scale of 0 to 100. Latency is the time to process one image on an NVIDIA T4 GPU, and its axis is logarithmic. The letters mark the model sizes.\n\nRF-DETR is the top line. From 2.3 ms up, the most accurate model at any speed is an RF-DETR size. For you, that means more frames per second at the accuracy you need, or more accuracy at the frame rate you have.\n\nThe gap is widest for the small models. Nano scores 48.2 mIoU in 2.3 ms, and YOLO26-M needs 5.2 ms to reach 47.2. At the top, 2XL reaches 54.7, and no other model scores above 51.8.\n\nThe practical way to read a chart like this is to start from your latency budget. Find the time you can spend on each image on the x-axis, then take the highest model at or to the left of it. You will read a second chart the same way later in this post.\n\nRun a pre-trained model on your own images\n\nThe fastest way to see the model work is to send it a photo. The pre-trained checkpoints need no custom data and no training.\n\nThis example sends a photo of a mountain lake to the Serverless API and runs the pre-trained Large model. It saves the photo with each class drawn on it as lake-annotated.png and prints the classes it found.\n\nShell\n\n```\npip install -U inference-sdk\npip install -U \"supervision>=0.32.0\"\nexport ROBOFLOW_API_KEY=\"your-api-key\"\n```\n\nPython\n\n``` python\nimport os\n\nimport cv2\nimport supervision as sv\nfrom inference_sdk import InferenceHTTPClient, InferenceConfiguration\n\nimage_url = \"https://media.roboflow.com/docs/mountain-lake-boats.jpg\"\nimage = sv.load_image_from_url(image_url)\n\nclient = InferenceHTTPClient(\n    api_url=\"https://serverless.roboflow.com\",\n    api_key=os.environ[\"ROBOFLOW_API_KEY\"],\n).configure(InferenceConfiguration(\n    api_key_transport=\"header\",\n    client_downsizing_disabled=True,\n))\nresult = client.infer(image, model_id=\"rfdetr-sem-large\")\n\ndetections = sv.Detections.from_inference(result)\n\npalette = sv.ColorPalette.from_hex([\n    \"#22C55E\", \"#38BDF8\", \"#8B5CF6\", \"#F59E0B\", \"#EC4899\",\n    \"#EF4444\", \"#2563EB\", \"#14B8A6\", \"#A3E635\", \"#FDE047\",\n])\nannotated = sv.MaskAnnotator(\n    color=palette, opacity=0.35, color_lookup=sv.ColorLookup.INDEX\n).annotate(image.copy(), detections)\nannotated = sv.PolygonAnnotator(color=sv.Color.WHITE, thickness=2).annotate(\n    annotated, detections\n)\nannotated = sv.LabelAnnotator(\n    color=palette,\n    color_lookup=sv.ColorLookup.INDEX,\n    text_position=sv.Position.CENTER_OF_MASS,\n    text_scale=0.8,\n    smart_position=True,\n).annotate(annotated, detections)\n\ncv2.imwrite(\"lake-annotated.png\", annotated)\nprint(detections.data[\"class_name\"])\n```\n\nsv.Detections.from_inference turns each class in the result into one detection whose mask covers every pixel of that class. Keep client-side downsizing disabled so the mask matches the size of your image. You need supervision 0.32.0 or later. Install it after inference-sdk, as shown above. pip prints a dependency warning on that line, and the example still runs.\n\nThe model finds five classes in the photo: tree, water, boat, pier and rock.\n\nA pre-trained model is all you need when your classes are among the 150 in ADE20K, like floor, wall, road or sky. Most projects need something else.\n\nFine-tune RF-DETR Semantic Segmentation on your own classes\n\nADE20K has a class for wall. It has no class for corrosion. To measure corrosion on a structure, you need a model trained on custom data suited to the task. The example in this section uses a public dataset of 107 photos of corroded steel and concrete, labeled with one class: corrosion.\n\nYou can train one in Roboflow without writing code. If you have trained RF-DETR for detection before, the flow in How to Train RF-DETR on a Custom Dataset is the same.\n\nCreate a project and pick Semantic Segmentation as the project type.\n\nUpload your images and label each region. Smart Select outlines a region in one click, and the Brush tool paints by hand.\n\nGenerate a dataset version. This freezes your images into train, valid and test splits.\n\nClick Train, choose Custom Training, then pick RF-DETR and a size.\n\nPick the size from the chart above. If you deploy to an edge GPU, start with Nano or Small. If accuracy matters more than speed, start with Large.\n\nWhen training finishes, check the mIoU on your test split and the per-class IoU. A class with low IoU usually needs more labeled examples. The semantic segmentation docs (opens in a new tab) cover each step.\n\nHere is the result on the corrosion dataset. We trained RF-DETR Small on its 107 images. On a test image the model never saw, it marks 22% of the pixels as corrosion. That is a number a bounding box cannot give you.\n\nTo run your model, use the code from the previous section and replace the model_id with the ID on your model's page in Roboflow.\n\nThis path works well when you already know which size you need. Often you do not.\n\nFind the best model for your data with Neural Architecture Search\n\nPicking a size from the ADE20K chart is an educated guess. The six named model sizes are tuned for ADE20K, and your data is not ADE20K. A model that follows thin streaks of corrosion needs different settings from one that splits sky from water. Nano could be enough for your images, or you could need Large.\n\nYou could train all six sizes and compare them. NAS does that work in one job, and it compares many more than six models.\n\nOpen the Train tab and select the Neural Architecture Search engine.\n\nChoose a backbone. Standard covers a wide latency range for edge and GPU deployment. Plus finds the most accurate models for cloud GPUs.\n\nSelect a dataset version. Leave augmentations off, and keep at least 15 images in your validation split.\n\nClick Start Training.\n\nRead the results page the same way you read the ADE20K chart. Find your latency budget on the x-axis and star the model with the highest mIoU at or under it. Starred models appear in the Workflows model picker. NAS is available on every plan, including the free tier, and bills training time at the standard rate.\n\nThe screenshot above is the search on the same 107 corrosion images. It returned 15 models between 1.2 ms and 7.1 ms, and the curve sits above the fixed RF-DETR sizes on this dataset. The recommended model scores 69.0 mIoU on the validation images at 2.4 ms. The most accurate one scores 70.4 at 7.1 ms. Here is that model on the same test image.\n\nWhich option should you use?\n\nYour classes are in ADE20K. Run a pre-trained model. You do not need a dataset.\n\nYou have your own classes and you know which size you need. Use Custom Training.\n\nYou have your own classes and a latency budget. Run Neural Architecture Search and pick from the curve.\n\nRF-DETR semantic segmentation models are available under the Roboflow Platform Model License 1.0 (opens in a new tab). The license covers commercial deployment on Roboflow. Commercial self-hosting requires the Enterprise add-on.", "url": "https://wpnews.pro/news/rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow", "canonical_source": "https://roboflow.com/blog/semantic-segmentation-with-rf-detr", "published_at": "2026-11-30 16:30:13+00:00", "updated_at": "2026-11-30 16:43:24.395411+00:00", "lang": "en", "topics": ["computer-vision", "machine-learning", "ai-research", "ai-tools", "artificial-intelligence"], "entities": ["Roboflow", "RF-DETR", "ADE20K", "NVIDIA T4", "YOLO26-M"], "also_reported_by": [], "takeaway": "RF-DETR semantic segmentation ships in six sizes from rfdetr-sem-nano (2.3 ms on a T4, 48.2 mIoU on ADE20K) to rfdetr-sem-2xlarge (23.8 ms, 54.7 mIoU), each pre-trained on 150 ADE20K classes and fine-tunable or NAS-optimizable in Roboflow.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow", "markdown": "https://wpnews.pro/news/rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow.md", "text": "https://wpnews.pro/news/rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow.txt", "jsonld": "https://wpnews.pro/news/rf-detr-semantic-segmentation-fine-tuning-and-nas-on-roboflow.jsonld"}}