Music Information Classification Method and System Based on Identification of Data Code Header

Through the data head recognition method, combined with deep neural networks and hierarchical classification model, the efficiency and accuracy of music classification in the existing technology are solved, and efficient and refined classification of music information is achieved, adapting to audio of different quality and providing detailed classification results.

CN120183441BActive Publication Date: 2025-08-05BOSHILIAN (SUZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510639708.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-05
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

The existing technology has problems such as manual labeling, high computational complexity, limited generalization ability of the model, lack of hierarchical classification and interpretability in music classification, making it difficult to achieve efficient and accurate classification of massive music data.

Method used

Using a method based on data head recognition, multi-dimensional feature vectors are extracted by time-frequency domain conversion of audio data, inputting pre-trained deep neural network model to extract advanced semantic features, constructing a data head recognition model and performing preliminary classification, combining music type classification tree and hierarchical classification model, multi-modal feature fusion and dynamic adjustment of feature weights, and finally outputting refined music information classification results.

Benefits of technology

It realizes a comprehensive representation of music information, improves the accuracy and robustness of classification, can handle fuzzy boundaries and overlapping relationships of music types, and provides detailed music classification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183441B_ABST
    Figure CN120183441B_ABST
Patent Text Reader

Abstract

The present invention provides a music information classification method and system based on data code header recognition, which relates to the technical field of information classification, and includes inputting the generated data code into the data code header recognition model to extract the header features of the data code; preliminarily classifying the audio data according to the header features to obtain a preliminary classification result; establishing a music type classification tree; positioning an initial node in the music type classification tree according to the preliminary classification result; performing multi-modal feature fusion on the extracted high-level semantic features and the extracted header features to obtain a fusion feature vector; constructing a hierarchical classification model, inputting the fusion feature vector into the hierarchical classification model, and starting from the initial node, performing refined classification layer by layer downward; in the classification process of each level, dynamically adjusting the feature weights to highlight the key features of the current level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to information classification technology, and particularly to a music information classification method and system based on data code header recognition. Background Art

[0002] With the rapid development of digital music, the efficient management and accurate classification of a vast amount of music data have become an urgent problem to be solved. Traditional music classification methods mainly rely on manual annotation or simple audio feature extraction, and these methods have the following disadvantages:

[0003] Manual annotation is time-consuming and laborious, and it is difficult to handle a vast amount of data; simple audio features cannot fully express the semantic information of music; the classification accuracy is not high, especially for cross-category music works; and there is a lack of adaptability to the evolution of music styles and emerging music types.

[0004] In recent years, with the development of deep learning technology, music feature extraction and classification methods based on neural networks have made certain progress. However, these methods still face the following challenges:

[0005] The computational complexity of feature extraction is high, and it is difficult to achieve real-time classification; the model generalization ability is limited, and the adaptability to unseen music types is poor; there is a lack of modeling of the hierarchical relationship between music types; and the classification results lack interpretability and are difficult to apply to refined music management.

[0006] To solve the above problems, researchers have proposed various improvement methods, such as using transfer learning to improve the model generalization ability, introducing an attention mechanism to capture key features, and adopting a hierarchical classification strategy, etc. However, these methods often only solve some of the problems and lack a unified framework to comprehensively improve the efficiency and accuracy of music classification.

[0007] Therefore, there is an urgent need for a music classification method that can efficiently extract music semantic features, construct a hierarchical classification system, and has good generalization ability and interpretability. Summary of the Invention

[0008] The embodiments of the present invention provide a music information classification method and system based on data code header recognition, which can solve the problems in the prior art.

[0009] In the first aspect of the embodiments of the present invention,

[0010] A music information classification method based on data code header recognition is provided, including:

[0011] Perform time-frequency domain conversion on the input audio data to obtain a spectrogram; extract a multi-dimensional feature vector from the spectrogram, input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generate a data code for the audio data according to the high-level semantic features;

[0012] Construct a data code header recognition model, input the generated data code into the data code header recognition model to extract the header features of the data code; perform preliminary classification on the audio data according to the header features to obtain a preliminary classification result; establish a music type classification tree, and the music type classification tree includes music type nodes at multiple levels; locate an initial node in the music type classification tree according to the preliminary classification result;

[0013] Perform multi-modal feature fusion on the high-level semantic features and the header features to obtain a fused feature vector; construct a hierarchical classification model, and the hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music type classification tree; input the fused feature vector into the hierarchical classification model, and start from the initial node to perform refined classification layer by layer downward;

[0014] During the classification process at each level, dynamically adjust the feature weights to highlight the key features of the current level; update the music type classification tree according to the classification results, including adding new music type nodes or adjusting the relationships between nodes; output the final music information classification result.

[0015] In an optional implementation manner,

[0016] Input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generating a data code for the audio data according to the high-level semantic features includes:

[0017] Reshape the multi-dimensional feature vector into the format of a mel spectrogram; input the mel spectrogram into a pre-trained VGGish deep neural network model; extract high-level semantic features through the convolutional layer block and fully connected layer of the VGGish deep neural network model;

[0018] Quantize each element in the high-level semantic features into an 8-bit unsigned integer; perform bit-plane decomposition on the quantized feature vector to obtain 8 binary bit-planes; calculate the entropy value of each binary bit-plane; sort the binary bit-planes according to the entropy value, and select the top K binary bit-planes with the largest amount of information;

[0019] Connect the selected K binary bit-planes into a long binary sequence, and use run-length encoding to compress the long binary sequence; if the length after compression exceeds the target length, truncate it; if the length after compression is less than the target length, pad it with 0s to the target length;

[0020] Calculate the checksum of the compressed sequence using the CRC-32 algorithm; add the checksum to the end of the compressed sequence to generate a fixed-length binary data code.

[0021] In an optional implementation,

[0022] Construct a data code header recognition model, input the generated data code into the data code header recognition model, and extract the header features of the data code; perform a preliminary classification of the audio data according to the header features, and the preliminary classification results include:

[0023] The data code header recognition model includes a convolutional neural network and a recurrent neural network; the convolutional neural network includes multiple convolutional kernels of different sizes, and multiple filters are set for each size of convolutional kernel; the recurrent neural network is a bidirectional long short-term memory network; a self-attention mechanism layer is set after the bidirectional long short-term memory network;

[0024] Convert the data code into a data code sequence represented numerically; input the converted data code sequence into the data code header recognition model; extract multi-scale local features through the convolutional neural network and max pooling operations; input the extracted multi-scale local features into the bidirectional long short-term memory network to obtain context-related feature representations; use the self-attention mechanism layer to calculate the importance weights of different positions; pass the weighted features through a fully connected layer to obtain the header features of the data code.

[0025] Perform z-score normalization processing on the header features; use the principal component analysis method to reduce the dimension of the normalized header features, and retain the principal components whose proportion of explained variance reaches a preset threshold; construct a random forest classifier, input the reduced-dimensional header features into the random forest classifier, and obtain the probability that each sample belongs to each music category; select the category with the highest probability as the preliminary classification result.

[0026] In an optional implementation,

[0027] The method further includes:

[0028] Use the cross-validation method to evaluate the classification performance, calculate the accuracy, precision, recall, and F1 score; analyze the samples with classification errors to identify the music types that are difficult to classify; according to the analysis results, adjust the parameters of the data code header recognition model and the parameters of the random forest classifier to improve the classification accuracy.

[0029] In an optional implementation,

[0030] Build a music genre classification tree, where the music genre classification tree includes music genre nodes at multiple levels; Locating the initial node in the music genre classification tree according to the preliminary classification result includes:

[0031] Construct a music genre classification tree, and the construction of the music genre classification tree includes: defining multi-level music categories, where each node contains a unique identifier, a node name, a parent node, a list of child nodes, a feature vector, and the number of samples; collecting labeled music samples, analyzing the samples using a clustering algorithm, and dynamically adjusting the tree structure; calculating the representative feature vector of each node, where the representative feature vector is the mean vector of the high-level semantic features of all music samples of this node; calculating the cosine similarity between all nodes, and constructing a similarity matrix between nodes;

[0032] Classify the input music sample, and the classification of the input music sample includes: extracting the high-level semantic feature vector of the music sample; using a random forest classifier to perform a preliminary classification on the music sample to obtain the probability distribution of each top-level category; selecting the top N top-level categories with the highest probability, and performing a multi-path search on each selected top-level category. The multi-path search includes starting from the top-level node, calculating the similarity between the music sample feature vector and the current node feature vector, selecting the child node with the highest similarity to enter the next layer, and repeating this process until reaching a leaf node or the similarity is lower than a preset threshold; collecting all candidate nodes obtained by the multi-path search, calculating the similarity between the music sample feature vector and the feature vector of each candidate node, and sorting the candidate nodes according to the similarity; selecting the candidate node with the highest similarity as the initial node.

[0033] In an optional implementation manner,

[0034] Evaluate the classification result and optimize the classification tree, and the evaluation of the classification result and the optimization of the classification tree include:

[0035] Calculate the similarity between the music sample feature vector and the initial node feature vector, compare the similarity with a preset threshold, and evaluate the classification confidence; if the confidence is lower than the preset threshold, mark the music sample as "uncertain"; record the classification result, including the initial node, the confidence, and the search path; update the number of samples and the feature vector of the node according to the classification result; regularly recalculate the similarity matrix between nodes to optimize the structure of the music genre classification tree.

[0036] In an optional implementation manner,

[0037] Construct a hierarchical classification model, where the hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music genre classification tree; input the fused feature vector into the hierarchical classification model, and start from the initial node to perform refined classification layer by layer downwards, including:

[0038] Normalize the high-level semantic feature vector and the head feature vector to eliminate the dimensional difference between different features; use the random forest algorithm to evaluate the importance of the normalized features and calculate the Gini importance index of each feature; select the most important feature subset according to the Gini importance index;

[0039] Adopt an attention mechanism for feature fusion, define an attention weight matrix, use the softmax function to calculate the weight of each feature, and obtain a fused feature vector; perform principal component analysis dimensionality reduction on the fused feature vector to obtain a dimensionality-reduced feature vector;

[0040] Construct a hierarchical classification model, where the hierarchical classification model includes multiple sub-classifiers, each sub-classifier corresponds to a non-leaf node in the music genre classification tree, and each sub-classifier is composed of a support vector machine, a random forest, and a gradient boosting decision tree;

[0041] Customize a feature set for each sub-classifier, including the dimensionality-reduced feature vector and node-specific domain features; train each sub-classifier using the stratified cross-validation method and fuse the prediction results of the base models using the Stacking method; design a hierarchical decision-making strategy, define a confidence threshold and a node selection function for node selection and termination condition judgment during the classification process;

[0042] Calculate the feature importance vector of each node, and use SHAP values to quantify the importance of features; design a weight adjustment function to dynamically adjust the feature weights according to the difference in feature importance between the current node and the parent node;

[0043] When classifying to the next lower layer each time, use the weight adjustment function to update the feature vector; introduce an adaptive mechanism to dynamically adjust the parameters of the weight adjustment function according to the classification performance; input the dimensionality-reduced feature vector into the hierarchical classification model, start from the initial node, and perform refined classification layer by layer downward, and dynamically adjust the feature weights during the classification process of each level; output the final music genre classification result.

[0044] In the second aspect of the embodiments of the present invention, a music information classification system based on data code head recognition is provided, including:

[0045] The first unit is used to perform time-frequency domain conversion on the input audio data to obtain a spectrogram; extract a multi-dimensional feature vector from the spectrogram, input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generate a data code of the audio data according to the high-level semantic features;

[0046] A second unit, for constructing a data code header recognition model, inputting the generated data code into the data code header recognition model, and extracting the header features of the data code; preliminarily classifying the audio data according to the header features to obtain a preliminary classification result; establishing a music type classification tree, where the music type classification tree includes music type nodes at multiple levels; positioning an initial node in the music type classification tree according to the preliminary classification result;

[0047] A third unit, for performing multi-modal feature fusion on the high-level semantic features and the header features to obtain a fused feature vector; constructing a hierarchical classification model, where the hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music type classification tree; inputting the fused feature vector into the hierarchical classification model, and starting from the initial node, performing refined classification layer by layer downward;

[0048] A fourth unit, for dynamically adjusting the feature weights during the classification process at each level to highlight the key features of the current level; updating the music type classification tree according to the classification results, including adding new music type nodes or adjusting the relationships between nodes; outputting the final music information classification result.

[0049] In a third aspect of the embodiments of the present invention, there is provided an electronic device, including:

[0050] A processor;

[0051] A memory for storing instructions executable by the processor;

[0052] Wherein, the processor is configured to call the instructions stored in the memory to execute the foregoing method.

[0053] In a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.

[0054] Through multi-dimensional feature extraction and multi-modal feature fusion, the present invention makes full use of the time-frequency domain information, semantic information and header features of audio data. By using a deep neural network to extract high-level semantic features and combining with the header features extracted by the data code header recognition model, a comprehensive representation of music information is achieved. This multi-angle and multi-level feature extraction and fusion method significantly improves the accuracy of music classification. At the same time, by preprocessing the audio data, including noise reduction, frame division and windowing processing, the adaptability of the system to audio of different qualities is enhanced, and the robustness of classification is improved.

[0055] The present invention constructs a hierarchical music genre classification tree and a corresponding hierarchical classification model. By initially classifying to locate the initial node and then performing refined classification layer by layer downward, it simulates the hierarchical cognitive process of human beings for music genres. During the classification process at each level, the feature weights are dynamically adjusted to highlight the key features of the current level, further improving the classification accuracy. This method can not only achieve a fine division of music genres, but also handle the fuzzy boundaries and overlapping relationships between music genres, providing users with more accurate and detailed music classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 FIG. is a schematic flowchart of a music information classification method based on data code header recognition according to an embodiment of the present invention;

[0057] Figure 2 FIG. is a schematic structural diagram of a music information classification system based on data code header recognition according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0059] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0060] Figure 1 FIG. is a schematic flowchart of a music information classification method based on data code header recognition according to an embodiment of the present invention, as Figure 1 shown, the method includes:

