In 1854 the show of Western naval force by American Commodore Perry led to the Convention of Kanagawa and the opening of Japan to western trading. Senzai Maru’s 1862 journey to Shanghai taught Japan the danger of closing off its borders and refusing to change. In the long run it stimulated an expansion of horizons and the need to learn from the outside world. Japanese leaders realized it needed to modernize to avoid the humiliation suffered by China during the First and Second Opium Wars in the 1840s and 1850s. From these lessons, Japan transitioned from isolationism to reformist. After old Tokugawa shogunate was overthrown during the Meiji Restoration in the 1850s Japan initiated structural reforms resulting in rapid modernization, industrialization, militarization and imperialism modeled after the imperialistic Western powers.