Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
In this repository you can find an effective CNN model for detecting NSFW content in images. It achieves a 97.70% accuracy on the pornography-2k dataset. Apart from the provided code you need to reproduce the model, you can also use this model as python module (see below).
First install the python module:
pip install --upgrade nsfwdetection
Then use the model by:
#import the model
from nsfwdetection.model import Model
# initialize the model
net = Model()
# make a prediction
output = net.predict(<imagepath>)
# make multiple predictions
output = net.predict([<imagepath>, <imagepath>])
The model's output is as follows: {'image_path': {'Label': SFW or NSFW , 'Score': 0 to 1 }}
Using the provided code you can retrain the model. Regarding the training/testing data, the corresponding splits are provided in folder "splits". You can find and download the necessary data from here (this is a private dataset, due to its content and you should send a request to gain access - find more info in the link) and here. After downloading the 2 datasets, you should run the
python script1_extract_image_frames.py
to extract the frames from the videos of the pornography-2k dataset and then you can run the
bash train_exps.sh
to start training the model.
As you can see in the following attention maps, the model exhibits high accuracy in terms of the image regions it focuses. (Censored images)
FAQs
An effective CNN for detecting NSFW content in images
We found that NSFWDetection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.