Part 8 of 12: Inside a Tesla Previous: The Chip in the Glovebox: Tesla's FSD Computer (HW3, HW4, AI5) Next: Tesla Occupancy Network: Seeing Things It Has No Name For
All 12 parts
- Inside a Tesla: A Computer That Happens to Have Wheels
- One Casting Instead of 70 Parts: Tesla's Giga Press
- Building a Car in Pieces: Tesla's Unboxed Process
- The Battery Is the Floor: Cells, Chemistry and the Structural Pack
- Fewer Wires, One Valve: Tesla's Electrical and Thermal Design
- Eight Cameras, No Radar: How a Tesla Sees
- The Chip in the Glovebox: Tesla's FSD Computer (HW3, HW4, AI5)
- Tesla HydraNet and Bird's-Eye View: From Eight Cameras to One Map
- Tesla Occupancy Network: Seeing Things It Has No Name For
- From Hand-Written Rules to One Network: How FSD Plans
- The Data Engine: How Tesla Teaches the Car
- Robotaxi: A Car With Nobody in the Driver's Seat
Tesla’s engineers once had a parking lot problem. Smart Summon, the feature that drives a parked car to its owner, needs to see curbs. The curb detector looked great on every camera image. Red and blue lines sat right on the curb edges. Then they placed those lines on the ground, which is where a car has to drive, and the picture fell apart. The lines wobbled, bent and drifted. In the words of the engineer showing it, you could not drive on that.
They showed it at Tesla AI Day on 19 August 2021, about 57 minutes into the video. The fix was not a better curb detector. It was a different place to make the prediction. Instead of guessing in each camera’s picture and joining the guesses afterwards, Tesla built one network that looks at all eight cameras together and draws the answer straight onto a top-down map.
This post follows one set of eight camera frames through that network, one step at a time. I read the captions of the whole vision section of the AI Day talk and of Karpathy’s CVPR talk two months earlier, and I checked the public papers that do the same job. For each step I say what is Tesla’s own description and what is general technique.
Part 8 of Inside a Tesla. I like the car and the tech, so I researched it to feed my own curiosity; not affiliated with Tesla, not investment advice.
Short version:
- Tesla says a network that predicts in each camera’s image, then stitches the results, failed, mainly because it needs near-perfect depth for every pixel to reach the ground, and one car can be split across five of the eight cameras. So the network takes all eight frames and outputs positions around the car directly.
- The 2021 recipe, in Tesla’s words: warp every frame into one virtual camera, extract features (RegNet, BiFPN), let a transformer move them into a top-down grid, keep a memory in time and in distance, then read the result with many small task heads. The shared body and many heads is what Tesla calls a HydraNet.
- The transformer step has public cousins: Lift-Splat-Shoot (2020), DETR3D (2021) and BEVFormer (2022). They solve the same problem, but they pick where to look in a different way, and Tesla has not published its own code, weights or benchmark scores for this network.
How I label things
Four labels run through the post:
- Tesla says: from Tesla’s talks, which I read as captions of the official videos. These are claims, shown on Tesla’s own clips.
- Regulator: a US safety agency’s own document.
- Outside analysis: papers, teardowns and write-ups by other people.
- General technique: an idea from public research that Tesla may or may not use in this exact form.
Everything about Tesla’s design below comes from 2021 talks: Karpathy’s CVPR keynote on 20 June 2021 and AI Day on 19 August 2021. Tesla has described other designs since, and the next parts cover them. This post is what Tesla described in 2021, not a blueprint of the car today.
The trip in eight steps
Here is the whole route. The rest of the post takes one box at a time.
Karpathy’s own summary at 1:11 in the AI Day video lists the same chain: rectification, RegNets, BiFPN, a transformer into vector space, a feature queue in time or space, a video module such as a spatial RNN, then the branching HydraNet with trunks and heads. “Vector space” is Tesla’s name for the output. It means positions and shapes of things around the car, not pictures. Kimbo Chen’s notes on the talk are a good second read of the same chain (outside analysis).
A neural network in one paragraph
A neural network is a stack of layers. Each layer takes numbers in, multiplies them by other numbers called weights, and passes the result on. The weights start random. Training shows the network many examples with the right answers and nudges the weights to shrink the error. A feature is one of those intermediate numbers: it says how strongly some pattern shows up at one place. Stanford’s CS231n notes describe it for images: the first layer responds to edges and colour blobs, and deeper layers respond to larger patterns built from those.
A picture goes in, a stack of layers builds up patterns from small to big, and something at the end reads off an answer. Tesla’s network is a much bigger version of this, with extra steps for eight cameras and for time.
Step 1: the backbone turns pixels into features
Karpathy described the input at AI Day as a 1280 by 960 image of 12-bit numbers, arriving at roughly 36 Hz. If all eight cameras ran at that size, the network would face 1,228,800 pixels times 8 cameras times 36 frames. That is about 354 million pixels every second, or 4.25 gigabits per second of raw values (my arithmetic, not Tesla’s). In 2022 Tesla said it feeds the network these raw 12-bit values and skips the usual image-processing chip, to save time (AI Day 2022, about 1:14 in).
The first job is the backbone: the part that turns pixels into features. Tesla says it uses residual networks, a design from 2015 where each block adds its result to its input so that very deep stacks can still be trained (He et al.). The specific family is RegNet, from a 2020 paper that designed whole families of simple networks instead of one hand-tuned network (Radosavovic et al.). Tesla’s reason: RegNets let you trade speed against accuracy cleanly. In 2019 the same engineer had described the backbones as “ResNet-50 like” (PyTorch conference, Oct 2019), so the backbone had changed by 2021.
The backbone hands out features at several scales. Tesla says the bottom of the stack has high resolution and few channels, so its neurons scrutinise detail. The top has low resolution and many channels, so its neurons see most of the image and its context. A BiFPN (weighted bi-directional feature pyramid network, from the 2019 EfficientDet paper) lets the scales talk to each other.
Tesla’s example is a good one. A neuron looking at a small patch cannot tell whether it is seeing a car. The top of the stack can tell that the patch sits at the vanishing point of a highway. After the BiFPN mix, the small patch knows that too, and a car becomes the likely answer.
So far this is one camera and one task. Tesla needs many tasks. Running a whole backbone for each one would not fit in the car.
Step 2: HydraNet, one body and many heads
Karpathy told the story at AI Day. The team wanted to find cars, but also read traffic lights, predict lanes, find curbs and more. Very quickly they converged on one shared backbone that branches into many heads. “We call these therefore HydraNets,” he said, “these are the heads of the Hydra.” The name is older than that talk. He used it at the PyTorch conference in October 2019, when he said there were almost 100 tasks and that Tesla could not afford a network for each. Lance Martin’s write-up of Tesla’s talks reads the branching structure as essentially unchanged since then (outside analysis).
Tesla gave three reasons for the layout.
- Pay once. Features are shared, so the cost of the forward pass is shared too. One backbone per task would mean a lot of backbones in the car.
- Change one head. Each task can be worked on alone. You can change a dataset or a head without touching the others, so you do not have to revalidate every other task. Checks are the expensive part.
- Cache features. Tesla says it does a full end-to-end training run once in a while, saves the multi-scale features to disk, and then fine-tunes only the heads from those features for a while.
By the CVPR talk in June 2021 the layout had grown: heads branch into trunks, which branch into terminals. Karpathy said about 20 people were training neural networks full time, all cooperating on a single network. The branches are how 20 people avoid stepping on each other.
Here is the cost saving as arithmetic. Say the backbone costs B, and each head costs h. With 100 tasks and a shared backbone, the car pays B plus 100h. With a backbone per task, it pays 100 times (B plus h). Backbones are the big part, so the gap is large. The numbers are made up. The shape is the point.
Tesla’s 2019 figures show how much was at stake. Karpathy said then that a full Autopilot build trained 48 different networks that made 1,000 different predictions (counting output tensors) and took 70,000 GPU hours. On a single 8-GPU machine, that is about a year.
That covers the heads. It does not say where the heads should look. And Tesla found that the obvious answer, one camera at a time, did not work.
Why one camera at a time failed
The obvious design is to let each camera make its own predictions and join them afterwards. That is how Tesla did it at first. For Smart Summon it even wrote a C++ program, the “occupancy tracker”, to stitch curb detections across cameras and over time. Tesla named three problems.
First, tuning that tracker by hand was very hard. Tesla wanted that logic inside the network, trained together with everything else.
Second, “the image space is not the correct output space.” A prediction that looks right in the image has to be cast onto the ground to be useful. That needs an extremely accurate depth for every pixel, and it fails where the road is hidden, because a hidden spot has no pixel to predict from.
Here is why depth is so touchy. Take a camera 1.5 m above a flat road. Suppose each pixel covers 0.04 degrees, which is about what 1280 pixels spread over a 50 degree view would give. This is my illustration with assumed numbers, not Tesla’s camera:
| Ground point | Road covered by a one-pixel error |
|---|---|
| 30 m away | about 0.4 m |
| 60 m away | about 1.7 m |
| 100 m away | about 4.9 m |
A line that is right to the pixel in the image can be metres off on the ground, and a road that slopes makes it worse. Pseudo-lidar, an idea from Wang et al. (2018), predicts a depth for every pixel and lifts the pixels into 3D points. It is a clean idea. In my reading it runs into the same sensitivity. Tesla did not name pseudo-lidar at AI Day.
The third problem is cameras that overlap. Karpathy showed a car that spans five of the eight cameras. No single camera sees all of it, so each makes a poor guess, and the guesses are hard to fuse.
Karpathy’s idea was simple to say. Take all the images, feed them into one network at once, and output straight into vector space. He called it “very easily said and much more difficult to actually achieve”. It needs two things: a network part that moves features from image space into the top-down space and can be trained end to end, and labels that live in the top-down space too, because labelling images alone will not get you there. The first part comes next. The second is at the end of this post.
Step 3: rectify to one virtual camera
Every car is slightly different. Cameras are bolted on a little off. Karpathy’s words for it: the cars are “slightly cockeyed in a slightly different way”. A network that turns image features into map positions has to know where each camera points. You could just feed the calibration numbers in next to the image. Tesla says it found something that works much better.
It warps every image into one synthetic virtual camera, using a rectification transform that depends on that car’s calibration. The layer sits just above the usual image rectification layer. After it, the same scene lands in the same place in the image, whichever car took it.
Tesla’s test is easy to picture. Average many images from the rear-facing side cameras. Without the warp you get a blur, because each car’s camera sees the mirror in a slightly different spot. With it, the rear-view mirror comes out crisp. Karpathy said the layer “improves the performance quite a bit”. Tesla gave no number for it.
Tesla gave no formula either. The standard geometry is simple, though. If two cameras differ only by a small turn, one image becomes the other with a fixed 3 by 3 matrix built from the camera’s internal settings and that turn. That is general geometry and my explanation, not something Tesla showed. A year later the AI Day 2022 talk said the first step of its occupancy network is to rectify each camera image using the camera calibration, so the idea was still there.
Every image now sits in the same frame of reference. The next step is the one the post is named for.
Step 4: queries move features into a top-down grid
Here is the problem. A cell on the top-down map, say a patch of road 12 m ahead and 3 m to the left, needs evidence. Where in the eight images is that evidence?
You could project the cell into each camera using the calibration. Tesla says that is hard to get right, for two reasons. The projection depends on the road surface, which can slope up or down. And it depends on the data: if a car blocks the view, the useful evidence is somewhere else in the image. A fixed formula cannot know that.
So Tesla used a transformer: a network part built from attention, an idea from the 2017 paper Attention Is All You Need. Tesla’s description, in four steps:
- Make an empty raster the size of the output space you want.
- Tile it with sine and cosine position codes, and pass them through a small network (an MLP) to make a query for each cell.
- Every piece of every image produces a key and a value. In Karpathy’s words, the key says “I’m part of a pillar in roughly this location and I’m seeing this kind of stuff”. Each query says, roughly, “I’m a pixel in the output space at this position and I’m looking for features of this type.”
- Queries and keys are multiplied. The better a key matches, the more of that piece’s value is pulled into the cell.
Tesla called this multi-headed self-attention and said a single block does much of the work. Since the queries come from the output grid and the keys and values come from the images, most papers would call this cross-attention. That is a naming note from me.
Here it is with made-up numbers, for one cell and three image patches. A key that matches the cell’s query well gets a high score, and softmax turns the scores into weights that add up to 1:
import math
scores = [2.1, 1.2, 0.2] # query . key for patches A, B, C
exps = [math.exp(s) for s in scores]
weights = [e / sum(exps) for e in exps] # softmax
print([round(w, 2) for w in weights]) # [0.64, 0.26, 0.1]
I ran that, and the weights are the ones in the picture. The network learns, from labelled examples, what to put in the queries and keys. Nobody writes down where to look. When a car blocks the view, the keys on the blocked patch no longer match, and the cell looks elsewhere.
Tesla showed the result as before and after. Predictions made by one multi-camera network, directly in vector space, were what Karpathy called “basically night and day”: “you can actually drive on this”. Single-camera predictions of cars were poor when only a sliver of the car was visible, and the multi-camera network struggled far less.
Those are Tesla’s own clips. Tesla gave no benchmark score for this network. For numbers, you have to look at the public cousins.
The public cousins, and who came first
Three public papers do the same job, and one of them is close in shape to what Tesla described.
- Lift-Splat-Shoot (Philion and Fidler, Aug 2020). General technique. It “lifts” each image into features spread across possible depths, “splats” them onto a shared top-down grid, and its “shoot” step scores driving paths on the result. It uses the camera calibration to place features in 3D. It keeps a spread of depths for each pixel instead of one guess, which in my reading softens the depth problem above.
- DETR3D (Wang et al., Oct 2021). General technique. A set of 3D object queries is projected into each camera image with the camera matrices. Each query predicts one box.
- BEVFormer (Li et al., Mar 2022). General technique. Grid-shaped queries, one per top-down cell, gather features from the images and from the previous moment. It is the closest public match to the design Tesla described, and the figure below shows its encoder.
A 2022 survey by Ma et al. sorts this whole family of methods and compares their results (outside analysis).

