Categories
Uncategorized

the final push

We are ending near the end of the term, or in other words, the development phase. While this ten-week, two sprint phase was considerably productive, our team on the top-n music genre classification neural network project still has lots to get done.

At the beginning of the term, our team created a development plan to set our goals for our ten-week span. The plan was straightforward. “The alpha version of the Top-n Neural Network must be able to classify a single
audio clip by genre as accurately as possible.” Our project could be seen as a similarly to a mathematical function, which takes an input, and give an output. The input for our project is simply a song followed by the output of its genre.

Not included in the alpha are any of the ‘UI’ or ease of use functions – no
directory scanning, no ‘only this many genres’ CLI arguments, and the like. This does not represent a deviation from the Design Document, as these features will be added in the Beta release.

Our progress as of now has been taken over by a lot of working with the inner neural network. We still have bugs appearing within model, which have actually become a more recent problem with the addition of different edge cases we try to factor in. On the other hand, these ‘setbacks’ our neural network team, which includes largely of myself, does not affect those of the UI team. The UI team has in fact already begun with the command line interface for the project.

By far, the most challenging part of this project has been learning the ways of building the neural network model with little to no experience of building models. Understanding the different aspects of the model and how they are portrayed in the results has taken a lot of time, reading, and research. Perhaps the most time consuming is all the testing, and this becomes even more difficult when a lot of our testing takes so much time, with all the large amounts of data we have to work with.

Categories
computer science

Technologic

Buy it, use it, break it, fix it, trash it, change it, mail, upgrade it
Charge it, point it, zoom it, press it, snap it, work it, quick, erase it
Write it, cut it, paste it, save it, load it, check it, quick, rewrite it
Plug it, play it, burn it, rip it, drag it, drop it, zip, unzip it – Daft Punk

Apps, libraries, languages, platforms, cloud services, data services, fullstack systems, game engines, design tools, analytical tools

We are making haste with our Convolutional Neural Network Music Genre Classification Project. For the last couple of weeks, our group has been working on two main tasks; Improving the neural network model and improving our dataset acquisition. I myself have been working on implementing various methods of building and training the neural network model. Here are a few key aspects to the improvement of the model within the last few weeks:

  1. Data Normalization and Stratified Splitting: Normalizing MFCCs per coefficient played a beneficial role in stabilizing training. Stratified Sampling was then implemented to maintain class distribution in splits
  2. Enhanced Model Architecture: Increasing convolutional filters progressively to better extract features that are important. Adjusting layer order to convolutional, batch normalization, activation, and pooling to decrease spatial size and computations in the neural map.
  3. Training Optimization: Using early stopping which is a technique used to halt the training of a neural network when a monitored metric stops improving, thus preventing overfitting. Using a learning rate schedular to modulate how the learning rate of the optimizer changes over time. Class weighting adjustments which help balance the model’s attention toward all classes, particularly useful for handling class imbalance.

Focusing on the neural network model is very in-depth. The training is trial and error, so in terms of the technology we have been using, Keras has been our primary framework for creating this model. There is a lot to learn just from this single framework. While perhaps next quarter, we will start brainstorming different pipelining methods to connect the UI we will also need to create, to the neural network model, to the dataset acquisition. While we have not quite discussed specifically what technologies we will use, certain members who will be focusing on those already have made their mind of what will be most effective for welding the project together for other non-developers to use.

Categories
Uncategorized

Writing Clean Code

As programmers, writing clean code is something in the back of our minds. It’s like doing all the small things that we focus on in our day to day lives that will keep us productive in the long run. Things like telling Siri to write down a reminder or keeping our workspace clean and organized. While the latter is subject to the definition of “clean”, writing clean code is meant to save us from having to deal with all of the “slop” down the line. It also means keeping things structured and organized, so that when fixes need to be made later, it’s easy to do so. Code that isn’t clean, as we sometimes call as smelly, makes our lives a lot more difficult.

Writer for The Medium, Munikeraragon, gives us a few ways to keep code clean. Let’s look at some examples, and the effects of writing clean code will be obvious.