[0061] Performing time-frequency domain conversion on the input audio data to obtain a spectrogram; extracting a multi-dimensional feature vector from the spectrogram, inputting the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generating a data code of the audio data according to the high-level semantic features;

[0062] Build a data code header recognition model, input the generated data code into the data code header recognition model, and extract the header features of the data code; preliminarily classify the audio data according to the header features to obtain a preliminary classification result; establish a music type classification tree, where the music type classification tree includes music type nodes at multiple levels; locate the initial node in the music type classification tree according to the preliminary classification result;

[0063] Perform multi-modal feature fusion on the high-level semantic features and the header features to obtain a fused feature vector; build a hierarchical classification model, where the hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music type classification tree; input the fused feature vector into the hierarchical classification model, and start from the initial node to perform refined classification layer by layer downward;

[0064] During the classification process at each level, dynamically adjust the feature weights to highlight the key features of the current level; update the music type classification tree according to the classification results, including adding new music type nodes or adjusting the relationships between nodes; output the final music information classification result.

[0065] The specific implementation manner of the music information classification method based on data code header recognition is as follows:

[0066] First, preprocess the input audio data. The preprocessing includes noise reduction, frame segmentation, and windowing. Noise reduction uses spectral subtraction. The audio signal is transformed into the frequency domain, the noise spectrum is estimated, the noise spectrum is subtracted from the original signal spectrum, and then it is transformed back to the time domain to obtain the noise-reduced signal. Frame segmentation uses a frame length of 25 ms and a frame shift of 10 ms to cut the audio into a series of short-time frames. Windowing uses the Hamming window function to reduce spectral leakage.