Figure 2 from Li et al., “BEVFormer” (ECCV 2022, arXiv:2203.17270), CC BY 4.0. I cropped out the six sample camera photos on the left of the original figure. This is a public research model, not Tesla’s.
Timing matters here, so here are the dates. Karpathy said at CVPR in June 2021 that a transformer fuses the eight views. AI Day was on 19 August 2021. BEVFormer’s first version came on 31 March 2022, about seven months later. Its paper does not mention Tesla. I searched its source files for the word and found nothing. Who had the idea first, nobody outside Tesla can say. Same problem, same tools, similar answers is the safe reading.
The two designs differ in one important way, and it comes back to rectification.
| Design | How a top-down cell finds its evidence | Uses calibration at run time? |
|---|---|---|
| Lift-Splat-Shoot (public) | Each pixel guesses a spread of depths, and calibration places them in 3D | Yes |
| DETR3D (public) | 3D queries are projected into each image with the camera matrices | Yes |
| BEVFormer (public) | Four heights at each cell (-5 m to 3 m in the paper) are projected into the cameras, and features are sampled around those points | Yes |
| Tesla, 2021 (Tesla says) | Position-coded queries and keys, with attention deciding where to look. Calibration is handled earlier by the virtual camera | In the warp, before the transformer |
BEVFormer’s authors tested what happens when the camera extrinsics (the camera positions and angles) are wrong. At their noise level 4, BEVFormer’s score dropped 14.3 percent. A variant that uses plain global attention, and so does not use extrinsics to choose where to look, dropped 4.0 percent. That is a result on a public dataset about a public model. It does not say anything about Tesla’s network. It does show why handling calibration in a separate, early step is a reasonable choice.
BEVFormer’s size is public, and it gives a feel for the scale. On nuScenes its default grid is 200 by 200 cells of 0.512 m, so 40,000 queries covering about 102 m by 102 m, with 6 encoder layers. Tesla did not say how big its grid is. The paper reports a nuScenes detection score of 56.9 percent on the test set, which its authors say is 9.0 points above the previous best and on par with lidar-based methods. nuScenes is a different data set, and the paper’s figure shows six cameras, not eight.
The top-down map is a snapshot of one moment. A car also needs to know what happened a second ago.
Step 5: memory in time and in distance
A single moment misses things. Karpathy listed the questions a snapshot cannot answer. Is this car parked or moving? How fast? Is it still there although it is hidden for a moment? What was on the sign I passed 50 m ago? Tesla added a feature queue that caches the top-down features, together with the car’s own motion (its speed and acceleration, which Tesla calls kinematics), and a video module that reads it.
The tricky part is when to add to the queue. Karpathy gave two rules.
- By time: push an entry every so often. His example was every 27 milliseconds. If a car is hidden for a moment, the network can look back and remember it.
- By distance: push every time the car has travelled a fixed distance. The captions say only “a certain fixed distance”, with no number. If you only had a time queue, you could forget the lane markings and signs while waiting at a red light.
The 27 ms is an example from the talk. It is close to one entry per camera frame (1 divided by 36 Hz is 27.8 ms), which is my observation.
The video module is the next piece. Tesla says it looked at 3D convolutions, transformers, axial transformers and several recurrent networks. It liked a spatial RNN. The idea: the car drives on a flat surface, so the memory can be a 2D grid laid out like the road. As the car moves, its motion shifts the grid. Only cells near the car, with a good view, are updated. A car parked right beside you hides part of the road, so the network can choose not to write there, and write when the view clears. Karpathy showed channels of this memory that tracked road centres, edges, lines and surface, and called it a sort of HD map built from features instead of from explicit objects.
BEVFormer does something similar in spirit. It aligns the previous top-down features to the current ones by the car’s motion and lets each cell look at both (that is outside analysis, my reading of the two designs).
Tesla’s results for this step, from its own clips: a car that is briefly hidden stays in the output, where the single-frame network drops it. And in a clip from the push to remove radar, the video module gave much better depth than a single frame, and its velocity was, in Karpathy’s words, “basically right on top of the radar signal”. A single frame cannot give velocity, so there Tesla differentiated depth.
What Tesla said it trained on
Everything above needs labels in the top-down space, not in the image. Karpathy said it plainly: if you want vector-space predictions from the network, you need vector-space data sets. Here are the numbers Tesla gave in 2021:
Read it with care. Each bar counts a different thing, and the two talks used different slices of the work, so do not add them up. Two examples of what the numbers mean: 6 billion objects across 1 million clips is about 6,000 labelled objects per clip, and 10 billion labels over 2.5 million clips is about 4,000 (my arithmetic). At CVPR, Karpathy said the one million clips are roughly 10 seconds each. At AI Day, Ashok Elluswamy said clips to be auto-labelled can be 45 seconds to a minute long, so the 2.5 million clips are not necessarily that short. At CVPR he also described a data set of about 1.5 petabytes and a new training cluster of 720 nodes of A100 GPUs, which he estimated would rank around fifth among supercomputers by raw compute. Those are Tesla’s claims.
The hard part
Tesla’s own list. At the end of the vision section, Karpathy listed what was not ideal. Time and space were fused fairly late in the network, and earlier fusion might be better. The outputs were dense rasters that were expensive to post-process in the car, under a strict time limit. The team was looking at predicting only the sparse structure of the road. In his words, “this architecture has definitely complexified” from a simple single-image network three or four years earlier.
What is not in the talks. In the vision section I found no parameter counts, no per-stage latency, no grid size and no queue length. There is no benchmark score for this network, only Tesla’s clips. The public cousins have numbers on public data sets. Tesla’s version has none that outsiders can check.
A blind camera. Fusing eight cameras does not help if one of them cannot see. This is where Tesla’s claims and a regulator’s file sit next to each other:
| Topic | Tesla says | Regulator |
|---|---|---|
| Cameras only | In a 2021 radar-removal clip, the video module’s velocity tracked the radar closely | NHTSA’s resume for investigation EA26002 (opened 18 March 2026) says FSD “relies exclusively on vision-based cameras and the related FSD software”, and dates the move to Tesla Vision to mid-2021 |
| Bad visibility | No claim in these talks | NHTSA says it is evaluating whether FSD’s degradation detection system warns the driver in time in reduced visibility such as glare and airborne obscurants. Its estimate: 3,203,754 vehicles, 9 crashes in the summary, one fatal |
| Tesla’s own analysis | No claim in these talks | NHTSA writes that Tesla’s post-incident analysis indicated the update to the degradation detection system, “had it been installed on the vehicles at the time, may have affected 3 of the 9 incidents” |
That investigation is about whether the car notices that its cameras are degraded. It does not test the HydraNet design above, and an opened investigation is not a finding that a defect exists. But it does show where the design’s limit is: the network can only fuse what the cameras give it.
Calibration. The virtual camera depends on each car’s calibration being right. Tesla’s talks do not say what happens when it drifts. BEVFormer’s test above is a hint that it matters, not an answer for Tesla.
Questions people ask
What is Tesla’s HydraNet? A neural network with one shared backbone that feeds many separate output heads, one set per task such as cars, lanes, curbs or traffic lights. Tesla says the sharing saves compute, lets teams change one head without retesting the others, and lets it retrain heads from saved features. Karpathy used the name by October 2019.
Does Tesla use a bird’s-eye view? In 2021 Tesla said it predicted directly in a top-down “vector space” by moving features from all eight cameras there with a transformer. Karpathy used the words “bird’s eye view prediction” in the talk. In 2022 Tesla described its occupancy network with the same ingredients: rectified images, RegNet and BiFPN features, and 3D position queries attending to image features. Whether today’s car runs exactly this, Tesla has not said.
Is Tesla’s approach the same as BEVFormer? They are close cousins, not copies as far as anything published shows. Both use grid queries and attention over image features, and both keep a memory over time. BEVFormer projects points into the cameras with calibration to choose where to look. Tesla described learned attention after a calibration-based warp. BEVFormer was published seven months after AI Day.
Why does Tesla warp camera images into a virtual camera? Each car’s cameras are mounted slightly differently. Warping every image to one common virtual camera means the network sees the same geometry in every car, instead of having to learn each car’s calibration. Tesla says this improved performance quite a bit.
Why not just predict depth for every pixel? Tesla says that needs extremely accurate depth for every pixel, and hidden areas have no pixel to predict from. A small depth error far away becomes metres on the ground, as the table above shows with assumed numbers.
Cheat sheet
Next: a top-down map with labelled boxes, lanes and curbs still has a hole. It only knows what is on its list. A pile of tyres, a ladder in the road, a truck on its roof: what does a network do with something it has no name for? The next part looks at what Tesla showed in 2022, where the network stops naming things and asks a plainer question about every small cube of space around the car.
Further reading
Tesla talks (claims, shown on Tesla’s own clips):
- Tesla AI Day 2021, the vision section starts at about 48:44
- Andrej Karpathy, CVPR 2021 Workshop on Autonomous Driving keynote, 20 June 2021
- Andrej Karpathy, “PyTorch at Tesla”, October 2019
- Tesla AI Day 2022, the occupancy network from about 1:12
Regulator:
- NHTSA ODI resume, investigation EA26002, “FSD Collisions in Reduced Roadway Visibility Conditions”, opened 18 March 2026
Papers (general technique):
- Deep Residual Learning for Image Recognition (ResNet), 2015
- Designing Network Design Spaces (RegNet), 2020
- EfficientDet: Scalable and Efficient Object Detection (BiFPN), 2019
- Attention Is All You Need, 2017
- End-to-End Object Detection with Transformers (DETR), 2020
- Lift, Splat, Shoot, 2020
- DETR3D, 2021
- BEVFormer, 2022
- Pseudo-LiDAR from Visual Depth Estimation, 2018
- Stanford CS231n: convolutional networks
Outside analysis:
- Kimbo Chen, “Tesla AI Day - Vision”, a write-up of the 2021 talk
- Lance Martin, “Tesla’s arc of AI progress”
- Ma et al., “Vision-Centric BEV Perception: A Survey”, 2022