Consistency
“Consistency is one of the most crucial aspects of clean code. Whether it’s naming conventions, indentation, or file organization, consistency ensures that your code follows a predictable structure. This makes it easier for others (and you) to follow the logic, trace errors, and contribute efficiently.”

Write Small, Focused Functions
“The principle of Single Responsibility states that each function should do one thing — and do it well. When functions are short and focused, they’re easier to understand, test, and debug. If a function grows too large or takes on multiple responsibilities, it becomes harder to track down issues or make changes without breaking something else.”

Prioritize Readability Over Cleverness
“It’s tempting to write complex, clever code that shows off your skills — but this often leads to cryptic, unreadable code. Clean code prioritizes readability and simplicity, even if that means using more lines of code to achieve the same result. Code is read more often than it’s written, so clarity should always take precedence.”

Refactor Early and Often
“Refactoring is the process of restructuring existing code without changing its functionality. It’s a critical habit for maintaining clean code. Refactoring allows you to improve code readability, eliminate duplication, and make your codebase more modular and scalable.”

Use Meaningful Comments
“While clean code should largely speak for itself, there are situations where comments are helpful. Comments should provide context or explain why you did something unusual, rather than what the code is doing. Over-commenting can clutter the code, but well-placed, meaningful comments enhance understanding.”

Test, Test, Test
“Writing clean code also means writing code that can be easily tested. Automated testing is essential to ensuring your code is functional and bug-free. Clean code is structured in a way that makes testing each function or module straightforward.”

After reading how we can write clean code, we can summarize how it benefits us. It allows us to write code that’s reliable, consistent, scalable, and easy to maintain.

Similar to producing code that we can appreciate, we shall avoid writing code that smells bad, ew! Code that smells bad doesn’t actually make us cover our nose, but it does leave programmers, especially experienced ones with a bad taste in their mouth, or a scent in their nose if that’s the route you’d like to go with. Code smells might be more relevant to beginner coders, as a lot of code smells come from bad syntax and code styling. Peep PEP 8.

Out of all the suggested ways to keep code clean, I think I need to test my code thoroughly and often. There are times when I can go for hours of writing code and end up finding logical errors since I left myself no time to test for errors. Instead of doing frequent testing, errors tend to build up and become harder to fix.

Writing Clean Code: Key Strategies | by Munikeraragon | Citrux Digital | Medium

What is a Code Smell? Definition Guide & Examples | Sonar

Categories
Uncategorized

Lots learned, and lots more to learn

Capstone Blog Post #3

1/3

Fall 2024 almost complete. One third of the year until graduation almost done. I learned a lots during this quarter, but just like I do any other quarter. Thankful and eager is how I feel, and not just because we’re following up Thanksgiving and the New Year is around the corner, obviously. It’s a feeling that comes around week 10, alongside a blistering pain and rush to complete final projects, study for final exams, and emailing teachers to regard missing grades. With all jokes aside, this term was no easier than the rest, and alike others, there was a lot to learn from. Completing these classes seem step of maturity, a step of gained knowledge, and a step of pride.

For each class specifically, let’s start with the Senior Capstone project, shall we. This class containing the most exciting workload, gives me a strong sight of what I would enjoy doing after graduation. That is a mix of technology and music. Our Top-N Music Genre Classification Neural Network Project is going along well, and it definitely a project that brings me excitement and joy to work on. Students introduced to comp sci and software development here this often, but when it comes to figuring out where to start and what projects to make, start on something you would enjoy building that relates to you. This senior project comes close to following these wise CS words.

The almighty Operating Systems class is no easy task for comp sci students. Although it might be “one” of the hardest required classes for OSU’s CS bachelor program, I do think it is a necessary class amongst others. Similarly to Assembly Language and Computer Architecture, Operating Systems is an abstraction from all computer hardware, allowing any software programmer to complete any task at hand. Exciting!

Open-Source Software was also a neat class. Different from the previous two, it gave us students a peak into real world programming. Licensing was a big discussion in the topic of legality when it comes to open-source software. We were also encouraged to dive into different OSS communities, given that our final assignment was to make a push request to a large coding project with a supportive and active community.

