Preheat oven to 350°F. Line 24 muffin cups with paper liners.
In the bowl of an electric mixer fitted with the paddle attachment, beat sugar, oil, and eggs at medium speed for 1 minute.
Add the carrots and all the dry ingredients to the egg and oil mixture and beat until all ingredients are incorporated. Add the walnuts and mix.
Scoop batter evenly into muffin tins 2/3 full (1/4 cup) and bake for 25 minutes or until golden brown and a toothpick inserted in the middle comes out clean.
Prepare the cream cheese frosting. In the bowl of an electric mixer fitted with the paddle attachment, beat cream cheese, butter, and vanilla until smooth. Slowly add powdered sugar and mix until well incorporated.
Allow cupcakes to cool completely before frosting. Garnish with chopped walnuts.