--- title: "Image-Moderation" url: https://docs.catalyst.zoho.com/en/sdk/java/v1/zia-services/image-moderation/ description: "This page describes the method to use the Image Moderation feature to detect vulnerability in images within your Java application with sample code snippets" last_updated: 2026-06-09T07:46:16Z service: Zia Services type: general related_links: - name: "Image-Moderation - API" url: /en/api/code-reference/zia-services/image-moderation/#ImageModeration --- # Image Moderation Image Moderation detects and recognizes inappropriate and unsafe content in images. The criteria include suggestive or explicit racy content, nudity, violence, gore, bloodshed, and the presence of weapons and drugs. You can learn more from the [Image Moderation help page](https://docs.catalyst.zoho.com/en/zia-services/help/image-moderation/introduction). You can provide a ._jpg_/._jpeg_ or ._png_ file as the input. Refer to the [API documentation](https://docs.catalyst.zoho.com/en/api/code-reference/zia-services/image-moderation/#ImageModeration) for the request and response formats. You can set the moderation mode as `BASIC`, `MODERATE`, or `ADVANCED` optionally. The image is processed in the `ADVANCED` mode by default. The response returns the probability of each criteria with their confidence scores, and the prediction of the image being `safe\_to\_use` or `unsafe\_to\_use`. #### Sample Code Snippet **Package Imports** ```java import com.zc.component.ml.ZCAnalyseMode; import com.zc.component.ml.ZCImageModerateData; import com.zc.component.ml.ZCImageModerationConfidence; import com.zc.component.ml.ZCImageModerationOptions; import com.zc.component.ml.ZCImageModerationPrediction; import com.zc.component.ml.ZCML; import java.io.File; ``` ```java File file = new File("{filePath}"); //Specify the file path ZCImageModerationOptions options = ZCImageModerationOptions.getInstance().setAnalyseMode(ZCAnalyseMode.ADVANCED); //Set the moderation mode ZCImageModerateData imData = ZCML.getInstance().moderateImage(file, options); //Call moderateImage() with the input file and options ZCImageModerationPrediction prediction = imData.getPrediction(); //To get the final prediction Double predictionConfidence = imData.getConfidence(); //To get the confidence score of the final prediction List confidences = imData.getImageModerationConfidenceList(); //To get the confidence scores of each criteria predicted ```