Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0 Release #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

V2.0 Release #24

wants to merge 3 commits into from

Conversation

absolute-heike
Copy link
Contributor

@absolute-heike absolute-heike commented Nov 23, 2021

  • A new model trained with some open source data
  • Migrate API to also be usable on macOS

@@ -48,6 +46,10 @@ The Machine Learning Model is only **17 kB** in size, so App size won't be affec

If you don't want to use the Detection Code, you can also just download the MLModel file directly from the latest [Release](https://github.com/lovoo/NSFWDetector/releases).

## Training Data

V2 uses data out of [NudeNet_v1](https://archive.org/details/NudeNet_classifier_dataset_v1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather link to the project website. Or maybe both?
http://bpraneeth.com/projects/nudenet

public class NSFWDetector {

public static let shared = NSFWDetector()

private let model: VNCoreMLModel

public required init() {
guard let model = try? VNCoreMLModel(for: NSFW().model) else {
guard let model = try? VNCoreMLModel(for: NSFW(configuration: MLModelConfiguration()).model) else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see mostly refactoring work, and this new configuration parameter.
What did I miss, I thought this release is about fixing the Xcode 13 trouble?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This release improves the dataset and makes it iOS agnostic so it can also be run on macOS.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so the tests now run on macOS and therefore don't fail? We still don't know why they fail on iOS though? Are you sure the model works at runtime all the time then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabianehlert shared an Apple Forums link with me once that showed, that Machine Learning on iOS 15 Simulators is broken right now

@@ -58,7 +58,7 @@ class CameraViewController: UIViewController, AVCaptureVideoDataOutputSampleBuff
}

private func didDetectNSFW(confidence: Float) {
if confidence > 0.8 {
if confidence > 0.9 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you arrive at 0.9 here? Experimental? I feel like that's still a bit on the maybe-side and would increase to 0.95.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it depends on the content of course. And for the camera demo I think it works quite great, because most people won't gonna strip completely naked to try it out :D

Upon some "personal testing" I found this version of the model to be suboptimal at detecting male genitals. My guess is that the training data set is biased, because whenever there is a male genital, there is also a woman in the training images.

So I will try it out some more and try to improve it for that use case

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should! That's the use case we're most interested in after all, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's why I tested it ;)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree with @leberwurstsaft – it is the use case for us.
A super small sample of the linked training data also left me with the impression that the model could have a weakness in that regard.

Also, in the nudity files there seem to be a lot of textual overlays in the corners. The model might have a tendency to flag stuff as nude if there is text in a corner. But that shouldn’t be big of a problem as long as it doesn’t influence the amount of false-negatives too.

@koffeingeladen koffeingeladen removed their request for review December 6, 2021 08:00
@abcreationIT
Copy link

I've tried v 2.0 but doesn't work. It gives me every time 0%
Is anyone still working on it or is it a dead project?
Thanks

@hirbod
Copy link

hirbod commented Jun 17, 2022

Is this project still under development?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants