##DoxDetect - AI-Powered Image Redaction Tool
** Won 1st Place Overall & 1st Place AI Track at BellHacks Bay Area Hackathon**
This project is an open-source desktop application that uses AI to automatically detect and redact Personally Identifiable Information (PII) from images. It was developed for the BellHacks hackathon and is distributed under the GNU General Public License.
Want to see a demo? If you don't have an OpenAI API key, you can watch a video of the app in action by clicking the link below!
DoxDetect scans images for sensitive info like names, dates, and ID numbers using Optical Character Recognition (OCR). It then uses the OpenAI API to determine if the text is sensitive and asks for user confirmation before redacting it with a powerful Gaussian blur.
- Python
- OpenAI API (GPT-3.5)
- OpenCV
- EasyOCR
- Tkinter
These instructions will get you a copy of the project up and running on your local machine.
You need to have Miniconda or Anaconda installed on your system. This is required to create a stable environment for the machine learning libraries.
You absolutely need a valid OpenAI API key for this application to work.
-
Clone the repository:
git clone https://github.com/krcoder123/DoxDetect-Redaction-Tool cd DoxDetect-Redaction-Tool -
Create the Conda Environment: This command creates an environment named
doxdetectwith the correct Python version and installs the most complex libraries.conda create --name doxdetect python=3.11 pytorch torchvision -c pytorch
-
Activate the Environment:
conda activate doxdetect
-
Install Remaining Dependencies: Use
pipto install the rest of the required packages.pip install easyocr openai opencv-python Pillow
(Note for macOS users: The
(doxdetect)environment should now be active. If you still encounter GUI errors, install thepython.apppackage withconda install python.app.) -
Set Your OpenAI API Key: Set you OpenAI API Key as an environment variable in your terminal session.
- For macOS/Linux:
export OPENAI_API_KEY="paste-your-secret-key-here"
- For Windows (Command Prompt):
set OPENAI_API_KEY="paste-your-secret-key-here"
- For macOS/Linux:
Once the environment is set up and your API key is configured, you can run the application.
-
For macOS/Linux: Use the
pythonwcommand to launch the GUI application.pythonw antidox.py
-
For Windows: Use the standard
pythoncommand.python antidox.py
Click the "Upload Image" button to select an image from your computer. The application will then process it and prompt you to confirm any redactions. Please check your terminal To see what is being read and what is considered sensitive information.
You can adjust the blur's intensity by changing the kernel size in the antidox.py script. The kernel size must be a pair of positive, odd integers (e.g., 51, 99, 101, 299).
Modify the '(101, 101)' parameters in the following line to achieve your desired effect:
roi = cv2.GaussianBlur(roi, (101, 101), 0)