[0067] Perform time-frequency domain conversion on the preprocessed audio data to obtain a spectrogram. Specifically, use the short-time Fourier transform (STFT) to transform each frame of the signal into the frequency domain to obtain the spectrogram. The horizontal axis of the spectrogram represents time, the vertical axis represents frequency, and the color depth represents the energy magnitude.

[0068] Extract multi-dimensional feature vectors from the spectrogram, including Mel-frequency cepstral coefficients (MFCC), chroma features, rhythm features, and pitch features. 13-order coefficients are used for MFCC extraction. A 12-dimensional chroma vector is extracted for chroma features. Rhythm features include beat intensity and rhythm regularity. Pitch features include fundamental frequency and pitch distribution.

[0069] Input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features. The deep neural network model adopts a five-layer fully connected network structure, and the number of neurons in the hidden layers is 512, 256, 128, and 64 respectively, and the output layer is 32-dimensional high-level semantic features.

[0070] Generate a data code for audio data based on high-level semantic features. The data code is a 256-bit binary sequence. The specific method is to quantize 32-dimensional high-level semantic features into a 256-dimensional binary vector, with each feature represented by 8-bit binary numbers. For example, for the high-level semantic feature vector [0.7, 0.3, 0.5, ..., 0.8], the data code obtained after quantization is "1100011101001110 10000000 ... 11001100".

[0071] Construct a data code header recognition model, including a convolutional neural network (CNN) and a recurrent neural network (RNN). The CNN adopts a 3-layer convolutional structure, with the convolutional kernel sizes being 5, 3, 3 respectively, and the number of convolutional kernels being 32, 64, 128 respectively. The RNN adopts a long short-term memory network (LSTM) with a hidden layer size of 128. The CNN is used to extract local features, and the RNN is used to capture long-range dependencies.

[0072] Input the generated data code into the data code header recognition model to extract the header features of the data code. Specifically, take the first 64 bits of the data code as the input, and after being processed by the CNN and RNN, a 32-dimensional header feature vector is obtained.

[0073] Perform a preliminary classification of the audio data based on the header features to obtain a preliminary classification result. Use a softmax classifier to map the 32-dimensional header features to 10 predefined coarse-grained music categories, such as classical, pop, rock, etc. The category with the highest output probability is used as the preliminary classification result.

[0074] Establish a music genre classification tree, including multiple levels of music genre nodes. The classification tree adopts a three-layer structure. The first layer is 10 coarse-grained categories, the second layer is subdivided into 50 subcategories, and the third layer is further subdivided into 200 specific types. For example, under the "classical" category, it can be subdivided into subcategories such as "symphony" and "chamber music", and further into specific types such as "Mozart Symphony" and "Beethoven Symphony".

[0075] Locate the initial node in the music genre classification tree according to the preliminary classification result. For example, if the preliminary classification result is "classical", then locate the "classical" node in the first layer of the classification tree as the initial node.

[0076] Perform multi-modal feature fusion on the extracted high-level semantic features and the extracted header features to obtain a fused feature vector. Use an attention mechanism for feature fusion, calculate the importance weights of the two features, and perform weighted summation to obtain a 64-dimensional fused feature vector.

[0077] Build a hierarchical classification model, including multiple sub-classifiers, each sub-classifier corresponding to a non-leaf node in the music genre classification tree. Each sub-classifier is implemented using a Support Vector Machine (SVM). For example, the sub-classifier corresponding to the "Classical" node is used to further divide "Classical" music into sub-categories such as "Symphony" and "Chamber Music".

[0078] Input the fused feature vector into the hierarchical classification model and perform refined classification layer by layer starting from the initial node. During the classification process at each level, dynamically adjust the feature weights to highlight the key features of the current level. For example, when further dividing "Classical" music, increase the weight of features related to the instrument composition.

[0079] Update the music genre classification tree according to the classification results, including adding new music genre nodes or adjusting the relationships between nodes. For example, if a large number of samples are classified as "Electronic Classical", a new sub-category node "Electronic Classical" can be added under "Classical".

[0080] Finally, output the music information classification results, including music genre, style, emotion label, and recommendation label. The music genre corresponds to the leaf node in the classification tree, such as "Mozart Symphony". The style label is selected from a predefined style vocabulary, such as "elegant" and "exciting". The emotion label is predicted based on music features, such as "cheerful" and "melancholy". The recommendation label is generated according to the user's listening history, such as "suitable for work" and "relaxing before bed".

[0081] Through the above steps, refined classification of music information based on the recognition of the data code header is achieved, providing strong support for applications such as music retrieval and recommendation. This method integrates multiple features and classification techniques, can accurately identify music genres, and provide rich label information.

[0082] In an optional implementation, input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generate a data code for the audio data according to the high-level semantic features, and the data code includes a fixed-length binary sequence, including:

[0083] Reshape the multi-dimensional feature vector into the format of a Mel spectrogram; input the Mel spectrogram into a pre-trained VGGish deep neural network model; extract a high-level semantic feature vector through the convolutional layer block and fully connected layer of the VGGish deep neural network model;

[0084] Perform L2 normalization on the high-level semantic feature vector; use principal component analysis to reduce the dimension of the normalized feature vector; quantize the reduced-dimensional feature vector to obtain a quantized feature vector; introduce an attention mechanism to calculate the importance weights of different features in the quantized feature vector; weight the quantized feature vector according to the importance weights to obtain an enhanced feature vector;

[0085] Quantize each element in the enhanced feature vector into an 8-bit unsigned integer; perform bit-plane decomposition on the quantized feature vector to obtain 8 binary bit-planes; calculate the entropy value of each binary bit-plane; sort the binary bit-planes according to the entropy value, and select the top K binary bit-planes with the largest amount of information;

[0086] Connect the selected K binary bit-planes into a long binary sequence; perform (7,4) Hamming coding on the long binary sequence; compress the Hamming-coded sequence using run-length coding; if the length after compression exceeds the target length, truncate it; if the length after compression is less than the target length, pad it with 0s to the target length;

[0087] Calculate the checksum of the compressed sequence using the CRC-32 algorithm; add the checksum to the end of the compressed sequence to generate a fixed-length binary data code; the fixed-length binary data code includes the encoded semantic information and the checksum.

