In order to solve the problems of increasing the computational cost of full-image encryption and the inability of region oc-clusion to determine multiple targets in the existing image protection technology,an image protection framework based on the adaptive mask and generative inpainting was proposed.The framework used Score-CAM(class activation mapping)to adaptively discriminate the core region of the image and accurately generate the multi-target core region mask.The occlusion method was used to protect image privacy to reduce computational overhead.The region-aware CAM loss function was introduced to ensure the consistency of the key ar-eas of the repaired image.The occluded images were sent to the repair network for training,and the trained network parameters were elliptically encrypted.The mask image and the key were sent separately at the sending stage,and decrypted by the key at the receiving end.Then parameters in the Shift-Net were loaded to repair the mask image accurately.The experimental results on the ImageNet data-set showed that the restoration model with CAM loss function improved the structural similarity of the generated image by 0.2%,and reduced the learned perceptual image patch similarity by 0.2%.This study adaptively masked the key areas of the image at the receiving end,rendering the recognition model ineffective and thus protecting the privacy of the image.