The mechanism of polyimide pyrolysis in the early stage