[0088] Reshape the multi-dimensional feature vector into the Mel spectrogram format. The multi-dimensional feature vector usually contains the time and frequency features of the audio signal, and it needs to be converted into a two-dimensional Mel spectrogram for subsequent input into the deep neural network model. For example, reshape a 128-dimensional feature vector into an 8x16 Mel spectrogram.

[0089] Input the Mel spectrogram into the pre-trained VGGish deep neural network model. The VGGish model is an audio feature extractor based on the VGG network structure. It has been pre-trained on a large-scale audio dataset and can effectively extract the high-level semantic features of audio. The model contains multiple convolutional layer blocks and fully connected layers, and through these layers, more abstract feature representations can be gradually extracted.

[0090] Extract high-level semantic feature vectors through the convolutional layer blocks and fully connected layers of the VGGish model. Specifically, the Mel spectrogram first passes through 4 convolutional layer blocks, each of which contains 2-3 convolutional layers and 1 max-pooling layer. Then it passes through 2 fully connected layers, and finally obtains a 128-dimensional feature vector, which is the extracted high-level semantic feature.

[0091] Perform L2 normalization on the high-level semantic feature vector. L2 normalization can scale the feature vector to unit length, which helps to eliminate the scale differences between different samples. The specific operation is to divide the feature vector by its L2 norm (Euclidean norm).

[0092] Use principal component analysis (PCA) to reduce the dimension of the normalized feature vectors. PCA can find the main directions of data variation, remove redundant information, and at the same time retain the most important features. For example, reduce the 128-dimensional feature vector to 64 dimensions. Quantize the feature vector after dimension reduction to obtain a quantized feature vector. Quantization can discretize continuous eigenvalue, which is beneficial for subsequent coding compression. Uniform quantization or non-uniform quantization methods can be adopted to map the eigenvalue to a finite integer range, such as 0 - 255.

[0093] Introduce an attention mechanism to calculate the importance weights of different features in the quantized feature vector. The attention mechanism can adaptively assign weights to different features, highlighting the role of important features. Self-attention or other attention calculation methods can be used to obtain a 64-dimensional weight vector. Weight the quantized feature vector according to the importance weights to obtain an enhanced feature vector. Multiply the weight vector and the quantized feature vector element by element to obtain a 64-dimensional enhanced feature vector.

[0094] Quantize each element in the enhanced feature vector into an 8-bit unsigned integer. This step further discretizes the eigenvalue, facilitating subsequent bit-plane decomposition. Specifically, the eigenvalue can be linearly mapped to the integer range of 0 - 255. Perform bit-plane decomposition on the quantized feature vector to obtain 8 binary bit-planes. Split each 8-bit integer into 8 binary bits to obtain 8 64-bit binary sequences, each sequence corresponding to a bit-plane.

[0095] Calculate the entropy value of each binary bit-plane. The entropy value reflects the richness of information in the bit-plane. The occurrence probabilities of 0 and 1 in each bit-plane can be counted, and then the information entropy can be calculated. Sort the binary bit-planes according to the entropy value, and select the top K binary bit-planes with the largest amount of information. Usually, select the top 4 - 6 bit-planes with the largest entropy values, and these bit-planes contain the most critical information. Connect the selected K binary bit-planes into a long binary sequence. For example, select 4 64-bit bit-planes, and after connection, obtain a 256-bit binary sequence.

[0096] Perform (7,4) Hamming coding on the long binary sequence. Hamming coding can detect and correct single-bit errors, improving the reliability of data. The length of the encoded sequence will increase to 7 / 4 times the original, that is, 448 bits. Use run-length coding to compress the sequence after Hamming coding. Run-length coding can effectively compress consecutive 0s or 1s, reducing the data length. The compressed length is not fixed and depends on the distribution characteristics of the data.

[0097] If the length after compression exceeds the target length, truncation is performed. If it is less than the target length, it is padded with 0s to the target length. Assuming the target length is 512 bits, corresponding truncation or padding operations need to be performed on the compressed sequence. The checksum of the compressed sequence is calculated using the CRC-32 algorithm. CRC-32 can detect errors during data transmission and improve data integrity. The checksum is usually 32 bits.

[0098] The checksum is added to the end of the compressed sequence to generate a fixed-length binary data code. The final obtained data code includes 480 bits of encoded semantic information and 32 bits of CRC checksum, with a total length of 512 bits.

[0099] In this way, the generation process from the multi-dimensional feature vector to the fixed-length binary data code is completed. The generated data code not only contains the key semantic information of the audio but also has the ability of error detection and correction, and can be used in application scenarios such as audio retrieval and recognition.

[0100] In an optional implementation manner, a data code header recognition model is constructed. The data code header recognition model includes a convolutional neural network and a recurrent neural network; the generated data code is input into the data code header recognition model to extract the header features of the data code; based on the header features, the audio data is preliminarily classified, and the preliminary classification results include:

[0101] A data code header recognition model is constructed. The data code header recognition model includes a convolutional neural network and a recurrent neural network; the convolutional neural network includes multiple convolutional kernels of different sizes, and multiple filters are set for each size of convolutional kernel; the recurrent neural network is a bidirectional long short-term memory network; a self-attention mechanism layer is set after the bidirectional long short-term memory network;

[0102] Receive a fixed-length binary data code sequence, convert the binary data code sequence into a numerical representation; input the converted data code sequence into the data code header recognition model; extract multi-scale local features through the convolutional neural network and max pooling operations; input the extracted multi-scale local features into the bidirectional long short-term memory network to obtain context-related feature representations; calculate the importance weights of different positions using the self-attention mechanism layer; pass the weighted features through a fully connected layer to obtain the header features of the data code;

[0103] Perform z-score normalization on the head features; use the principal component analysis method to reduce the dimensionality of the normalized head features, and retain the principal components whose proportion of explained variance reaches the preset threshold; construct a random forest classifier, and the parameters of the random forest classifier include the number of decision trees, the maximum tree depth, the minimum number of samples in leaf nodes, and the feature selection criterion; input the head features after dimensionality reduction into the random forest classifier to obtain the probability that each sample belongs to each music category; select the category with the highest probability as the preliminary classification result.

[0104] According to the method, constructing a data code head recognition model is a key step. This model combines the advantages of convolutional neural networks (CNNs) and recurrent neural networks (RNNs), and can effectively extract the local features and sequence features of data codes.

[0105] In specific implementation, first construct the CNN part. The CNN contains convolutional kernels of multiple different sizes, such as 3x3, 5x5, and 7x7, and multiple filters are set for each size of convolutional kernel, such as 64, 128, and 256. This can extract local features of different scales. After the convolutional layer, a max pooling layer is connected, which is used for dimensionality reduction and extracting significant features.

[0106] The RNN part uses a bidirectional long short-term memory network (Bi-LSTM). The Bi-LSTM contains two LSTMs, a forward one and a backward one, which can consider the context information of the past and the future at the same time. The LSTM unit contains an input gate, a forget gate, and an output gate, and can effectively handle the long-term dependence problem. The number of hidden units of the Bi-LSTM can be set to 128 or 256.

[0107] Add a self-attention mechanism layer after the Bi-LSTM. This layer calculates the correlation between different positions in the sequence to obtain attention weights. This helps the model focus on important feature positions. The dimension of the self-attention layer can be the same as the number of hidden units of the Bi-LSTM.

