An image sensor comprising a body module, and a lens module and an imaging module installed in the body module, wherein the body module comprises: a correction part, to which shading correction information is settable, adapted for performing shading correction on image data outputted by the imaging module installed in the body module according to the set shading correction information; an acquisition part adapted for acquiring information related to a size of an imaging element in the imaging module installed in the body module and for acquiring light amount ratio information representing a ratio of a light amount at at least two positions on an imaging surface of the imaging element from the lens module installed in the body module; and a generation and setting part adapted for generating shading correction information for correcting shading that occurs in the image data due to the ratio of the light amount based on the information acquired by the acquisition part and for setting the shading correction information to the correction part, wherein the lens module installed in the body module comprises a non-volatile memory, wherein the lens module comprises two types of lens module, wherein a first type of lens module comprises an optical system that does not have adjustable aperture and is not zoomable, and a second type of module comprises an optical system that has adjustable aperture and is zoomable, wherein for the first type of lens module, the values stored in the non-volatile memory comprise an exit pupil position and a peripheral light amount ratio information, and for the second type of lens module, the values stored in the non-volatile memory comprise an exit pupil diameter and position information, a pupil diameter reduction rate information and a plurality of pieces of peripheral light amount ratio information, wherein the generation and setting part is adapted for determining the type of the lens module installed in the body module by determining whether the exit pupil diameter and position information, the pupil diameter reduction rate information, and the plurality of pieces of peripheral light amount ratio information have been stored in the non-volatile memory of the lens module, and wherein the generation and setting part uses the information stored in the non-volatile memory to generate shading correction information corresponding to the type of the lens module installed in the body module. a correction part, to which shading correction information is settable, adapted for performing shading correction on image data outputted by the imaging module installed in the body module according to the set shading correction information; an acquisition part adapted for acquiring information related to a size of an imaging element in the imaging module installed in the body module and for acquiring light amount ratio information representing a ratio of a light amount at at least two positions on an imaging surface of the imaging element from the lens module installed in the body module; and a generation and setting part adapted for generating shading correction information for correcting shading that occurs in the image data due to the ratio of the light amount based on the information acquired by the acquisition part and for setting the shading correction information to the correction part, wherein the lens module installed in the body module comprises a non-volatile memory, wherein the lens module comprises two types of lens module, wherein a first type of lens module comprises an optical system that does not have adjustable aperture and is not zoomable, and a second type of module comprises an optical system that has adjustable aperture and is zoomable, wherein for the first type of lens module, the values stored in the non-volatile memory comprise an exit pupil position and a peripheral light amount ratio information, and for the second type of lens module, the values stored in the non-volatile memory comprise an exit pupil diameter and position information, a pupil diameter reduction rate information and a plurality of pieces of peripheral light amount ratio information, wherein the generation and setting part is adapted for determining the type of the lens module installed in the body module by determining whether the exit pupil diameter and position information, the pupil diameter reduction rate information, and the plurality of pieces of peripheral light amount ratio information have been stored in the non-volatile memory of the lens module, and wherein the generation and setting part uses the information stored in the non-volatile memory to generate shading correction information corresponding to the type of the lens module installed in the body module.