
TEXT MINING - DATA
AI ART - ART
NEURAL NETWORKS
This is the final part of the semester project analyzing AI and ART text data sourced from Reddit and News APIs. This is mod 4: Neural Networks!
Neural NETWORKS
Neural networks are another supervised learning model (meaning: it sees labelled data) built from layers of simple processing units (“neurons”) that together learn to map input features (here, word-count vectors) to output classes (“AI Art” vs. “Art”).
Each neuron holds a small set of parameters (weights and biases) that are tuned during training. Training proceeds in what are called epochs, where in each epoch the network completes one full pass over each document in the training set, measures its loss (how far its predictions diverged from the true labels), and then returns to adjust those parameters to try again. An epoch is done once it has seen each data point in the training sample once. The epoch accuracy is tracked alongside loss to show what fraction of examples the network classifies correctly. The total number of parameters can be used to infer the model’s capacity to learn complex patterns (more parameters means it has a greater capacity, but more also brings with it a higher risk of overfitting). Over a series of epochs, a well-tuned neural network will see its training loss fall and its accuracy rise, while validation loss and accuracy reveal how well it generalizes to the testing data.
https://learnopencv.com/understanding-feedforward-neural-networks/
These line plots show how in the first few epochs both the loss (how wrong the network’s predictions are) and accuracy (the percentage of correct guesses) improve gradually while going over the training data—the loss drops from around .70 to .23, while accuracy climbs from about 55% to 92%.
The validation curves (which come from the test datasets) seem to follow a similar trend until about epoch 3 when validation loss bottoms out at roughly 0.4 and then creeps up, while validation accuracy plateaus near 84–85%.
This indicates overfitting, meaning the network is rapidly learning distinguishing features, but after a while it started fitting noise rather than truly meaningful data points.
the feed-forward model demonstrated that a straightforward two-layer architecture (we can see this in the table: 128 neurons, dropout -> 64 neurons, dropout -> a single sigmoid output) can use my data to reliably distinguish AI-generated art posts from human-made art posts about 84 % of the time. In visualizing the training and test/validation loss/accuracy side by side, I was able to see how it overfit to noise in the data after epoch 4, in how the validation loss started to increase soon after. n practical terms, this tells us that the network picked up on strong cues—buzzwords and n-grams closely tied to the class labels—while at the same time occasionally fitting noise in the training set once its capacity was exhausted.
precision and recall metrics paint a nuanced picture: the network is slightly conservative in flagging AI art (precision of .81), but excels at finding nearly 87 % of those posts when they are present. on the other hand, my NN labels pure art docs correctly 86 % of the time. This is in line with previous methods of analysis on this data: there is something particulalry unique in the AI art data making it comparatively easier to distinguish from art text content. Conclusively: These patterns which are popping up across all the methods of natural language processing together suggest that while AI-specific terminology is powerful for detection, ordinary art discussions can slip through the cracks because it lacks targeted or specific enough trends and features.
This is a straightforward “feed-forward” network: its layers flow one into the next (sequential).
The first Dense layer learns 128 internal features from the original 500 features count vectorized dataset. then, it passes it’s 128 outputs into a Dropout layer that randomly silences half those neurons each batch—this regularizes the network so it doesn’t simply memorize the training examples. Next, the network passes through a smaller layer of 64 neurons, where it briefly will “drop out” (ignore) about 30% of them at random so it doesn’t learn to depend on any one pathway. At the very end, one neuron produces a single number between 0 and 1—that number is its confidence that the text belongs to the “art” class (closer to 1 means “art,” closer to 0 means “AiArt”).
The total params is every weight and bias feature the model can adjust when it runs—because all 72,449 of those parameters are trainable, each one will shift slightly during training to minimize the network’s loss.
The NN managed to get 101 true AiArt documents correctly flagged, 15 AiArt documents missed and falsely called art. Generally, it seems to have picked up on some meaningful signals and predicts correctly at a rate of 84%. the model errs a bit more often by mistaking ordinary art for AI art than by missing AI pieces entirely.. It might be that the 15 misclassified AIart posts are missing particular keywords, or that the 23 art posts are of generic digital-art language, or maybe have some key feature overlaps with AI terminology.
All supervised models require labeled, numeric inputs and clear train/test split so that performance reflects true generalization. The dataset was countvectorized, and then split into a train/test sets: completely disjoint datasets where one will be the vast majority of the data, for the model to train and get familiar with so it can uncover relationships between features and labels. If the model ever “sees” a test example during training, its test‐set accuracy would be inaccurate, as it would have memorized the label rather than discovered it through its learning.. It was also encoded such that the word labels AIArt and art were translated to 0 and 1 respectively. This is a binary classification problem, so the final sigmoid neuron outputs a value between 0 and 1 corresponding to the predicted probability of belonging to the “art” class.