[0108] When receiving the input binary data code sequence, first convert it into a numerical representation. For example, "0" can be mapped to -1 and "1" can be mapped to 1. Assuming the input sequence length is 1024 bits, a 1024-dimensional vector is obtained after conversion. Input the converted sequence into the CNN for convolution operation. Taking the 3x3 convolutional kernel as an example, a feature map of (1024 - 3 + 1) x 64 = 1022 x 64 is obtained after convolution. After max pooling, the feature dimension is further reduced. Repeat this process for convolutional kernels of different sizes, and finally obtain feature maps of multiple scales.

[0109] The features extracted by the CNN are input into the Bi-LSTM. The Bi-LSTM processes the feature sequence bidirectionally and outputs a new feature sequence containing context information. Assuming the number of hidden units of the Bi-LSTM is 128, the output dimension is 1022x256. The self-attention layer calculates the correlations between positions in the feature sequence to obtain an attention matrix. The attention weights are multiplied by the original features to obtain a weighted feature representation. Finally, through the fully connected layer, the features are mapped to a lower dimension, such as 256 dimensions, to obtain the head feature representation of the data code. This feature is normalized by z-score to make its mean 0 and variance 1.

[0110] Principal Component Analysis (PCA) is used to reduce the dimension of the normalized features. Assuming 95% of the variance information is retained, the 256-dimensional features may be reduced to about 64 dimensions.

[0111] A random forest classifier is constructed for preliminary classification. The number of decision trees is set to 100, the maximum tree depth is 10, the minimum number of samples in a leaf node is 5, and the Gini coefficient is used for feature selection. The reduced-dimensional features are input into the random forest to obtain the probabilities of the samples belonging to each music category. The category with the highest probability is selected as the preliminary classification result.

[0112] Through the above steps, an end-to-end processing from the original data code to the preliminary classification result is achieved. This method combines deep learning and machine learning techniques, can effectively extract the key features of the data code, and lays a foundation for subsequent fine classification.

[0113] In an optional implementation, the method further includes:

[0114] The cross-validation method is used to evaluate the classification performance, and the accuracy, precision, recall, and F1 score are calculated; the samples with classification errors are analyzed to identify the music types that are difficult to classify; according to the analysis results, the parameters of the data code head recognition model and the parameters of the random forest classifier are adjusted to improve the classification accuracy.

[0115] In terms of evaluating and optimizing the classification performance, this implementation uses methods such as cross-validation, multi-index evaluation, and error analysis to comprehensively evaluate the model effect and optimize it targeted. The specific implementation process is as follows:

[0116] The dataset was divided into a training set and a test set in a ratio of 8:2. A 5-fold cross-validation was then performed on the training set. This involved dividing the training set into 5 equal parts, taking 4 of the parts as training data and the remaining part as validation data, and repeating this 5 times. This method fully utilized the limited data and avoided overfitting. In each fold of cross-validation, the data-based partial recognition model and the random forest classifier were trained on the training data, and predictions were then made on the validation data. The true and predicted labels for each sample were recorded. The results of the 5 tests were averaged to calculate metrics such as accuracy, precision, recall, and F1 score.

[0117] Accuracy reflects the proportion of correct classifications overall. Precision reflects the proportion of predicted positive examples that are actually positive. Recall reflects the proportion of actual positive examples that are correctly predicted. The F1 score is the harmonic mean of precision and recall. These metrics evaluate classification performance from different perspectives. For example, in a music genre classification task, the following results might be obtained: accuracy 85%, precision 80%, recall 75%, and F1 score 77.5%. This indicates good overall classification performance, but there is still room for improvement.

[0118] Next, we analyze the misclassified samples. We tally all misclassified samples by their true and predicted labels to generate a confusion matrix. This confusion matrix provides an intuitive view of which categories are easily confused with each other. For example, we found a high incidence of misclassification between classical music and jazz. Further analysis of the features of these samples reveals similarities in rhythm, harmony, and other aspects. This suggests that the existing features may not be sufficient to adequately distinguish between the two genres.

[0119] After optimization, re-run cross-validation. For example, after optimization, the accuracy increased to 88%, precision 83%, recall 80%, and F1 score 81.5%. This indicates that the optimization measures have achieved some results. Finally, perform a final evaluation on the test set to verify the model's generalization ability. If the performance on the test set is similar to the cross-validation results, the model has good generalization ability. Otherwise, there may be overfitting, and further adjustments to the model structure or regularization parameters are needed.

[0120] Through this iterative optimization process, the performance of the classification model is continuously improved, enabling it to more accurately identify different types of music. This method is not only applicable to music classification, but can also be extended to other audio classification tasks.

[0121] In an optional embodiment, a music type classification tree is established, wherein the music type classification tree includes multiple levels of music type nodes; and locating an initial node in the music type classification tree according to the preliminary classification result includes:

[0122] Constructing a music type classification tree, the construction of the music type classification tree includes: defining a multi-level music category, each node including a unique identifier, a node name, a parent node, a list of child nodes, a feature vector, and a number of samples; collecting labeled music samples, analyzing the samples using a clustering algorithm, and dynamically adjusting the tree structure; calculating a representative feature vector for each node, the representative feature vector being a mean vector of high-level semantic features of all music samples at the node; calculating cosine similarity between all nodes, and constructing an inter-node similarity matrix;

[0123] The input music sample is classified, and the classification of the input music sample includes: extracting the high-level semantic feature vector of the music sample; using a random forest classifier to preliminarily classify the music sample to obtain the probability distribution of each top-level category; selecting the top N top-level categories with the highest probability, and performing a multi-path search on each selected top-level category, the multi-path search includes starting from the top-level node, calculating the similarity between the music sample feature vector and the feature vector of the current node, selecting the child node with the highest similarity to enter the next layer, and repeating this process until a leaf node is reached or the similarity is lower than a preset threshold; collecting all candidate nodes obtained by the multi-path search, calculating the similarity between the music sample feature vector and the feature vector of each candidate node, and sorting the candidate nodes according to the similarity; and selecting the candidate node with the highest similarity as the initial node.

[0124] In one specific implementation, a music genre classification tree is first constructed. Multi-level music categories are defined, such as top-level categories like pop, rock, classical, and jazz. Each top-level category can also contain multiple subcategories. For each node, attributes such as a unique identifier, node name, parent node, child node list, feature vector, and sample count are defined. For example, a pop music node can be defined as:

[0125] Identifier: POP001; Node name: Pop Music; Parent node: ROOT; Child node list: [POP002, POP003, POP004]; Feature vector: [0.8, 0.6, 0.3, 0.7]; Number of samples: 10,000.

[0126] Next, we collect labeled music samples. We can obtain categorized music data from major music platforms. We use clustering algorithms such as K-means to analyze the samples and dynamically adjust the tree structure based on the clustering results. For example, we may need to add new subcategories or merge categories with high similarity.

[0127] Then calculate the representative feature vector of each node. Extract the high-level semantic features of all music samples of this node, including rhythm, timbre, harmony, etc., and average the feature vectors of all samples to obtain the representative feature vector of this node. For example, the representative feature vector of the pop music node may be [0.75, 0.65, 0.35, 0.68].

[0128] Next, calculate the cosine similarity between all nodes and construct a similarity matrix between nodes. For example, the similarity between the pop music node and other nodes can be:

[0129] Pop - Rock: 0.82; Pop - Classical: 0.23; Pop - Jazz: 0.56;

[0130] For the input music sample, first extract its high-level semantic feature vector. Use the trained random forest classifier to perform a preliminary classification on the sample to obtain the probability distribution of each top-level category. For example, the classification result of a certain sample can be:

