-26

Idea for Stack Overflow and a neural network (NN) application: train a NN to do not allow images with programming code.

It should be very easy to develop. Since the biggest issue is always a training set: just ask Stack Overflow developers to send several printscreens of their code, mix it with the current uploaded images, and you will get data enough to train the NN.

13
  • 15
    Or we can just edit the rare cases where this happens, and not worry about development costs and false positives.
    – Cerbrus
    Commented Feb 6, 2019 at 15:06
  • 18
    Or just downvote and close those insistent on using pics instead.
    – fbueckert
    Commented Feb 6, 2019 at 15:07
  • 3
    Please see How do I present a proposal for change or write a feature request for Stack Overflow?. Your current request lacks a lot of the points expected in a feature request.
    – Erik A
    Commented Feb 6, 2019 at 15:13
  • 2
    We could also change the verbiage on the close message for debugging questions to make it explicit that we don't want images. Simpler than writing/training a NN if you're not in that space.
    – Makoto
    Commented Feb 6, 2019 at 15:17
  • 3
    Of the few people doing this, most are new users and don't have enough rep to post images, so they're just posting links to images of code, not even images of code.
    – Servy
    Commented Feb 6, 2019 at 15:18
  • 4
    .. and then another user will come around and suggest an edit inlining the screenshot. Oh, the humanity.
    – yivi
    Commented Feb 6, 2019 at 15:19
  • 14
    Neural network application very easy to develop Pick one. Commented Feb 6, 2019 at 15:31
  • @Pikamander2 These days it actually is easy to build and train a neural network (many easy to use open source frameworks exist, such as Keras). Making it good for the intended goals and purposes, and choosing the right problems to solve with it, are the hard parts.
    – E_net4
    Commented Feb 6, 2019 at 15:35
  • 6
    @E_net4 Yes, it's easy to make a bad neural network. It's hard to make a good or effective neural network. Given that a poor or ineffective neural network wouldn't be useful, I think Pikamander2's point stands. The "effective" was implied.
    – Servy
    Commented Feb 6, 2019 at 15:43
  • @Servy According to what I stated in the second sentence of my previous comment, it seems that we are in agreement.
    – E_net4
    Commented Feb 6, 2019 at 15:45
  • 6
    @E_net4 I'm just saying it's pointless to respond to someone saying it's not easy to make a neural network to say that making a bad and ineffective neural network is easy. That's not what they're suggesting doing, so saying doing that is easy is just pointless.
    – Servy
    Commented Feb 6, 2019 at 15:47
  • @Servy We're splitting hairs here, but I felt that the short "X Y pick one" comment could use some clarification, especially when "developing" can have an overloaded meaning in this context. The fact that one can fetch a framework and build a neural network is what could have led the OP to thinking that this idea was feasible. It's not like you and me don't know what we're talking about, but adding context is fine for those who don't.
    – E_net4
    Commented Feb 6, 2019 at 16:02
  • The problem I immediately see with this is when there's an error in the code. Screenshots can be helpful for seeing where exactly the IDE is complaining, and what sort of error it is, without having to ask the OP to describe it all. Commented Feb 6, 2019 at 19:44

1 Answer 1

12

At first, I was going to take a passive stance on this feature, since we do have similar automatic Q&A quality mechanisms maintained by the community. One could consider building a bot of your own that does just that to incoming questions.

However, there are multiple concerns here that should step us away from even trying.

As already suggested in the comments, most of the questions with images of code are correlated with question authors who don't know how to ask very well, and as such, images with code will not be the only problem in the question. For one, a question where the code was provided as an image will not have actual code segments. In combination with other heuristics over purely textual information, one can already assess the quality of the question without looking at the contents of the image, with just about as much precision as we could get from image analysis.

Another major concern is that there would be nearly unavoidable false positives when the OP wants to show syntax highlighting or other forms of colored output in the question. In this case, an MCVE would have to include a screenshot of the IDE, terminal, or whatever canvas where the user is showing the obtained outcome. In this case, the image is an output of the program, not the program itself.

This third reason is a bit farfetched, but I'm including it anyway: if it was implemented using a neural network, that could also become a playground for adversarial attacks, leading to someone stubborn enough to try multiple, slightly perturbed images of that code until it's accepted. If this was integrated into Stack Overflow (preventing the question from ever showing up if such an image is detected), it would throttle the system until the question was in. Therefore, this is no longer as simple as building and training a neural network. Defending against adversarial attacks is a heavily researched subject to this day.

As much as I would like to see some magic barriers to keep poor questions away, this approach would not work so well.

1
  • Besides that it's just one small way in which people ask less acceptable questions, this "solution" doesn't really solve any problem even if this somehow can be implemented effectively. I'd rather have a picture than no code at all. Having no code is the actual bad question, having a picture of the code is a bad idea, not necessarily a bad question.
    – Gimby
    Commented Feb 7, 2019 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .