Preheat the oven to 350°F (175°C) and grease two 9-inch cake pans.
In a mixing bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
In another bowl, beat the granulated sugar, brown sugar, and vegetable oil until well combined.
Add the eggs and vanilla extract to the wet ingredients, mixing until smooth.
Gradually add the dry ingredients to the wet mixture, stirring until just combined.
Fold in the grated carrots, walnuts, and raisins (if using).
Divide the batter evenly between the prepared cake pans and smooth the tops.
Bake for 30-35 minutes, or until a toothpick inserted in the center comes out clean.
Let the cakes cool in the pans for 10 minutes before transferring to a wire rack to cool completely.
To make the frosting, beat the softened cream cheese and butter until smooth.
Gradually add the powdered sugar and vanilla extract, beating until light and fluffy.
Frost the cooled cakes and decorate as desired.
Chill for 20 minutes before slicing and serving.