[0131] Pop: 0.6; Rock: 0.3; Classical: 0.05; Jazz: 0.05;

[0132] Select the top N top-level categories with the highest probabilities. For example, select the categories with probabilities greater than 0.1. Here, select the two categories of pop and rock.

[0133] Perform a multi-path search for each selected top-level category. Take pop music as an example. Starting from the pop music node, calculate the cosine similarity between the sample feature vector and the current node feature vector. Suppose the pop music node has 3 child nodes: pop rock, electro-pop, and R&B. Calculate the similarities between the sample and these 3 child nodes as 0.85, 0.72, and 0.63 respectively, and select the pop rock node with the highest similarity to enter the next layer. Repeat this process until reaching a leaf node or the similarity is lower than a preset threshold (such as 0.5).

[0134] Perform the same multi-path search process for the rock category. Finally, collect all candidate nodes obtained from the multi-path search, calculate the similarity between the sample feature vector and each candidate node feature vector, and sort the candidate nodes according to the similarity. For example, the final sorted list of candidate nodes can be:

[0135] 1. Pop Rock: 0.85; 2. Alternative Rock: 0.78; 3. Electro - Pop: 0.72; 4. Hard Rock: 0.68;

[0136] Select the pop rock node with the highest similarity as the initial node. In this way, the precise classification of the input music sample is completed, and the most matching node in the music genre classification tree is located.

[0137] This method can accurately classify music samples by constructing a multi-level music genre classification tree, combining random forest preliminary classification and multi-path search. The dynamic adjustment mechanism of the music genre classification tree ensures that the classification system keeps pace with the times, and the multi-path search strategy improves the accuracy and robustness of classification. This method can be widely applied in fields such as music recommendation and music retrieval to provide users with more accurate music services.

[0138] In an optional implementation manner, the classification result is evaluated and the classification tree is optimized. The evaluation of the classification result and the optimization of the classification tree include:

[0139] Calculate the similarity between the music sample feature vector and the initial node feature vector, compare the similarity with a preset threshold, and evaluate the classification confidence; if the confidence is lower than the preset threshold, mark the music sample as "uncertain"; record the classification result, including the initial node, confidence, and search path; update the sample quantity and feature vector of the node according to the classification result; regularly recalculate the similarity matrix between nodes to optimize the structure of the music genre classification tree.

[0140] In a specific implementation manner, the method for evaluating the classification result and optimizing the classification tree may include the following steps:

[0141] Calculate the similarity between the feature vector of the music sample to be classified and the feature vector of the initial node of the classification tree. The similarity calculation can use the cosine similarity method. After normalizing the two vectors, calculate their dot product. For example, assume the music sample feature vector is [0.3, 0.5, 0.2] and the initial node feature vector is [0.4, 0.4, 0.2], then their similarity is 0.94.

[0142] Compare the calculated similarity with a preset threshold to evaluate the classification confidence. The preset threshold can be set to 0.8. If the similarity is greater than or equal to 0.8, it is considered that the classification confidence is high; if the similarity is less than 0.8, it is considered that the classification confidence is low. For the above example, the similarity 0.94 is greater than the threshold 0.8, so the classification confidence is high.

[0143] Process according to the evaluation result of the confidence. If the confidence is high, continue to classify downward along the classification tree; if the confidence is low, mark the music sample as "uncertain". For the case of high confidence, continue to calculate the similarity between the sample and the child nodes of the current node, select the child node with the highest similarity as the next classification node, and repeat the above process until reaching the leaf node.

[0144] During the classification process, record the classification results, including the initial node, classification nodes at all levels, the leaf node finally classified, the confidence level of each node, and the entire search path. For example, a possible record could be: initial node - Pop Music (0.94), secondary node - Chinese Pop (0.88), leaf node - Mainland China Pop (0.92).

[0145] After completing one classification, update the information of relevant nodes according to the classification results. First, update the sample quantity of each node by adding 1 to the sample numbers of all nodes on the classification path. Then, update the feature vector of the node. In a weighted average manner, add the feature vector of the new sample to the original feature vector with a certain weight. For example, if the weight is taken as 0.1, the updated feature vector is 0.9 times the original vector plus 0.1 times the new sample vector.

[0146] Recalculate the similarity matrix between nodes in the entire classification tree regularly (such as after classifying 1000 songs). According to the updated similarity matrix, the classification tree structure can be optimized. Specifically, it can include merging nodes with very high similarity, splitting nodes with too many samples, adjusting the hierarchical relationship of nodes, etc. For example, if it is found that the similarity between the two nodes of "Chinese Pop" and "Hong Kong, Macao and Taiwan Pop" reaches 0.95, they can be considered to be merged into a "Chinese Pop" node.

[0147] Through the above steps, the classification results can be continuously evaluated and the classification tree structure can be optimized, improving the accuracy and efficiency of music genre classification. This method can adapt to the dynamic changes of music genres and continuously improve the classification system as the sample size increases.

[0148] In an optional implementation manner, construct a hierarchical classification model. The hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music genre classification tree; input the fused feature vector into the hierarchical classification model, and start from the initial node to perform refined classification layer by layer, including:

[0149] Perform standardization processing on the high-level semantic feature vector and the head feature vector to eliminate the dimensional difference between different features; use the random forest algorithm to evaluate the importance of the standardized features, calculate the Gini importance index of each feature; according to the Gini importance index, select the most important feature subset;

[0150] Adopt an attention mechanism for feature fusion, define an attention weight matrix, use the softmax function to calculate the weight of each feature, and obtain a fused feature vector; perform principal component analysis dimensionality reduction processing on the fused feature vector to obtain a dimensionality-reduced feature vector;

[0151] Construct a hierarchical classification model, where the hierarchical classification model includes multiple sub-classifiers, each sub-classifier corresponds to a non-leaf node in the music genre classification tree, and each sub-classifier is composed of a support vector machine, a random forest, and a gradient boosting decision tree;

[0152] Customize a feature set for each sub-classifier, including the dimensionality-reduced feature vectors and node-specific domain features; train each sub-classifier using a stratified cross-validation method, and use the Stacking method to fuse the prediction results of the base models; design a hierarchical decision-making strategy, define a confidence threshold and a node selection function for node selection and termination condition judgment during the classification process;

[0153] Calculate the feature importance vector of each node, and use SHAP values to quantify the importance of features; design a weight adjustment function to dynamically adjust feature weights according to the difference in feature importance between the current node and the parent node;

[0154] When classifying to the next lower level each time, use the weight adjustment function to update the feature vectors; introduce an adaptive mechanism to dynamically adjust the parameters of the weight adjustment function according to the classification performance; input the dimensionality-reduced feature vectors into the hierarchical classification model, start from the initial node, and perform refined classification layer by layer downward, dynamically adjusting feature weights during the classification process at each level; output the final music genre classification result.

[0155] In the specific implementation, first standardize the high-level semantic feature vectors and the head feature vectors to eliminate the dimensional differences between different features. The standardization process uses the Z-score standardization method, subtracting the mean of each feature and then dividing by the standard deviation.

[0156] Next, use the random forest algorithm to evaluate the importance of the standardized features and calculate the Gini importance index of each feature. The random forest consists of multiple decision trees, and each tree is constructed using a randomly selected subset of features. For each feature, calculate the average decrease in impurity caused when it is used as a splitting node in all decision trees, which is the Gini importance index of the feature. For example, assume there are 10 features, and the Gini importance indices calculated by the random forest algorithm are [0.2, 0.15, 0.1, 0.05, 0.1, 0.08, 0.12, 0.07, 0.06, 0.07].

