Detection and partition: From the position of the box to each pixel

Explains the different targets of IoU, NMS, header, semantic partition and example with fixed frames and masks.

System Chapter . StepCollate in 2 Graphics6 self-measurement3 First-hand sources
Start Body
Learning objectives and first steps4 objectives • 3 first fixes

Try to do it after reading

  • By continuous coordinates, IoU
  • Compare detection with two separate output types
  • Understanding multiscale features and mission losses
  • Distinguishing single-map indicators from full evaluation protocols

Suggested first

  • Volume & Characteristics
  • Category loss
  • Bring it together

Finding the object and drawing the contours are two missions

(a) A travel photograph, which can be classified as if there were any buildings; The tests also indicate where the building is; Synonyms are divided into categories assigned to each pixel; Examples are divided to distinguish between different individuals in the same type of object. While all three outputs come from visual features, different labels, loss and evaluation protocols are required. It cannot be described as having completed pixel-grade partitioning because the model is framed.

This is a composite geometric image that does not read photos or impliedly take information. Source kernel for 2026-10-29, adopted Faster R-CNN 、 Mask R-CNN and U-Net The original paper describes different structures; The results of the papers are not translated into station-based model capabilities for a given data set.

Set coordinates and output shape

A frame can be written[xmin,ymin,xmax,ymax], can also be used center and width. This paper uses continuous plane coordinates with a wide area multiplied by height, without the “plus one” agreement in effect using some integer pixels. If the image is scaled, filled or cropped, the prediction box and the true value must be mapped to the same coordinate space for comparison.

Boxes, categories and confidence points for each map of the model that is capable of output variability; Pixels Classes Commonly logits shape Yes[B,C,H,W], separate each pixel along the category axis. The example mask also contains an example index or corresponds to the detection box. semantic categories, example numbers and empty background assume different duties in the data format and cannot be combined with an integer label.

IoU hand-in-hand only, not looking at confidence scores

Remove A Box[0,0,2,2], B Box[1,0,3,2]I don't know. Both areas are 4 and the overlap area is 1 wide, 2 high and 2 large; It was written in 4+4−2=6, and IoU 1/3. If there is no overlap between the two boxes, the intersection area should be cut to zero instead of retaining the negative width multiplied by the negative height to obtain a false positive area.

IoU=|A∩B||A∪B|

Convergence of two consecutive framesA and B are two degrees and two degrees each, staggered horizontally; The shadowed area is two and six.ABPay = 2Area: 4 and 4In the following series: 6IoU:1 / 3
The solid line is separated from the dotted line by two boxes. The coordinates are composite geometry units and are not pixel readings of a given image.
# 标准 Python,已执行;连续坐标约定。
a, b = [0.,0.,2.,2.], [1.,0.,3.,2.]
intersection = max(0.,min(a[2],b[2])-max(a[0],b[0])) * max(0.,min(a[3],b[3])-max(a[1],b[1]))
area = lambda box: max(0.,box[2]-box[0])*max(0.,box[3]-box[1])
iou = intersection/(area(a)+area(b)-intersection)
assert abs(iou-1/3)<1e-12
truth, pred = [1,1,0,0], [1,0,1,0]
tp = sum(t and p for t,p in zip(truth,pred))
fp = sum((not t) and p for t,p in zip(truth,pred))
fn = sum(t and (not p) for t,p in zip(truth,pred))
assert (tp,fp,fn)==(1,1,1)
assert tp/(tp+fp+fn)==1/3 and 2*tp/(2*tp+fp+fn)==.5

How do the tests get the frame from the profile

Faster R-CNN Candidates are generated on shared profiles and then the candidate regions are classified and corrected; RPN has a different task from the follow-up test. Other detectors can either be directly in an intensive position prediction box or can be treated with examples of pooled predictions. They are understood by drawing up candidate sources, positive and negative sample definitions and matching rules, without replacing analysis with an absolute phrase such as “one-stage fast, two-stage perfect”.

The confidence score is for the sorting of the candidate and is not equal to IoU. Set two frame fractions of 0.9 and 0.8 for this example, using a greedy NMS and a threshold of 0.3, and when a high score is selected, the lower box is suppressed by the fact that IoU approximately 0.333 is above the threshold; The threshold of 0.5 may be retained at the same time. It is a reprocessing rule, not a model that automatically understands the number of objects. Whether cross-class inhibitors, thresholds and the need for NMS rely on the detector and deployment protocol.

