Why do we need to construct Gaussian pyramid using SIFT detector I am learning about SIFT detection and descriptor. I am slightly unsure about why a Gaussian pyramid is built for the image.

I do understand that within each octave, we are applying the Difference of Gaussian filter at different scales to the image and finding for each pixel location, whether it is a local maxima. We do this also for the image at a smaller scale. So now we have marked out the pixels in two different scales of image that have local extrema values.
What do we do with the local extrema values in these 2 different scales ? Do we compute SIFT descriptors at the 2 different sizes of image ?
Actually, the purpose of all this is to approximate a Laplacian of Gaussian!
This computation is part of the corner detection of SIFT. You can find corners by examining extrema of the Laplacian of Gaussians (2nd order derivative). You use Gaussians for denoising, and a Laplacian to find inflection points. However, it is classical to not deal directly with computing this second order derivative, but to approximate it instead by difference of Gaussians for simplicity. This is sometimnes referred to as Gaussian blob detection.
You can find some illustration of this process here.
With this approach your difference of Gaussians (DoG) will have a fixed (small) size in pixels, so you're bounding the computational cost. But you still want to detect blobs of different sizes (because objects have varyng size,s, and the camera can be closer or further away from the scene), and you achieve this by &quot;zooming out the image&quot; with the various scales of the pyramid and keeping the DoG size fixed, instead of keeping the original image size and changing the size of your blob detector.