[0157] According to the feature importance index, select the most important feature subset. A threshold can be set to select features with a Gini importance index greater than the threshold, or select the top k features ranked by the Gini importance index. For example, when the threshold is set to 0.1, the selected feature subset is the 4 features corresponding to [0.2, 0.15, 0.1, 0.12].

[0158] Then, the attention mechanism is adopted for feature fusion. The fused feature vector is processed by principal component analysis for dimensionality reduction to obtain the dimensionality-reduced feature vector. First, the covariance matrix is calculated, then the eigenvalues and eigenvectors of the covariance matrix are calculated, and the eigenvectors corresponding to the largest k eigenvalues are selected to form the projection matrix. The original feature vector is projected into the k-dimensional space to obtain the dimensionality-reduced feature vector.

[0159] A hierarchical classification model is constructed, including multiple sub-classifiers. Each sub-classifier corresponds to a non-leaf node in the music type classification tree. Each sub-classifier consists of a support vector machine, a random forest, and a gradient boosting decision tree. The support vector machine uses the RBF kernel function, the random forest contains 100 decision trees, and the gradient boosting decision tree is implemented using the XGBoost algorithm.

[0160] A feature set is customized for each sub-classifier, including the dimensionality-reduced feature vector and node-specific domain features. For example, for the pop music node, relevant features such as rhythm and harmony can be added; for the classical music node, relevant features such as instruments and timbre can be added.

[0161] Each sub-classifier is trained using the stratified cross-validation method. The dataset is divided into 5 folds for 5 times of cross-validation. In each validation, 4-fold data is used to train the base model, and the remaining 1-fold data is used as the validation set. The Stacking method is used to fuse the prediction results of the base models, that is, the prediction results of the base models are used as new features to train a meta-classifier (such as logistic regression) to obtain the final prediction result.

[0162] A hierarchical decision-making strategy is designed, defining a confidence threshold and a node selection function. The confidence threshold is used to judge whether to continue downward classification, and the node selection function is used to select the next sub-node to be classified. For example, the confidence threshold can be set to 0.8, and classification stops when the prediction probability of a certain category is greater than 0.8. The node selection function can select the sub-node with the highest prediction probability to continue classification.

[0163] The feature importance vector of each node is calculated, and the SHAP value is used to quantify the importance of the features. The SHAP value reflects the contribution degree of the features to the model prediction and can be estimated by calculating the difference in the model prediction results before and after the feature is missing. For each feature, the average of the absolute values of its SHAP values is calculated to obtain the importance score of the feature.

[0164] A weight adjustment function is designed to dynamically adjust the feature weights according to the difference in feature importance between the current node and the parent node. When classifying to the next lower layer each time, the weight adjustment function is used to update the feature vector. Each feature value in the original feature vector is multiplied by the corresponding adjusted weight to obtain the updated feature vector.

[0165] Introduce an adaptive mechanism to dynamically adjust the parameters of the weight adjustment function according to the classification performance. For example, a performance evaluation metric (such as the F1 score) can be defined, and this metric is calculated after each classification. If the metric value increases, the adjustment coefficient α is increased; if the metric value decreases, the adjustment coefficient α is decreased.

[0166] Input the dimensionality-reduced feature vector into the hierarchical classification model. Starting from the initial node, perform refined classification layer by layer downward, and dynamically adjust the feature weights during the classification process at each level. For example, assume the initial node is "Music", the first-level classification result is "Pop Music", the second-level classification result is "Chinese Pop", and the third-level classification result is "Chinese Male Pop". During the classification process at each level, the weight adjustment function is used to update the feature vector to highlight the key features of the current level.

[0167] Finally, output the final music genre classification result, which is "Chinese Male Pop". This result is obtained through multi-level and refined classification, making full use of high-level semantic features and head features, and dynamically adjusting the feature weights during the classification process, improving the accuracy and robustness of the classification.

[0168] Figure 2 This is a schematic structural diagram of the music information classification system based on data code head recognition according to an embodiment of the present invention, as Figure 2 shown, the system includes:

[0169] The first unit is used to perform time-frequency domain conversion on the input audio data to obtain a spectrogram; extract a multi-dimensional feature vector from the spectrogram, input the multi-dimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generate a data code of the audio data according to the high-level semantic features;

[0170] The second unit is used to construct a data code head recognition model, input the generated data code into the data code head recognition model to extract the head features of the data code; perform preliminary classification on the audio data according to the head features to obtain a preliminary classification result; establish a music genre classification tree, and the music genre classification tree includes music genre nodes at multiple levels; locate the initial node in the music genre classification tree according to the preliminary classification result;

[0171] The third unit is used to perform multi-modal feature fusion on the high-level semantic features and the head features to obtain a fused feature vector; construct a hierarchical classification model, and the hierarchical classification model includes multiple sub-classifiers, and each sub-classifier corresponds to a non-leaf node in the music genre classification tree; input the fused feature vector into the hierarchical classification model, and starting from the initial node, perform refined classification layer by layer downward;

[0172] A fourth unit, which is used to dynamically adjust the feature weights during the classification process at each level to highlight the key features of the current level; update the music type classification tree according to the classification results, including adding new music type nodes or adjusting the relationships between nodes; and output the final music information classification result.

[0173] In a third aspect of the embodiments of the present invention,

[0174] a kind of electronic device is provided, including:

[0175] a processor;

[0176] a memory for storing instructions executable by the processor;

[0177] wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.

[0178] In a fourth aspect of the embodiments of the present invention,

[0179] a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.

[0180] The present invention may be a method, a device, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for executing various aspects of the present invention are uploaded.

[0181] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A music information classification method based on data terminal part recognition, characterized in that: include: Perform time-frequency domain conversion on the input audio data to obtain a spectrogram; Extracting a multidimensional feature vector from the spectrogram, inputting the multidimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generating a data code of the audio data based on the high-level semantic features; Constructing a data header recognition model, inputting the generated data code into the data header recognition model, and extracting the header features of the data code; Performing preliminary classification of the audio data according to the head features to obtain preliminary classification results; establishing a music type classification tree, wherein the music type classification tree includes multiple levels of music type nodes; Locating an initial node in the music type classification tree according to the preliminary classification result; Performing multimodal feature fusion on the high-level semantic features and the head features to obtain a fused feature vector; constructing a hierarchical classification model, wherein the hierarchical classification model includes multiple sub-classifiers, each sub-classifier corresponding to a non-leaf node in the music type classification tree; inputting the fused feature vector into the hierarchical classification model, and performing refined classification layer by layer starting from the initial node, including: Normalize the high-level semantic feature vectors and head feature vectors to eliminate the dimensional differences between different features. Use the random forest algorithm to evaluate the importance of the standardized features and calculate the Gini importance index of each feature. Based on the Gini importance index, select the most important feature subset. The attention mechanism is used for feature fusion. The attention weight matrix is defined. The softmax function is used to calculate the weight of each feature to obtain the fused feature vector. The principal component analysis is performed on the fused feature vector to reduce the dimension and obtain the reduced feature vector. Constructing a hierarchical classification model, the hierarchical classification model including multiple sub-classifiers, each sub-classifier corresponding to a non-leaf node in a music type classification tree, and each sub-classifier consisting of a support vector machine, a random forest, and a gradient boosting decision tree; A custom feature set is created for each sub-classifier, including the reduced feature vector and node-specific domain features. Each sub-classifier is trained using a stratified cross-validation approach, and the prediction results of the base model are integrated using a stacking approach. A hierarchical decision strategy is designed, defining confidence thresholds and node selection functions for node selection and termination condition determination during the classification process. Calculate the feature importance vector of each node and use SHAP value to quantify the importance of the feature; design a weight adjustment function to dynamically adjust the feature weight according to the difference in feature importance between the current node and the parent node; Each time the classification is performed down a layer, a weight adjustment function is used to update the feature vector; an adaptive mechanism is introduced to dynamically adjust the parameters of the weight adjustment function according to the classification performance; the feature vector after dimensionality reduction is input into the hierarchical classification model, and refined classification is performed layer by layer starting from the initial node, and the feature weights are dynamically adjusted during the classification process at each level; and the final music type classification result is output; During the classification process at each level, the feature weights are dynamically adjusted to highlight the key features of the current level; the music type classification tree is updated based on the classification results, including adding new music type nodes or adjusting the relationship between nodes; and the final music information classification results are output.