Multiscale features are particularly important for small targets: deeper semantics are stronger but often lower resolution; The shallow layers are more detailed, but require semantic integration. Increased exposure to wildness without keeping location information may cause the very small target to disappear into the bottom sample. Data enhancement must also be synchronized to modify frames and masks, not just images.

Partition indicators are calculated from pixels

Take four pixels. Real value[1,1,0,0], forecast[1,0,1,0]I don't know. TP, FP, FN each, Foresight IoU 1/3, Dice2TP/(2TP+FP+FN)=0.5I don't know. The pixel accuracy rate is 0.5, but it is not the same indicator as IoU. At only one prospect out of 100 pixels, 99 per cent of the projected background is still accurate, while zero is the outlook IoU.

The real and fake classification of four pixel masksThe four sets represent positive, leakage, error and negation, respectively, one foreground and three foreground.TP = 1FN = 1FP = 1TN = 1Foreground intersection: TP = 1Foreground: TP+FP+FN = 3Dice = 2 / 4 = 0.5Each cell is a synthetic pixel
Dice and IoU are concerned with overlaps of pools, but with different numeric scales; The strategy for dealing with empty prospects needs to be clear.

U-Net combine context and location details with contract paths and expansion paths; Jump to pass the resolution message to the decoder end. Mask R-CNN The example detection structure was added to the masked branch, emphasizing the case relativity. No sampling network can be called U-Net, nor can each semantic mask be equated to distinguishing the same example.

What's the deal to make up for the loss and assessment

The detection of losses is often combined with classification and location regression to separate targets that can be used in pixel cross-enthion or overlapping categories. Normalization of different losses, positive and negative sample ratios and weights change optimization. A soft masking target with a minimal gradient in training cannot be confused with the discrete indicators calculated after thresholds have been added.

AP needs to be sorted in fractions and accumulated accuracy and recall rates under clear IoU thresholds and matching rules. The IoU for a single map is not AP, nor is the AP under a single threshold automatically equals the average of the multi-threshold values of the COCO protocol. Small targets, shielding, uneven categories, neglect of areas and empty labels should be examined separately to avoid total numbers concealing the actual failure of models.

We need a manual spot check to monitor the match

When training the detectors, the candidate position is assigned to the true value, determining where the learning prospects are, what is the background and what is ignored. When the two real values are blocked, a match of more than one may result in different oversight; The omission of areas in the split cannot be used as a background to participate in all pixels averages. After the label format has been converted, a random check should be made as to whether the crop, zoom and boundary are still consistent.

When evaluating examples, projections usually need to be matched to unmatched true values in the order of fractions, and repeat boxes may become false positive. The maximum IoU value cannot be singled out for each projection, and many predictions can be counted as success of the same object. The trust thresholds, maximum test numbers and category treatment rules should be fixed prior to the assessment rather than on an ad hoc basis after reading the results.

If two versions are to be compared, the wrong list of map-by-chart, class-by-category and target-size slices is maintained. An overall upgrade may come from a larger target or may be accompanied by a decline in the recall of a small target. Changes in masked boundaries, thin targets and shielding examples often require a combination of image checks and cannot be reversed from the individual average.

Self-measurement and interpretation

This case box, IoU, why not one in two?

It's two, and it's six instead of four, so it's a third. Can not use only one of the frames as denominators.

The same box IoU is 1/3 and the threshold of 0.5 for NMS must be deleted?

The rules of greed under this chapter will not be discouraged by this pair, since overlaps are below the threshold; Other candidates may still influence the outcome.

A 99 per cent split is a good sign of future recognition?

Can't. (b) The extreme background is superior and the overall background forecast can be high; The outlook IoU, recall and various categories of performance should be checked.

Does semantic division mark both individuals as “persons” equal to examples?

Not equal. The examples are divided by giving an individual identity or a corresponding mask.

Flip image horizontally and the frame retains the original coordinates. What happens?

Input and monitoring are no longer aligned, and models are forced to learn where to go wrong. The labels should be changed in a synchronized manner and subject to visualization tests.

The predictions and true values don't have that kind of perspective. IoU?

The average pay is equal to zero. The evaluation agreement needs to be clearly ignored, agreed value or other strategy, and cannot be temporarily completed without an explanation.

The next step is to compare the different output structures of the same task and then to perform a bug analysis of the fixed assessment set. Top frames, NMS And mask numbers are standard Python Recompilation is performed without training to test or divide models.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
  2. Mask R-CNN
  3. U-Net: Convolutional Networks for Biomedical Image Segmentation

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.