Preheat oven to 350°F (175°C). Grease and line two 9-inch round cake pans with parchment paper.
Whisk together flour, baking soda, cinnamon, nutmeg, ginger, and salt in a large bowl.
In a separate bowl, whisk vegetable oil, granulated sugar, and brown sugar until smooth.
Add eggs one at a time to the wet mixture, beating well after each addition. Stir in vanilla extract.
Gradually fold the dry ingredients into the wet ingredients until just combined.
Fold in freshly grated carrots and optional walnuts or raisins.
Divide batter evenly between prepared pans and smooth the tops.
Bake for 30–35 minutes until a toothpick inserted in the center comes out clean.
Cool in pans for 10 minutes, then transfer to a wire rack to cool completely (approximately 1 hour).
Beat softened cream cheese and butter together until smooth and fluffy.
Gradually add sifted powdered sugar, mixing on low speed.
Add vanilla extract and a pinch of salt, then beat on medium-high until light and airy.
Place one cooled cake layer on a serving plate and spread frosting evenly on top.
Place the second layer on top and frost the top and sides of the entire cake.
Garnish with crushed walnuts, a dusting of cinnamon, or marzipan carrots as desired.
Slice and serve. Store leftovers in the refrigerator for up to 5 days.