Parametric Optimization of Violin Top Plates using Machine Learning
Davide Salvi, Sebastian Gonzalez, Fabio Antonacci, Augusto Sarti
PPARAMETRIC OPTIMIZATION OF VIOLIN TOP PLATES USINGMACHINE LEARNING
Davide Salvi, Sebastian Gonzalez, Fabio Antonacci and Augusto Sarti
Dipartimento di Elettronica Informazione e Bioingegneria, Politecnico di Milano, Milan, Italye-mail: [email protected]
We recently developed a neural network that receives as input the geometrical and mechanical param-eters that define a violin top plate and gives as output its first ten eigenfrequencies computed in freeboundary conditions. In this manuscript, we use the network to optimize several error functions, withthe goal of analyzing the relationship between the eigenspectrum problem for violin top plates andtheir geometry. First, we focus on the violin outline. Given a vibratory feature, we find which is thebest geometry of the plate to obtain it. Second, we investigate whether, from the vibrational point ofview, a change in the outline shape can be compensated by one in the thickness distribution and viceversa. Finally, we analyze how to modify the violin shape to keep its response constant as its materialproperties vary. This is an original technique in musical acoustics, where artificial intelligence is notwidely used yet. It allows us to both compute the vibrational behavior of an instrument from its ge-ometry and optimize its shape for a given response. Furthermore, this method can be of great help toviolin makers, who can thus easily understand the effects of the geometry changes in the violins theybuild, shedding light on one of the most relevant and, at the same time, less understood aspects of theconstruction process of musical instruments.Keywords: violin, optimization, neural network, finite element methods, artificial intelligence
1. Introduction
The question of which is the best geometry for a violin is still open in the instrument making field. Wedo not have a real clue why Guarneris have one shape and Stradivaris has another, which is the best outlineto obtain a given vibrational feature or how a shape change affects the final response of the instrument.Some studies have been done in this direction [1], and we now know the influence of the shape of thef-holes on the emitted sound [2] or how to change the violin arching to compensate variations of thewood parameters [3]. However, it is not yet clear how the sound is affected by geometric changes of theinstrument.As a first step in understanding this, we focus on the vibrational response of the free violin top plates.This comes from the assumption that the sound radiated by the complete instrument depends, probablyin a non-linear and very complex manner, on how the individual elements of the violin vibrate and thatthe top is the most resonant part of the instrument. We developed a method to parametrize a violin topplate in its geometrical and mechanical aspects. With the method, we created a large set of plates thatwe used to train a neural network to predict the vibratory response of the plate. In [4] we mainly focusedon its predictive power and the inherent correlations between geometry and vibrational response. In thismanuscript we focus on several use cases of the network for violin design and optimization.In the state of the art, the most used simulation method to study real musical instruments is theFinite Element Method (FEM) [5], which is a very powerful but also time-consuming process. The main a r X i v : . [ c s . S D ] F e b dvantage of our approach lies in the fact that, using neural networks, we can compute and optimize thevibrational response of a violin top plate in few seconds, taking much less time than with a FEM analysis.It also shows how advances in machine learning can serve the development of a 300 years old craft andis the first step to build a network that predicts how a violin sounds from its material parameters andgeometry, which could be an invaluable tool for violin makers.
2. Definition of the datasets and the neural network
The first step of our study is building the dataset used to train and test the neural network. We do soby creating a wide range of parametrically varied violin top plates and computing their eigenfrequencyvalues in free boundary conditions. We build the meshes and compute their vibrational responses asin [6]. As a starting point for constructing the dataset, we consider a real historical violin that we hadthe possibility to scan. The reference geometric parameters are those that best fit the top plate of thisinstrument. We vary the characteristics of the built plates from three different parameter spaces: shape ofthe outline, thickness distribution, and mechanical properties. Each of these is controlled by a differentnumber of variables, which are 20 for the outline ( p i ), 8 for the thickness ( t i ), and 7 for the material ( m i ).The variation of each parameter is computed in a random way using a zero-mean Gaussian distribution.The full explanation of the dataset creation can be found in [4]. Depending on the number of aspectswe decide to vary, we build several datasets, where a different number of parameters is needed to defineevery single mesh.For what concerns the neural network, we use a feed-forward network [7] with a single hidden layerand a sigmoid activation function connected to a linear output layer. The number of neurons in the inputand hidden layers changes according to the dataset we use, while the architecture of the network remainsunchanged. The fully connected structure is fed with all the parameters and outputs the vector containingthe first ten natural frequencies f i of the top plate.The train and test sets are found randomly shuffling the datasets’ elements and dividing them witha ratio of 9/1. The network is then trained using the Levenberg-Marquardt training function, whichis a combination of gradient descent and Newton’s method and a variable number of epochs for eachtraining, always below 100. All the networks we train have a coefficient of multiple determination R that is greater than 0.9, so that we can consider our method as reliable and use it in the following studies[4].
3. Optimization procedure
Once the neural network is trained, we have a multidimensional function that depends on the outlineshape, thickness profile and material parameters of the plate. We call this function F ( p , ..., p ; t , ..., t ; m , ..., m ) = f i . (1) F is continuous and differentiable in all its variables, but not necessarily invertible. We can use thisfunction in two different ways. In the first, we start from the parameters of a given violin mesh andcompute its eigenfrequency values. This application is useful to predict the vibrational response of a topplate before it is built. In the second method, we set a vibrational feature f on the natural frequenciesvector. Then, we optimize the input parameters of F to find a mesh whose response f i is as close aspossible to f . In this paper, we focus on the second method, optimizing the shape of violin plates inseveral cases. To measure how well the estimated eigenfrequency set f i fits with the desired vibrationalfeature f , we define several error functions (cid:15) that can vary according to the analyses and we minimizet. We do so using the Matlab fminsearch function, which follows the Nelder-Mead simplex method [8].We consider a bounded minimization version of the algorithm to avoid large variations of the parametersthat could lead to unrealistic violin plates. We set a maximum change of the variables of 20% in bothdirections, consistent with how we built the dataset. During the optimization process, the error functionis evaluated for a maximum of ∗ N v times before the minimum is reached, where N v is the numberof variables considered.
4. Optimizing the outline of the violin top plate
In this section we focus on the outline shape of the plate analyzing its role in determining severalvibrational features. The vibrational characteristics that we consider are taken as examples to show thecapability of our method in improving the violin design while we do not discuss their importance in theinstrument-making field [9]. Any other feature could be chosen and the geometry of the violin plate couldbe optimized for that.The vibrational feature we consider in this first study is the ratio between the fifth and second modesof the plate, namely f = f /f , which is a simple modal relation that violin makers usually compute inthe violin building process. The role of this ratio has been discussed in [10]. We start by defining the lossfunction as (cid:15) = ( α − f ) (2)where α is the value of the frequency ratio we want to achieve, and we minimize the loss function forchanging values of α . We start from α = 2 . , which is the optimal value set in the literature, andwe vary it by 5% in both directions. We look for the minimum of the loss function by changing theoutline parameters and predicting the frequency values using the neural network. Our starting point arethe parameters that best fit the reference violin we used to build the dataset, which has a f ref = 2 . .The resulting outlines are shown in Fig. 1 with the (cid:15) label. The blue line represents the referenceoutline, while the orange and green ones are obtained respectively by increasing and decreasing α fromthe nominal value. There is a correlation between the value of the ratio and the outline shape and, inparticular, the ratio increases as we increase the width of the violin. To validate the results we take themesh of the plate whose predicted value of the ratio is equal to f pred = 2 . and we simulate it in Comsolwith FEM to actually compute the ratio, since its set of parameters was not part of the dataset. Theresulting value of the ratio is f FEM = 2 . . We have checked all the outlines, and the error has alwaysbeen smaller than .Secondly, we consider the first vibrational modes of the violin top plate and we change its outlineshape to optimize the frequency value of each of them. In particular, we modify the eigenfrequenciesby 5% in both directions from their reference values. This study aims to see how changes in the outlineshape affect the frequency values of individual vibrational modes and detect whether some modes aremore subject to change than others.The error function we consider in this case is (cid:15) i = ( β − f i ) (3)where f i is the eigenfrequency corresponding to the i -th mode and β the target value. In particular β = f ref i ± .The results of this study are shown in Fig. 1, where we have plotted only the outlines of modes 1, 2and 5, which are the most observed by luthiers in the construction processes of their violins. In the Figure,the blue line represents the reference outline, while the orange and green ones are obtained respectivelyby increasing and decreasing the respective eigenfrequency values. We observe that not all the modes Figure 1: Outline shapes optimized for different values of f and single modes f i . The f ratio isoptimized by (cid:15) , while the single modes i are optimized by (cid:15) i . Orange and green lines represent theoutlines for increased and decreased ratio/eigenfrequency values, respectively.behave in the same way. Still, the relationship between each individual vibrational mode and the outlineshape is unique and different from the others, meaning that the relationship between the violin geometryand its vibrational properties is highly non-linear. In particular, mode 1 shows a large outline change,contrary to mode 2, where the profile remains almost unchanged.
5. Vibratory equivalence between changes in outline shape and thicknessdistribution
Here we want to see if, from the vibrational point of view, a change in the outline shape of a violintop plate can be balanced with a variation in its thickness distribution and vice versa. The purpose of thisstudy is to prove that these two geometric aspects, under certain circumstances, can be equivalent to eachother in determining the final vibratory response of the plate.We start from the geometry and the eigenfrequency values of the reference violin. Then, we impose achange in the outline shape of the plate and optimize its thickness distribution to bring the eigenfrequencyvalues back to their initial values. We also do the opposite by imposing a change in the thickness distri-bution and optimizing the outline shape to balance the shift. The whole procedure can be summarizedas: f i → F ( p + δ, t ) → F ( p + δ, t (cid:48) ) → f ,f i → F ( p, t + δ ) → F ( p (cid:48) , t + δ ) → f , where f has to be as close as possible to f i . We modify the outline and thickness parameters randomly,as p (cid:48) i → p i (1 + δ i ) where δ i is taken from a zero-mean Gaussian distribution with increasing σ values.At the end of each optimization, we measure the error between the obtained eigenfrequencies and thereference ones. We do so by using two different error functions, which are (cid:15) = 1 N N (cid:88) i =1 (cid:12)(cid:12)(cid:12) f opti − f refi (cid:12)(cid:12)(cid:12) f refi , (cid:15) = (cid:12)(cid:12)(cid:12) ¯ f opti − ¯ f refi (cid:12)(cid:12)(cid:12) ¯ f refi (4) .02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.210 -8 -6 -4 -2 i - Thickness opim. - Outline optim. - Thickness optim. - Outline optim. Figure 2: Outline (thickness) optimization for changing values of the thickness (outline) parameters.Here are shown the values of (cid:15) and (cid:15) for increasing values of σ . The plotted values are the average of20 different simulations.where f opti and f refi are vectors containing the predicted values of the first 10 eigenfrequencies ofthe optimized and reference plates respectively and ¯ f i is the mean of a frequency vector. The first errorfunction considers the distances between all the individual modes in the optimized and target cases. Onthe other hand, the second function measures only the one between the mean frequencies in the two cases. (cid:15) represents the ideal error function and aims to make the response of the optimized plate identical tothe target one. Nevertheless, we are aware that this function is difficult to minimize due to the stronglynon-linear relationships present between the vibrational modes. For this reason, we have introduced (cid:15) ,which is less severe and less difficult to minimize but at the same time produces meaningful results.Figure 2 shows the results of the analysis for increasing values of σ , obtained as an average betweenthe values of 20 different optimizations. We observe that the best results are given by the outline opti-mizations. This means that we can compensate for variations in the thickness distribution by changingthe outline shape, but not vice versa. This could be due to the greater number of parameters needed todefine the contour leading to a more efficient higher-dimensional optimization. However, the thicknessoptimization manages to achieve acceptable results, especially for low σ , with (cid:15) i values that do not ex-ceed 10%. Furthermore, as we anticipated, we have better results for (cid:15) than for (cid:15) . This is evident in theoutline case, while for the thickness the two error functions have similar behavior.Our initial hypothesis of vibrational equivalence between variations in the outline and thickness dis-tribution has proved wrong. We have shown that it is possible to optimize the vibrational response of aplate through the outline shape, while the thickness distribution can be used for fine-tuning.
6. Shape optimization for material properties changes
In this section we add to the analysis also the wood properties of the plate. In particular, we impose achange in the material parameters and modify the geometry of the plate to keep its vibrational responseunaltered. This is done because the wood selection is a critical step in building a musical instrument.We want to show that it is possible to work on the geometry to optimize the final vibrational responsenotwithstanding the material properties, which is potentially groundbreaking for violin makers.The material properties we can control in F are density, Young’s modulus, and Poisson’s ratio in the3 main directions of wood, for a total of 7 parameters. In this study, we randomly modify all of them, Mode number F r equen cy v a r i a t i on Modified MaterialThickness optim.Outline optim.Complete optim. N o o p t i m . T h i c k n e s s o p t. O u t li n e o p t. C o m p l e t e o p t. -1 = 1.167 = 0.326 = 0.038 = 0.026 Figure 3: Left: Eigenfrequency values obtained modifying the material properties of the plate and op-timizing its shape for (cid:15) . All the frequencies are normalized with respect to the reference ones. Right:Error (cid:15) in the four cases considered, logarithmic scale. The error bars are the stardard deviation fromthe mean value.as m (cid:48) i → m i (1 + δ i ) where δ i is taken from a zero-mean Gaussian distribution with σ = 0 . , valuessomehow representative of the actual variation in tone woods. Then, we optimize the geometry of theplate in 3 different ways to bring its eigenfrequency values back to the reference ones considering (cid:15) aserror function. The three optimizations are thickness only F ( p i ; ¯ t i ; m (cid:48) i ) , outline only F (¯ p i ; t i ; m (cid:48) i ) , andthickness and outline together F (¯ p i ; ¯ t i ; m (cid:48) i ) where the bar indicates which parameters we are optimizing.To highlight the variations, the left plot in Fig. 3 shows the optimized eigenfrequency values nor-malized by the reference ones. The plotted values are the average of 20 different optimizations. Weobtain the best overall results by optimizing both the outline shape and the thickness distribution. Thefull optimization gives for all f i the best results, save in the case of mode 10. Notably, the f can only bepredicted with less than 1% error for the complete optimization. Notice how the optimization lowers theerror almost two orders off magnitude.Among all the mechanical parameters, we now focus on two of the most relevant: density ( ρ ) andYoung’s modulus in the wood’s principal direction ( E y ). If we approximate the wood plate to a bar weobtain that their ratio has clear physical meaning c = (cid:115) E y ρ , (5)where c is longitudinal wave propagation velocity in the plate [11] (disregarding the effect of the Poisson’sratio). We changed the density and Young’s modulus values in the range [-10%, +10%] with a step of2%, optimizing the violin shape both in thickness and outline to obtain the minimum values of (cid:15) . Thestarting values are the standard parameters of Sitka Spruce, that are ρ = 400 kg/m and E y = 10 . GP a .The image on the left of Fig. 4 shows the results of the analysis, where the value of (cid:15) increases aswe increase the variation of the material parameters. The red line represents a region where the soundspeed is constant and equal to c = 5200 m/s , and the optimization achieves better results. Interestingly,our algorithm is able to find a rather good optimal shape for rather large variations of the density andstiffness. It also seems to indicate that the larger the sound speed difference between two samples, the‘harder’ (larger (cid:15) ) is to optimize the shape. To quantify the shape variation, in the right plot of Fig. 4, we
10% -5% 0% 5% 10%
Density variation -10%-5%0%5%10% Y oung ' s m odu l u s v a r i a t i on -3 -6% -4% -2% 0% 2% 4% 6% Area variation W a v e s peed [ m / s ] Figure 4: Left: Geometry optimization of (cid:15) as density and Young’s modulus in the wood principaldirection change. The red line represents a constant sound speed region, where the optimization achievesbetter results. Right: Scatter plot of the area variation before/after optimization (normalized by the areaof the reference violin) versus c for the points in the grid of the left figure, R = 0 . .show the area change versus the sound speed variation for each point of the left image. The surface of theplate and the wave speed are highly correlated ( R = 0 . ), which intuitively tells us that the lower thesound speed of a material, the narrower the violin needs to be to vibrate as the reference model. On thecontrary, if the sound speed is higher, the violin shape needs to wider. The variation is rather significantand one can recognize distinct historical examples on the resulting outlines.
7. Conclusions
We have presented a new approach to geometric optimization of violin top plates with FEM simula-tions and Neural Networks. Rather than a priori deciding on what to optimize, we have shown that doinga Gaussian sampling of the parameter space can be used to predict an arbitrary loss function based on theeigenfrequency values. The computational time needed to create the dataset is comparable to the timeneeded for one optimization, whereas the speed up gained with the NN is almost 3 orders of magnitude.The results presented here point towards a complete re-thinking of today’s violin-making practice:rather than copy old models violin to reproduce their sound, violin makers should look at what type ofmaterial we have nowadays and modify the shape of the violin to obtain a desired vibrational response.We have shown that varying only the thickness of the violin, as traditional plate tuning suggests [12], isfar from optimal, and varying the outline is much more effective. In future developments of this study weaim to increase the number of parameters used to define the violin plate to make the model as completeas possible. We can consider different instrument lengths or different profiles for the longitudinal andtransverse archings. Varying these parameters will change the vibrational response of the plates, but wedo not see any reason why the same methodology cannot be applied for those cases.We have used our method to compute the vibrational response of violin plates, but the same method-could probably work in either other geometries or other physical variables (e.g. displacement at a point,stiffness of the resulting geometry). We have not studied the prediction of the spatial behavior of themodes, but research in our own group has shown that this can be predicted with convolutional and au-toencoders networks [13]. The path towards optimization of sound seems finally within reach, more than300 years after Stradivari built the instruments that inspired this study.
EFERENCES
1. Gough, C. Violin plate modes,
The Journal of the Acoustical Society of America , (1), 139–153,(2015).2. Nia, H. T., Jain, A. D., Liu, Y., Alam, M.-R., Barnas, R. and Makris, N. C. The evolution ofair resonance power efficiency in the violin and its ancestors, Proceedings of the Royal Society A:Mathematical, Physical and Engineering Sciences , (2175), 20140905, (2015).3. Tinnsten, M. and Carlsson, P. Numerical optimization of violin top plates, Acta Acustica united withAcustica , (2), 278–285, (2002).4. Gonzalez, S., Salvi, D., Baeza, D., Antonacci, F. and Sarti, A. A data-driven approach to violinmaking, arXiv preprint arXiv:2102.04254 , (2021).5. Torres, J. A., Soto, C. A. and Torres-Torres, D. Exploring design variations of the titian stradivariviolin using a finite element model, The Journal of the Acoustical Society of America , (3), 1496–1506, (2020).6. Gonzalez, S., Salvi, D., Antonacci, F. and Sarti, A. Eigenfrequency optimisation of free violin plates, JASA , Accepted (X), XX, (2021).7. Carrasquilla, J. and Melko, R. G. Machine learning phases of matter,
Nature Physics , (5), 431–434, (2017).8. Lagarias, J. C., Reeds, J. A., Wright, M. H. and Wright, P. E. Convergence properties of the nelder–mead simplex method in low dimensions, SIAM Journal on optimization , (1), 112–147, (1998).9. Davis, E. B. On the effective material properties of violin plates, (2013).10. Curtin, J. Tap tones and weights of old italian violin tops, Journal of the Violin Society of America , (2), 161, (2005).11. Norton, M. P. and Nelson, F. C., (1990), Fundamentals of noise and vibration analysis for engineers .12. Hutchins, C. M. The acoustics of violin plates,
Scientific American , (4), 170–187, (1981).13. Olivieri, M., Pezzoli, M., Malvermi, R., Antonacci, F. and Sarti, A. Near-field acoustic holographyanalysis with convolutional neural networks,48th International Congress and Exposition on NoiseControl Engineering