LINEA: Fast and Accurate Line Detection Using Scalable Transformers

Sebastian Janampa, Marios Pattichis · 2025

Read LINEA: Fast and Accurate Line Detection Using Scalable Transformers by Sebastian Janampa, Marios Pattichis (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-16264.txt.

Introduction

Sebastian Janampa and Marios Pattichis present a faster method for finding lines in images in a paper from two thousand twenty-five. Line detection is a basic step used by many higher image tasks. Newer transformer models are more accurate than older ones, but they run slowly and need large pre-training sets.

Their method, called LINEA, uses a new attention step shaped for lines, so no large pre-training is needed. Tests show it runs much faster than earlier transformer methods. It also beat prior models on a test set drawn from a different source than the training data. The authors aim to bring accurate line detection to video and other jobs that need low delay.

Catalog record

CREATORSebastian Janampa, Marios Pattichis
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE19 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-16264

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

LINEA: Fast and Accurate Line Detection Using Scalable Transformers Sebastian Janampa, Marios Pattichis Abstract Line detection is a basic digital image processing operation used by higher-level processing methods. Recently, transformer-based methods for line detection have proven to be more accurate than methods based on CNNs, at the expense of significantly lower inference speeds. As a result, video analysis methods that require low latencies cannot benefit from current transformer-based methods for line detection. In addition, current transformer-based models require pretraining attention mechanisms on large datasets (e.g., COCO or Object360). This paper develops a new transformer-based method that is significantly faster without requiring pretraining the attention mechanism on large datasets. We eliminate the need to pre-train the attention mechanism using a new mechanism, Deformable Line Attention (DLA). We use the term LINEA to refer to our new transformer-based method based on DLA. Extensive experiments show that LINEA is significantly faster and outperforms previous models on sAP in out-of-distribution dataset testing. Code available at https://github.com/SebastianJanampa/LINEA . † † address: The University of New Mexico Dept. of Electrical & Computer Engineering 1 Introduction Line segment detection is a low-level operation in digital image processing. Successful line segment detection is essential for higher-order operations such as camera calibration, scene understanding, SLAM, and as a low-level feature for self-driving vehicles. Thus, it is clear that the development of fast and accurate line (or line segment) detection can impact several applications. Most modern methods use convolutional neural networks (CNN) to detect lines. We summarize the CNN architectures for line detection as a sequence of basic steps. First, they use a light encoder-decoder backbone to generate a single feature map, followed by a module to produce a non-fixed number of line candidates [ 1 ] . Next, a refinement module receives the candidates to produce a more accurate estimation of the lines. Then, a Line of Interest (LoI) [ 2 ] module predicts whether the refined candidate is a line. End-to-end transformer models [ 3 ] consist of a backbone that produces a set of feature maps and an encoder to enhance them. Then, a decoder uses a fixed number of queries to estimate the line endpoints and the probability that a query is associated with an actual line segment. LinE segment TRansform (LETR) [ 4 ] is a transformer model that uses a coarse-to-fine approach to detect lines. More recently, the Deformable Transformer-based Line Segment Detector (DT-LSD) [ 5 ] uses a deformable attention mechanism and the Line Contrastive DeNoising (LCDN) technique to accelerate convergence during training. Ultimately, we are interested in attention mechanisms that do not require expensive pretraining on large datasets. We introduce a new deformable line attention mechanism (DLA) to eliminate the need for pre-training. We introduce a family of transformer-based models termed LINEA (Spanish word for line) that can detect line segments with constant inference latency. LINEA models use the new deformable line attention (DLA) to achieve competitive results. Our approach uses the minimum number of trainable parameters compared to other transformer-based methods. In out-of-distribution testing, we show that LINEA models give competitive or better results on the YorkUrban dataset. Furthermore, our three smaller LINEA models require fewer FLOPs than all models. Figure 1: Architecture of LINEA. The model has a hierarchical backbone that extracts a set of feature maps from the input imagee. A modified GELAN fuses two feature maps to give them global and precise information. The following module selects the queries with the highest probabilities of storing a line candidate. Then, the decoder uses the deformable line attention (DLA) mechanism to make the queries and the feature maps interact to predict the line’s endpoints. 2 Background 2.1 CNNs for line detection The majority of deep learning methods for line detection are based on convolutional neural networks (CNNs). L-CNN [ 2 ] uses a light encoder-decoder encoder that processes RGB images to produce a feature map whose dimensions are a fourth of the original image size. A proposal initialization module uses a linear layer to produce junction candidates from the feature map, followed by non-maximum suppression to remove duplicates around correct predictions and generate a non-fixed number of line candidates from the junctions. Then, a Line of Interest (LoI) module determines whether a line candidate is an actual line. HAWP [ 1 ] and HAWPv2 [ 6 ] reduce the number of line candidates the LoI module receives by using a 4D attraction field and holistic attraction field, respectively. SACWP [ 7 ] improves the backbone’s decoder from HAWP by using asymmetric convolutions. MLNET [ 8 ] adds enhancing blocks based on the self-attention [ 9 ] mechanism to the backbone’s encoder from HAWP. ULSD [ 10 ] uses Bezier curve representations to handle different types of images. F-CLIP [ 11 ] is a single-stage network with a light encoder-decoder backbone followed by specialized heads that estimate the line center, length, and angle. 2.2 Transformer-based methods for line detection LinE segment TRansformers (LETR) [ 4 ] is the first end-to-end line detector that uses transformers. LETR uses the attention mechanism to detect line endpoints. However, LETR has high latency and is slow to train (requiring >800 epochs for training). LETR also requires significant memory resources. More recently, Deformable Transformer-based Line Segment Detection (DT-LSD) [ 5 ] uses a deformable attention mechanism and a contrastive denoising technique for line detection. Compared to the methods proposed in the current paper, we note that both methods require training on large datasets (e.g., Object365 or COCO). 3 Methodology Figure 1 illustrates the general architecture of our proposed model. It has a hierarchical backbone that generates a set of feature maps. Then, the hybrid encoder enhances the feature maps. Next, the query selection module selects the most important pixels of the feature maps to initialize the queries. Finally, the decoder and the DLA mechanism use the queries and enhanced feature maps to estimate the lines’ endpoints. 3.1 Hybrid encoder A set of 1\times 1 convolutions ensures that all feature maps share the number of channels. Then, self-attention enhances the smallest spatial feature map. Next, a modified GELAN module fuses two adjacent feature maps for cross-scale interaction. The modified GELAN uses two parallel 1\times 3 and 3\times 1 convolutional layers to extract better line features and the 3\times 3 and 1\times 1 convolutions. We fuse all layers into one 3\times 3 kernel for deployment to avoid increasing the latency. 3.2 Query selection A linear layer processes the encoder’s output to get the top- k pixels with the highest probability of containing an instance. In what follows, similar to transformer frameworks for object detection, we refer to the line’s endpoints as an anchor box. The initial anchor boxes are the normalized coordinates of the selected pixel on its feature map plus the offsets generated by another linear layer that processes the top- k pixels. We refer to the anchor boxes as static positional queries to highlight the fact that they are not associated with learnable parameters from the model. Algorithm 1 provides \mathrm{pytorch} -styled pseudocode for the entire process. In contrast, we note that the content queries are learnable because they are embeddings that are updated after each iteration during training. Algorithm 1 Anchor generation \mathbf{F} . Concatenation

Read the complete text