I am quite excited for next quarter, and maybe or maybe not more excited for the Winter Break that follows this next week. Either way, I look forward to writing another blog post to state my progression through this journey.

Categories
Uncategorized

Music Classification via Neural Networks

Capstone Blog Post #2

A door to many opportunities

Neural Networks have become the hot new buzzword for machine learning. Novel to the world of Computer Science and the AI consumer industry, the talk of machine learning has been turning heads recently. Giving computers the ability to learn is bewildering useful beyond our own comprehension. But will the implementation of computers with the ability to “learn” take over jobs? Perhaps, our lives? Well, let’s not get too far ahead and focus on the small fun projects where we can utilize machine learning and neural networks.

My capstone project: Top-n Music Genre Classification Neural Network – The name says it all. A project that will classify a number (n) music genre using a neural network. Who needs such a thing? Well, if you are not an avid music listener, this might not even nudge you interest. But to those who appreciated being able to categorize their music playlists on Spotify, this might be for you. Big music streaming services like Spotify, Apple Music, Amazon Music, etc. are leaning into machine learning in order to give users the best listening experience possible. This means if you play a song, similar songs will continue to play automatically. This means while you sip hot cider during the morning of Christmas, opening gifts from loved ones while listening to Mariah Carey, Metallica won’t be on queue waiting to turn your children into a bunch of metal-heads. Although, that wouldn’t be the worst Christmas present, would it?

Explaining how a neural network is complicated, in-fact if you want to learn right now, then go do a few google searches or maybe watch a couple of Stanford’s CS231 lectures. But here is a brief description of how it works. A neural network is like a Blackbox function, no one really can know what is happening. Given lots and lots of data however, through multiple layers where each layer consists of many neurons, input information is essentially processed, changing the weight and biases of these neurons based on the expected output of the neural network. In our case, thousands of song samples are input along with their expected genre target. The neural network performs computations on this data, to then be able to predict its next music sample once trained.

For now, I will not go into further detail to serve two purposes. One, to save you from a headache. Two, to demonstrate the learning of my experience creating a neural network for this project. In the next blog post, expect a more detailed rundown of the process of creating the neural network for this genre classification project. Our capstone project group has submitted our design draft. There has not been, yet any prototyping done yet, so stay tuned.

Categories
Uncategorized

Senior Capstone Project

Capstone Blog Post #1

Foresee Nothing in Your Journey

This blog is a small capture of my journey – my CS journey. A journey consists of your past, present, and future. Everyone knows their past and lives in the present. Personally speaking, how will I ever know what’s ahead of my life? The answer is I won’t know, but you can! Sort of. I lack the abilities to foresee my future. But I can do the opposite by jotting down these experiences, with the ability of sharing it with you. I invite you to this journey of mine where I will share my present-time experiences, interests, struggles, and successes. Take what you will and leave what you must. 

Becoming a senior at OSU with just one more year left, it still feels like I am just getting started. I have created a variety of projects, solidifying my learning and the ability to practice the things I have learned. Working a non-CS related job right now, I am hoping to better define my expertise’, after completing this Capstone project, along with various side projects I plan to make this last year. While I am not quite set on what I want to do after I graduate, nor can I tell someone my future job, I hope to continue to work on projects I enjoy which can funnel me to work and grow after graduating.

Through the coursework there have been plenty of projects I have enjoyed working on. In CS340, a partner and I created a full-stack application that allowed for administrative database CRUD operations. We learned about SQL and normalizing databases in this class, while having to extend our research outside of class to make the whole app work, Flask for example. I enjoyed this creating this project largely because it is an application found commonly in businesses over the web. It was very practical.

I want my capstone project to be practical. Not to say I don’t enjoy theoretical research and learning, diving into a career with projects that are practical seem more promising. My top choice for the Capstone project is the Cloud-Based Algorithmic Trading Strategies for Individual Investors. It is practical as it suggests certain trading strategies in the stock market. I myself enjoy in investing, and perhaps myself and others can use it to help our investing.