2. The method according to claim 1, characterized in that Inputting the multidimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generating a data code of the audio data according to the high-level semantic features includes: Reshaping the multidimensional feature vector into a mel-spectrogram format; inputting the mel-spectrogram into a pre-trained VGGish deep neural network model; extracting high-level semantic features through convolutional layer blocks and fully connected layers of the VGGish deep neural network model; Quantizing each element of the high-level semantic feature into an 8-bit unsigned integer; performing bit plane decomposition on the quantized feature vector to obtain 8 binary bit planes; calculating the entropy value of each binary bit plane; sorting the binary bit planes according to the entropy value, and selecting the first K binary bit planes with the largest amount of information; Connect the selected K binary bit planes into a long binary sequence and compress the long binary sequence using run-length encoding; if the compressed length exceeds the target length, truncate it; if the compressed length is less than the target length, fill it with zeros to reach the target length; A checksum of the compressed sequence is calculated using a CRC-32 algorithm; the checksum is added to the end of the compressed sequence to generate a binary data code of a fixed length.

3. The method according to claim 1, characterized in that Constructing a data header recognition model, inputting the generated data code into the data header recognition model, and extracting the header features of the data code; The audio data is preliminarily classified according to the head features, and the preliminary classification results include: The data terminal part recognition model includes a convolutional neural network and a recurrent neural network; the convolutional neural network includes multiple convolution kernels of different sizes, and each convolution kernel size is provided with multiple filters; the recurrent neural network is a bidirectional long short-term memory network; a self-attention mechanism layer is provided after the bidirectional long short-term memory network; The data code is converted into a data code sequence represented by a numerical value; the converted data code sequence is input into the data header recognition model; multi-scale local features are extracted through the convolutional neural network and maximum pooling operation; the extracted multi-scale local features are input into the bidirectional long short-term memory network to obtain context-related feature representations; the importance weights of different positions are calculated using the self-attention mechanism layer; the weighted features are passed through the fully connected layer to obtain the head features of the data code; The head features are subjected to z-score normalization; the standardized head features are subjected to dimensionality reduction using a principal component analysis method, and the principal components whose explained variance ratio reaches a preset threshold are retained; a random forest classifier is constructed, and the reduced dimensionality head features are input into the random forest classifier to obtain the probability that each sample belongs to each music category; and the category with the highest probability is selected as the preliminary classification result.

4. The method according to claim 3, characterized in that The method further comprises: The classification performance was evaluated using a cross-validation method to calculate accuracy, precision, recall, and F1 score. Misclassified samples were analyzed to identify difficult-to-classify music types. Based on the analysis results, the parameters of the data center identification model and the random forest classifier were adjusted to improve the classification accuracy.

5. The method according to claim 1, wherein Establishing a music type classification tree, wherein the music type classification tree includes multiple levels of music type nodes; Positioning an initial node in the music type classification tree according to the preliminary classification result includes: Constructing a music type classification tree, the construction of the music type classification tree includes: defining a multi-level music category, each node including a unique identifier, a node name, a parent node, a list of child nodes, a feature vector, and a number of samples; collecting labeled music samples, analyzing the samples using a clustering algorithm, and dynamically adjusting the tree structure; calculating a representative feature vector for each node, the representative feature vector being a mean vector of high-level semantic features of all music samples at the node; calculating cosine similarity between all nodes, and constructing an inter-node similarity matrix; Classifying an input music sample, wherein the classifying the input music sample comprises: extracting a high-level semantic feature vector of the music sample; performing preliminary classification on the music sample using a random forest classifier to obtain a probability distribution of each top-level category; selecting the top N top-level categories with the highest probability, and performing a multi-path search on each selected top-level category, wherein the multi-path search comprises starting from a top-level node, calculating a similarity between a feature vector of the music sample and a feature vector of a current node, selecting a child node with the highest similarity to proceed to the next level, and repeating this process until a leaf node is reached or the similarity falls below a preset threshold; Collect all candidate nodes obtained by multi-path search, calculate the similarity between the music sample feature vector and the feature vector of each candidate node, sort the candidate nodes according to the similarity; and select the candidate node with the highest similarity as the initial node.

6. The method according to claim 5, characterized in that Evaluating the classification results and optimizing the classification tree, wherein the evaluating the classification results and optimizing the classification tree include: Calculate the similarity between the feature vector of the music sample and the feature vector of the initial node, compare the similarity with a preset threshold, and evaluate the classification confidence; if the confidence is lower than the preset threshold, mark the music sample as "uncertain"; record the classification results, including the initial node, confidence, and search path; update the sample quantity and feature vector of the node based on the classification results; regularly recalculate the similarity matrix between nodes to optimize the music type classification tree structure.

7. A music information classification system based on data terminal part recognition, used to implement the method according to any one of claims 1 to 6, characterized in that: include: The first unit is used to convert the input audio data into time-frequency domain to obtain a spectrogram; Extracting a multidimensional feature vector from the spectrogram, inputting the multidimensional feature vector into a pre-trained deep neural network model to extract high-level semantic features; generating a data code of the audio data based on the high-level semantic features; The second unit is used to build a data header recognition model, input the generated data code into the data header recognition model, and extract the header features of the data code; Performing preliminary classification of the audio data according to the head features to obtain preliminary classification results; establishing a music type classification tree, wherein the music type classification tree includes multiple levels of music type nodes; Locating an initial node in the music type classification tree according to the preliminary classification result; The third unit is configured to perform multimodal feature fusion on the high-level semantic features and the head features to obtain a fused feature vector; construct a hierarchical classification model, wherein the hierarchical classification model includes a plurality of sub-classifiers, each sub-classifier corresponding to a non-leaf node in the music type classification tree; input the fused feature vector into the hierarchical classification model, and perform refined classification from the initial node downward layer by layer; The fourth unit is used to dynamically adjust the feature weights during the classification process at each level to highlight the key features of the current level; Update the music type classification tree according to the classification results, including adding new music type nodes or adjusting the relationship between nodes; output the final music information classification results.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Music genre identification method and device, equipment and storage medium

    CN113450828A

  • Music genre classification method and system fused with knowledge graph

    CN115881160A